-
-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting "File name X differs from already included file name Y only in casing" on Windows #2433
Comments
Vetur generally uses its The one (and the main) problem I found is that it doesn't do any normalization in the |
On Sublime Text (and potentially other clients) the paths passed to LSP servers on Windows have upper-case drive letter. So either: - C:\folder\foo or - file:///C:/folder/foo This is problematic with Vetur as it normalizes URI paths received from the client in notifications and requests like "textDocument/completion", "textDocument/didChange" etc. It uses getFileFsPath() utility path to get filesystem path from the URI. But it doesn't do normalization for the filesystem path received through "InitializeParams.rootPath" and then uses that path to initialize the Typescript server. That list (parsedConfig.fileNames in serviceHost.ts) is later used to lookup files passed through other calls and causes issues due to there being duplicate path differing only with drive letter. This issue doesn't reproduce in VSCode as it itself normalizes paths passed to the server and automatically lower-cases the drive letter. Fix by normalizing the path passed through InitializeParams.rootPath. Fixes vuejs#2433
Please post a server log somewhere (on gist for example). (I would suggest restarting VSCode and clear the log manually before reproducing but instead provide a full log since starting VSCode) |
@rchl
|
Vetur: Restart VLS
Info
Problem
After opening a Vue file, getting a diagnostic error like:
The issue happens only on Windows and with editors other than VSCode (at least with Sublime Text). The problem is that vetur does some path normalization but not consistent enough to avoid this problem.
Here are differences between the folders passed through initialize request in ST and Vscode:
ST:
VSCode:
As you can see VSCode normalizes drive letter to lower-case which is why there is no issue there. While it would be possible for ST to do the same, it's not really required per LSP spec, and also the issue is really in vetur as I'll demonstrate in next comment.
A related issue in ST: sublimelsp/LSP-vue#83
Reproducible Case
This issue doesn't reproduce on VSCode as it's doing normalization of passed in paths but it happens in Sublime Text with LSP plugin and possibly on other clients.
The text was updated successfully, but these errors were encountered: