Skip to content
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

Language Server on VSC does not refresh autocompletions correctly between files when opening and working on multiple at the same time #21

Open
Yu-Vitaqua-fer-Chronos opened this issue Oct 24, 2022 · 2 comments

Comments

@Yu-Vitaqua-fer-Chronos
Copy link

Information

I'm using Nim with the commit hash 684a862526847c39597e345d00b8323353012c07 from the develop branch and i've compiled the language server so i could use it with the Nimsaem extension. My exact Nim compiler info is here:

Nim Compiler Version 1.7.3 [Linux: amd64]
Compiled at 2022-10-24
Copyright (c) 2006-2022 by Andreas Rumpf

git hash: 684a862526847c39597e345d00b8323353012c07
active boot switches: -d:release

I compiled nimble install --legacy:laxEffects --define:release the lang server with this command. nimble install --legacy:laxEffects --define:release

This is my .vscode/settings.json file for the project:

{
    "nim.projectMapping": {
        "projectPath": "main.nim",
        "fileRegex": ".*\\.nim"
    }
}

To Reproduce My Bug

To reproduce my error, use the develop branch of Nim, the latest commit of this repo, and run that command. Then in visual studio code, create two files, with one using a type/method from another. For the imported file, add

# b.nim
type HelloWorld* = object
  msh*: string

then import it in the other file and use it as such:

# a.nim
import b

var helloWorld = HelloWorld()
helloWorld.msh = "Wow"

At this stage, you should get no errors. To reproduce my issue, rename msh in the HelloWorld type definition to msg, and in a.nim, change helloWorld.msh to helloWorld.msg. You will then get an error complaining about how it doesn't exist. A 'fix' for this is to edit b.nim by adding a character and deleting it, which refreshes the project, but editing a.nim will cause the error to reappear.

@yyoncho
Copy link
Collaborator

yyoncho commented Oct 24, 2022

I will take a look. Meanwhile using Source actions -> Clean rebuild should fix that issue.

@Yu-Vitaqua-fer-Chronos
Copy link
Author

Ah thank you for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants