You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was getting the following error over and over on Windows using lsp-mode in Emacs. This was both with the 0.0.9 release and with a build from master (merging in #48 to resolve the xerrors issue). (My computer had to reboot for unrelated reasons between receiving the error and posting this so cannot post the exact errors).
go panic runtime error invalid memory address or nil pointer dereference
The stack pointed to langserver/did_open.go:12 specifically the fileURL definition. Comparing this to the lsp-mode logs it was trying to open a file located at /C:/Users/acmeuser/git/tf-test/main.tf since the original fileURL being passed was file:///C:/Users/acmeuser/git/tf-test/main.tf. This does not work for Windows since it defines the protocol as file:/// not file://. Updating with the below diff and recompiling resolved the issue.
I'm willing to open a PR for this change, however I'm aware it would also require updating to account for Windows vs Linux and I'm not familiar enough with Go to do so (without research first)
This is in response to issue at: juliosueiras#50
A panic would be raised on Windows computers, where removing the
file:// scheme would still have an invalid leading slash
(e.g. '/C:/Users/...').
This is in response to issue at: juliosueiras#50
A panic would be raised on Windows computers, where removing the
file:// scheme would still have an invalid leading slash
(e.g. '/C:/Users/...').
Fixesjuliosueiras#50
Linked PR uses the URI methods from the original go-language-server project. If we want, we can vendor or import, etc. I also resolved the same issue with the did_change and complete functions.
I don't have a Windows computer to verify these changes, but this should resolve the issue as stated.
I was getting the following error over and over on Windows using
lsp-mode
in Emacs. This was both with the 0.0.9 release and with a build from master (merging in #48 to resolve the xerrors issue). (My computer had to reboot for unrelated reasons between receiving the error and posting this so cannot post the exact errors).go panic runtime error invalid memory address or nil pointer dereference
The stack pointed to
langserver/did_open.go:12
specifically the fileURL definition. Comparing this to the lsp-mode logs it was trying to open a file located at/C:/Users/acmeuser/git/tf-test/main.tf
since the original fileURL being passed wasfile:///C:/Users/acmeuser/git/tf-test/main.tf
. This does not work for Windows since it defines the protocol asfile:///
notfile://
. Updating with the below diff and recompiling resolved the issue.I'm willing to open a PR for this change, however I'm aware it would also require updating to account for Windows vs Linux and I'm not familiar enough with Go to do so (without research first)
The text was updated successfully, but these errors were encountered: