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

VSCode workspace not being parsed correctly for Nim suggest #106

Closed
pr-yemibedu opened this issue Nov 7, 2018 · 4 comments
Closed

VSCode workspace not being parsed correctly for Nim suggest #106

pr-yemibedu opened this issue Nov 7, 2018 · 4 comments

Comments

@pr-yemibedu
Copy link

Hello,
Looking at line NimUtil Line 51 I see that the toLocalFile function is suppose to do a merge of workspace and filepath. This is causing an error that the project root folder name is being counted twice. NimSuggest is failing because of this.

With base folder add being put in a workspace this is what happens:

  • Expected result : e:\projects\nim\add\src\add.nim
  • Given result : e:\projects\nim\add\add\src\add.nim

The exact error message: "console.ts:136 [Extension Host] Nimsuggest returns unknown port number: cannot find file: e:\projects\nim\add\add\src\add.nim"

There should be another check inside that if the final path is not valid to return something else or report an error. Thank you. Good day.

@kosz78
Copy link
Collaborator

kosz78 commented Nov 12, 2018

@pr-yemibedu I cant reproduce this behavior, could You please provide example project?

@pr-yemibedu
Copy link
Author

Hello,
I have put together my problem project that shows my issue (C zip) and a new one without the issue (N zip). They have a workspace over a lib and a bin. opening just the lib in VSCode will provide type information after a few seconds.

The workspace of C never gets passed the Indexing: # state. Not sure what the cause would be as the only difference is an additional ".workspace" file at the root. Thank you. Good day.

@coffeepots
Copy link

I have this issue too, as soon as I went from just opening a single folder to using a workspace with multiple folders.

This is causing an error that the project root folder name is being counted twice.

Or put another way, it seems that it's taking the first project directory in the workspace and prepending it to all of them.

For example, say I have two project directories (projA and projB) in the same workspace.
Correct paths:
c:\repos\projA\file.nim
c:\repos\projB\file.nim

For the first project I get: cannot find file: c:\repos\projA\projA\file.nim
For the second project I get: cannot find file: c:\repos\projA\projB\file.nim

Unfortunately this means nimsuggest doesn't work with workspaces.

kosz78 added a commit that referenced this issue Dec 1, 2018
@kosz78
Copy link
Collaborator

kosz78 commented Dec 1, 2018

Fixed in 805d3f1

@kosz78 kosz78 closed this as completed Dec 1, 2018
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

3 participants