Problems with tuple autocompletion
there are two problems with tuple if the code is splitted into 2 modules
# module.nim
type B* = tuple
a: int
b: int
var x*: B = (a: 2, b: 10)
var y* = (a: 2, b: 10)
# main.nim
import module
echo x.a # problem1: tuple field a and b does not show up in the lsp autocompletion list
echo y. # problem2: language server crashes when I type '.' after the letter 'y'
everything works fine if the code is not splited into 2 modules
# main.nim
# this works fine
type B* = tuple
a: int
b: int
var x*: B = (a: 2, b: 10)
var y* = (a: 2, b: 10)
echo x.a
echo y.b
# main.nim
# this also works fine
include module
echo x.a
echo y.b
nim version: 1.7.1 (devel) platform: Windows11 WSL2 (Void Linux) editor: neovim
I believe this is a nimsuggest issue (nimlsp is simply using that as a library). Could you try to run the same tests with nimsuggest manually?
I ran nimsuggest manually and it did the same thing
import module
echo x.
^ for this code nimsuggest does not suggest field a, b
import module
echo y.
^ for this code nimsuggest crashes with SIGSEGV: Illegal storage access.
Then you should raise this issue in the nimsuggest issue tracker. There is unfortunately nothing that can be done to fix this in NimLSP. But feel free to link this issue so tht it's easier to track.