-
-
Notifications
You must be signed in to change notification settings - Fork 22.8k
LSP: Fix file URI handling + warn about workspace project mismatch #104401
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
Conversation
82702ce
to
3bcba4e
Compare
Tested this on Windows. I still get the #103565 error about "Hides a global script class" in VS Code, and I see the new warning even when editing the opened project (I launched VS Code from Godot in fact).
|
Thanks for testing! Sounds a bit like Godot could load such paths, but not make them local to the project. I'll spin up a VM and take a look I guess. |
The actual hard part wasn't the leading slash, but dealing with the case insensitive file system. I made some adjustments so that paths should now be correctly mapped to the casing with which they are known to Godot. I did some basic testing in a VM but another round of testing by actual windows users would be appreciated. |
d91d00b
to
46b33a6
Compare
93e60cb
to
88d9098
Compare
I'll mark this as ready for review since I'm done on the code side of things, and my limited testing seemed to work. |
88d9098
to
2f3d6b7
Compare
This is working in my project under windows and resolved the annoying error using vscode. Thanks for your work |
modules/gdscript/language_server/gdscript_language_protocol.cpp
Outdated
Show resolved
Hide resolved
modules/gdscript/language_server/gdscript_language_protocol.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on Windows, works fine for the most part. I couldn't reproduce 'Hides a global script class' errors, but the others are fixed. This also fixes using certain symbols in filenames.
I don't know much about the EditorFileSystem, but it uses threads itself and EditorHelp seems to use parts of it in a thread, so it is probably fine.
9bd153d
to
a1edb9c
Compare
I think I was able to reproduce this, by checking the paths which VSCode sends and then opening Godot via CMD at the same path but with a different capitalization of the drive letter. |
Thanks! |
Fixes #103565
Fixes #92248
Fixes #105000
Might have an influence on:
godotengine/godot-vscode-plugin#649
godotengine/godot-vscode-plugin#650
This PR does two things:
Replaces the file URI handling from the language server with an implementation based on rfc3986 and rfc8089. So that the URI is properly read and decoded.
Do stuff to convert the absolute URI path to a valid res path, taking into account projects in symlinked directories and case insensitive file systems. This should solve a lot of problems with duplicate class name errors when using the language server.
Also adds a warning if the root location of the workspace does not match the project which is open in Godot.
TODO: