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

ENOENT: no such file or directory, open '<project>/source' Code: -32603 #134

Open
gaetschwartz opened this issue Jun 5, 2023 · 8 comments

Comments

@gaetschwartz
Copy link
Contributor

While editing a file (ci\build.nu), I get the following error:

[Error - 1:09:34 PM] Request textDocument/definition failed.
  Message: Request textDocument/definition failed with message: ENOENT: no such file or directory, open '<my_project>\source'
  Code: -32603 

it seems to be looking for a source folder in the root of my directory. Am I missing something here ?

@fdncred
Copy link
Collaborator

fdncred commented Jun 5, 2023

seems odd to me. i've seen those errors from time to time. i'm not sure what is causing them. i've also seen the same errors with rust_analyzer. i wonder if there's some bug in vscode or if this bug is in this extension?

@gaetschwartz
Copy link
Contributor Author

Hum, interesting, I'm on windows, maybe something rust or a crate nushell depends on gets messed up because of windows path ?

@fdncred
Copy link
Collaborator

fdncred commented Jun 5, 2023

Hum, interesting, I'm on windows, maybe something rust or a crate nushell depends on gets messed up because of windows path ?

Hmmm, good point. With nushell, if windows paths are enclosed in double quotes, it thinks it's an escape. e.g. c:\some\path wouldn't work but c:/some/path and c:\\some\\path would. Maybe we have single quotes on the windows side somewhere in the extension? or maybe it's in a variable that we can't see and needs to be double escaped for windows?

@gaetschwartz
Copy link
Contributor Author

I aam experiencing it now on MacOS as well, so I don think it is due to Windows. Any clues on why this could happen ?

@fdncred
Copy link
Collaborator

fdncred commented Jun 29, 2023

I've seen them on MacOS too. Probably more on MacOS than anywhere else. I haven't been able (or willing?) to narrow in on what's causing it. I sometimes just ignore them because rust-analyzer prints a bunch of these for me too.

It would be nice to have a repeatable use case to test against on mac, linux, and windows.

@gaetschwartz
Copy link
Contributor Author

gaetschwartz commented Jul 10, 2023

It looks like for some reason nu returns {"end" : 0, "file" : "source", "start" : 0} in some occasions. It seems to be sometimes happening when the extension queries many times at once, not sure why though ? Are you familiar with the nu part of it ? I'm really not yet @fdncred .

Edit: seems like the "source" might come from
https://github.com/nushell/nushell/blob/a3702e1eb713c45ec5d38e13a9d02969ac7cdce6/crates/nu-parser/src/parser.rs#L6069-L6083

image
image

gaetschwartz added a commit to gaetschwartz/vscode-nushell-lang that referenced this issue Jul 10, 2023
@fdncred
Copy link
Collaborator

fdncred commented Jul 10, 2023

wow, nice research! I have no idea why that's happening. I'll see if I can get JT to take a look.

@sophiajt
Copy link
Contributor

@fdncred - looking at it, it looks like a Span(0, 0) is slipping in somewhere. Look at the stdout in the second picture, it says {"start": 0, "file": "source", "end": 0}. That's a sentinel value no one should ever see, so I suspect this is tripping over an order of operations that's dropping the span info.

fdncred added a commit that referenced this issue Jul 25, 2023
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
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