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

Unable to resolve path for rust-analyzer, but ok for rust ! #17790

Closed
Alphapage opened this issue Aug 4, 2024 · 2 comments
Closed

Unable to resolve path for rust-analyzer, but ok for rust ! #17790

Alphapage opened this issue Aug 4, 2024 · 2 comments
Labels
C-bug Category: bug

Comments

@Alphapage
Copy link

Alphapage commented Aug 4, 2024

Hello,
I'm trying to run .nrs file which is "nano" rust: a kind of subset of rust with limited syntax.

#[path = "./nanors/nano.nrs"]
mod nano;

The problem is that rust-analyzer failed to discover the file path probably because of the file extension and I get unresolved module, can't find module file error, but it is running perfectly if I compile into rust.
If I replace the extension with .rs, I get intellisense in vscode.

Why doesn't rust-analyzer follow rust compiler ? It must accept any filepath extension like rust and parse the file as usual.
I use the last rust-analyzer version in vscode and the last rust version.

Thank you in advance for your answers.

@Alphapage Alphapage added the C-bug Category: bug label Aug 4, 2024
@davidbarsky
Copy link
Contributor

It's a an easy solution to only accept perform IDE functionality on .rs files; we'd prefer not opportunistically parse the code as Rust.

@Veykril
Copy link
Member

Veykril commented Aug 4, 2024

For context, this is a shortcoming of our VFS which only loads up .rs and .toml files right now

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

No branches or pull requests

3 participants