-
Notifications
You must be signed in to change notification settings - Fork 50
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
Local modules not discovered #38
Comments
@PMunch sorry for bumping an old issue, but I feel that I'm doing something wrong, this is such an obvious problem I just can't believe everyone else suffers the same. Do you have the same issue? It basically decimates LSP functionality. |
Hmm, that error message doesn't actually look like anything NimLSP spits out. Do you have any other Nim plug-in? |
I also have installed NimLime as suggested in the installation instructions. If I disable it, the suggestion feature is totally disabled and there's no Nim syntax at all. I'm not really sure where the suggestions are coming from, NimLSP or NimLime 🤔 But I thought NimLime lost nimsuggest integration a long time ago. |
@PMunch Here's some more info on NimLime and NimLSP interaction.
|
2nd makes sense as Sublime needs to know when to run NimLSP, this is done by NimLime recognising Nim and telling Sublime what language it is. At least in Vim there is a way to manually set what syntax a file is and have LSP kick in that way (without any highlighting or anything), could you see if you have anything like that? 3rd is a bit strange, because as far as I know NimLSP should never output that kind of messages, it uses nimsuggest as a library and not as a separate program, so it has full control over how the messages are formatted.. Which version of NimLSP do you have installed? |
Without NimLime enabled, ST won't even offer nim as a syntax highighting options. So, unfortunately, I can't check NimLSP isolated from NimLime, at least I don't know how to do that.
I have nimlsp 0.2.4 installed via Nimble:
|
Hmm, okay, could you try to compile a copy yourself and enable the debug logging? That log might shed some light on what's going on. |
Sure, I'm happy to help. I've compiled nimlsp with Here's what I'm getting in LSP Log Panel: https://pastebin.com/MNZyGB9M |
Very strange, NimLSP seems to do what it is supposed to, but nimsuggest keeps giving it errors. Not 100% sure what is happening there, especially since you said that a manually invoked version of nimsuggest worked fine. Did you try to run nimsuggest manually with a "dirty file" e.g. an edited version of the original file as you can see in the logs there? |
UPD: I think I got what you meant:
Is that what you wanted me to try?
Sorry, I don't think I follow. I haven't edited the file, I'm just saving it to trigger a check, Maybe, add then remove a blank line to create a diff, but that's it. So, there is no dirty file as in “a file with a modification applied.” Running
Please correct me if I misunderstood your question. |
OK, it's starting to make sense. Here's the content of the tmp file,
And here's the content if the directory it's in:
So, of course import from |
Yeah that's normal. That directory contains files with modifications in them that haven't been saved. Nimsuggest supports passing both a file and a dirty file when doing the check or asking for e.g. hover information. In that case it will behave as if the contents of the file where the contents of the dirty file, but it should still look for imports and such in the original folder. Try to run |
Here you go:
Note that I have to deplace C:/ with just /, otherwise it fails:
|
According to what I'm seeing with nimsuggest, it's the opposite: \ should be replaced with /, and C:\ should be /. |
Hmm, this is pretty hard for me to debug as I don't have any Windows machines.. If you want you can have a poke around the code and see if you can get the paths into a format that works. It's a bit odd though, there are definitely people who have tried it on Windows before, even had PRs to fix some other path related issues in the past. |
When invoked by nimlsp, nimsuggest won't see local modules.
Consider the following structure:
If I open spam.nim in Sublime Text 3 with nimlsp, I'm getting this error:
Vanilla nimsuggest, however, doesn't have this issue:
The text was updated successfully, but these errors were encountered: