zeroc-ice / vscode-slice

Slice syntax highlighter for Visual Studio Code
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

Use Paths Everywhere #50

Closed InsertCreativityHere closed 7 months ago

InsertCreativityHere commented 7 months ago

Currently, the extension deals with file addressing in two ways:

This PR changes this so that the extension uses actual Path and PathBuf objects. (Path is to PathBuf as str is to String)

This change fixes #46, because right now, when we're searching for files, we're using string comparison. With this change we'll use path comparisons, which account for things like ./hello == hello and mystuff\foo == mystuff/foo, which obviously string comparison didn't handle.

The real problem is we were using a mix! find_file did path comparison, but files.get(..) did string comparison. Now we only use path comparisons.

Of course, this change also lets us simplify some function changes, and makes find_file unnecessary (most of it was first converting strings to paths, but now we just already have paths)