-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Convert lowercase drive letters to uppercase #953
Conversation
I faced a problem that error diagnostics message does not shown in golang source code. In a result of my investigation, this problem occurs when I change the current directory with lowercase driveletter like `cd c:\dev\go\test001`. When `cd C:\dev\go\test001` is no problem. To avoid this problem, we need to convert driver letter to uppercase in lsp#utils#path_to_uri function.
Can you add tests for utils. Path codepath is quite fragile so having unit tests would help with regressions. |
Thank you for your advice. I added a test. |
I need to think about this since it can cause lot of issues. If we are only having issues with diagnostics can we instead fix the diagnostics? vim-lsp/autoload/lsp/ui/vim/diagnostics.vim Lines 247 to 261 in b316729
There are tools like driveup which forces uppercase drive letter but I don't expect them this to be used all the time. |
some more discussions about this at microsoft/language-server-protocol#1019 |
…t of modification
Thank you for explanation why we should not modify utils.vim for lowercase driver letter. I understood it. I'm sorry that I did not add test codes for this modification because I don't know how to add them. |
Here is what i would do.
Having the normalized function would allow us reuse it for other features. To run tests I would add a |
Looking good. Added a nit comment. Can you fix it while I try this on my windows machine to see if it works on typescript language server. |
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.
I tried it on windows with rust-analzyer and typescript-langauge-server and works.
I have added few more comments before I merge.
Thanks for the PR.
Thank you for your code review. I added a comment. But I'm not sure whether or not it is correct English because I'm not native English speaker. |
autoload/lsp/utils.vim
Outdated
@@ -78,6 +78,9 @@ endif | |||
|
|||
if has('win32') || has('win64') | |||
function! lsp#utils#normalize_uri(uri) abort | |||
" Now, it is discussing about normalization of uri. |
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.
Change to the following.
" Refer to https://github.com/microsoft/language-server-protocol/pull/1019 on normalization of urls.
" TODO: after the discussion is settled, modify this function.
No worries. I added comment for the comment. Then should be good to merge. |
Thank you very much for your kindly review. I revised a comment as per as your suggestion. |
Merged. Thanks for the PR and your patience. |
I faced a problem that error diagnostics message does not shown in golang source code. In a result of my investigation, this problem occurs when I change the current directory with lowercase driveletter like
cd c:\dev\go\test001
. Whencd C:\dev\go\test001
is no problem. To avoid this problem, we need to convert driver letter to uppercase in lsp#utils#path_to_uri function.