Closed jmgomez closed 4 months ago
When opening testproject/submodule.nim
which is not imported by testproject.nim
the langserver gets all wrong. It sets as main project testproject.nim
which effectively left out of IDE support to the submodule.nim
file.
What it should instead is to create a nimsuggest
instance for submodule.nim
if it is not part of the testproject.nim
which isnt because it's not being imported. If it were imported, the behaviour would be correct.
In order to avoid spawning unnecessary
nimsuggest
processes we must improve the way the lang server handles files.For instance, when the user opens a file (i.e. navigates to a type) that is part of the
nimble
requires
the langserver should not spawn a newnimsuggest
process but to reuse the existing one. The discovery process should also take into account things like opening a file in an arbitrary package. So instead of using the current file as a program itself, it should try to find thenimble
project where it belongs (this may require changes innimble
). Changes in files should also be taking into consideration, for instance if thenimble
entry pointimport
moduleb
, the moduleb
nimsuggest
's process must be closed and use thenimble
one instead.In order to do the above, we must first document via tests what's currently supported.