langserver parsing errors
Both 1.8.1 and 1.10.0 doesn't pase correctly simple code using my packets library. nimble install packets.
import std/[parseopt]
import packets/packets
import packets/json/serialization
var uids: seq[string]
packet UserAuth:
var userId* {.asName: "user_id".}: string
var token*: string
var ts: int64
proc main() =
for kind, key, value in getopt():
case kind
of cmdEnd: break
of cmdShortOption, cmdLongOption:
discard
of cmdArgument:
uids.add(key)
when isMainModule:
main()
1.8.1 just says that
Redefining UserAuth: line 10, column 3
1.10.0 rotating forever "checking file test_code.nim" in VS code toolbar.
This code is perfectly built and working while compiled nim c test_code.nim.
Both 1.8.1 and 1.10.0 depending on nim 2.0.8, but current stable is 2.2.2 and there are some warnings about this while nimble install nimlangserver.
Also while building 1.10.0 there are a big bunch of warnings in chronos libs.
1.8.1 starts, nimble somehow is dead. (no idea why does nimble start even. the flag about starting nimble in directory is disabled in settings)
105829 ? S 0:00 /bin/sh -c /home/qmaster/.nimble/pkgs2/nimlangserver-1.8.1-ac7e989771b76024869c1899b21b6bed92d047e1/nimlangserver --stdio
105830 ? Sl 0:00 /home/qmaster/.nimble/pkgs2/nimlangserver-1.8.1-ac7e989771b76024869c1899b21b6bed92d047e1/nimlangserver --stdio
106370 ? S 0:00 /home/qmaster/.nimble/bin/nimsuggest /home/qmaster/tools/test_code.nim --v4 --autobind --clientProcessId:105830 --exceptionInlayHints:on
106371 ? Sl 0:04 /home/qmaster/.choosenim/toolchains/nim-2.2.2/bin/nimsuggest /home/qmaster/tools/test_code.nim --v4 --autobind --clientProcessId:105830 --exceptionInlayHints:on
107482 ? Z 0:00 [nimble] <defunct>
1.10.0 starts the same and nimble is also dead. --exceptionInlayHints: is somehow sometimes on and sometimes off for same file without changing anything.
Same to me.. on Win11 System / nim --version : 2.2.2
After changing 1.10.0, forever "checking file ___.nim" in vs code status bar... And three more instances are running... and lacking { code completion / hover information } when I open the other nim file.. But on 1.8.1 was working fine..
Thank you for updating nimlangserver.. Please make it more stable.. Thank you again.
@Q-Master had you ran nimble setup so you have a nimble.paths file?
@jmgomez
@Q-Master had you ran
nimble setupso you have animble.pathsfile?
I have no nimble file in that path, because of no need. Auto running nimble setup is disabled in the config of VS code extension, but nimble is somehow called anyways and dies.
$ nimble setup
Tip: 2 messages have been suppressed, use --verbose to show them.
packageinfo.nim(280) findNimbleFile
Error: Could not find a file with a .nimble extension inside the specified directory: /home/qmaster/tools
Do nimble file is a must now?
Well, you need to pass the search paths of your libraries to nimsuggest. nimble setup is one way to do that, another is to have a config.nims file
Well, you need to pass the search paths of your libraries to
nimsuggest.nimble setupis one way to do that, another is to have aconfig.nimsfile
@jmgomez It was working perfectly before, and definitely working (almost fine) in v1.8.1. Why do I need to pass search paths to langserver if they're default ones like ~/.nimble/pkgs2? The nim file path is also definitely passed to langserver as full path. What other paths do I need to supplement to langserver?
Anyways, why do langserver says that
Redefining UserAuth: line 10, column 3
in my example. Nim compiles that without any problems, saem's plugin also worked ok with that code.
Both without any nimble files and any setups.
Yes, you are right for a moment I thought you had a different issue where the paths wasnt being picked up.
The nimsuggest instance it picks is the one you have in your path. It just forwards the error nimsuggest chk provides. So likely the issue of Redefining UserAuth: line 10, column 3 is a nimsuggest one.
The checking project spinner is fixed in the sources. A patch is coming soon
There's also an issue with dead nimble instance. 1.8.1 seems suffer less from this problem.
Dont see how as latest nimble related change was introduced in 1.8.0. That said, in the next patch there is also a potential fix for it. If it doesnt fix it (as I cant repro it) it may be an issue with chronos that requires further research. You can test it out by yourself by using the latest binary or building from sources, if you do, it will be great if you can report the results back
@jmgomez thnx alot.
Can you plz point me to issues of the nimsuggest to copypaste there the issue with Redefining UserAuth: line 10, column 3?
Sure, its the same repo as nim itself: https://github.com/nim-lang/Nim/issues
Seems fixed right now.