Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Use some canonical path format #1339

Open
Xanewok opened this issue Feb 25, 2019 · 1 comment
Open

Use some canonical path format #1339

Xanewok opened this issue Feb 25, 2019 · 1 comment
Labels
enhancement Indicates new feature requests package: rls-data

Comments

@Xanewok
Copy link
Member

Xanewok commented Feb 25, 2019

Originally created by @staktrace (rust-dev-tools/rls-data#20):

Right now if running the rust compiler on Windows with -Zsave-analysis, the Span::file_name items usually end up with windows-style paths (e.g. Z:\foo\bar.txt). However in some cases they appear to have a mix of windows and unix dir separators (e.g. Z:\foo\bar/lib.rs). This is just weird. It should be consistent in what slashes it's using.

For context, this came up when trying analyze these files for searchfox on a linux host. The rls-analysis crate will read save-analysis files generated on Windows, but the Span::file_name ends up as a PathBuf of a single component because \ is a valid filename char on Linux. I can deal with this by doing a search-and-replace, but when the separators are mixed (both \ and /) it makes me uneasy.

/cc @emilio

@hh9527
Copy link

hh9527 commented Feb 28, 2019

use relative-path crate, always "/" is a better idea, it will avoid many corner case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Indicates new feature requests package: rls-data
Projects
None yet
Development

No branches or pull requests

2 participants