-
Notifications
You must be signed in to change notification settings - Fork 197
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
BUG: opening up a file via Neotree results in gopls not honoring the package environment (on Windows) #1382
Comments
Looks like neo-tree opens the file with TBH language server must be able to parse both (or any) path style but gopls might not be clever enough. @burgr033 Could you test if gopls works when you open the file with @cseickel Do you think we should use |
Thanks for your reply! The slash seems to be the problem.
|
@burgr033 Thanks for testing. BTW do you remember when you started seeing this issue? I suspect it started recently after this PR was merged which adds an additional backslash when dirname starts with a punctuation. So the reason is that The PR was required when path contains several punctuation If this is the case, I can fix it right away and FYI we will be using pathlib.nvim which will eliminate all these kind of problems in the future. Just out of curiosity, why on earth did you start the name with |
Oh wow, I haven't thought about the
I started learning go a few weeks ago. So I couldn't really tell if this persisted longer.
It's some stupid legacy muscle memory stuff I picked up from my old work. I started it, because it's easier to find in the explorer, is always at the top of the folder list, when sorted by name, and it's really easy to |
I don't have a quick access to Windows so it might take a while. Sorry but please be patient...
👍
NGL this is quite interesting. I use fuzzy finder (fzf) nowadays so I don't need to sort in any means but I'll remember this trick. I used |
Hopefully there is one true form that all windows related tools agree on. Whatever that is we should ensure all paths are run through a class/function to coerce them into that standard form. I can't tell you how sick I am of Windows path issues! If it were only on me then I would officially not support Windows. As it is I just accept PRs that seem reasonable and I totally rely on actual Windows users to determine what works. |
Good news, that is literally pathlib.nvim lol.
LOL me too. Well all issues should be resolved once we fully migrate to pathlib ;) |
If this is too much of an edge case, I can live with renaming my folder tbh. |
No no this is clearly an issue. It's just that we have been dealing with Windows paths problem for so long and I have to launch a VM everytime to even just replicate the issue. I've asked @bwpge to look into the issue #1353 (comment) so it should be fixed soon. |
@burgr033 Could you help us out? |
Sure. I could look into it tonight or tomorrow. |
I'll take a look as well. Appreciate the detailed reporting on this issue :) |
I was able to reproduce the issue with gopls (thanks for the good repro steps). I have a tentatively working solution with the I'm just going to need to brute force inspect every |
I haven't gotten to do anything, so all good! Great that you have found a solution! |
@burgr033 if you maybe have some time this weekend, could you be a second pair of eyes on #1388 and see if it fixes your issue without any other problems? You should be able to just drop-in replace your plugin spec with my fork ( |
Did you check docs and existing issues?
Neovim Version (nvim -v)
v0.9.5
Operating System / Version
Windows 11
Describe the Bug
When I open up a go file through neotree on windows, gopls (the go language server) doesn't work properly because it thinks it's not inside the package environment.
This only happens on Windows. I tried reproducing it on Arch and Debian.
Screenshots, Traceback
Steps to Reproduce
go mod init test123
-- init a new go project inside the repro enviornment.nvim -u init.lua
-- open up neovim:Neotree
-- open up Neotreefile should open now with a package warning through gopls along the lines of
No packages found for open file C:\\_workspace\temp\nvim_test\main.go
Expected Behavior
File should be opened and the package environment should be recognized
(If you open the file without Neotree e.g. with netrw or via command line; everything is working as expected)
Your Configuration
The text was updated successfully, but these errors were encountered: