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

LSP: Can't "command + click" (go to definition) to noir stdlib files #7469

Open
iAmMichaelConnor opened this issue Feb 20, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@iAmMichaelConnor
Copy link
Collaborator

iAmMichaelConnor commented Feb 20, 2025

Feature request:

If I create a Noir project, I can command+click to go to definitions within my project, but if I use a function or struct from the stdlib, I can't command+click into it.

E.g. It'd be nice to be able to jump to std::embedded_curve_ops::EmbeddedCurvePoint and look around that code, without having to manually search for it.

@iAmMichaelConnor iAmMichaelConnor added the enhancement New feature or request label Feb 20, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Feb 20, 2025
@asterite
Copy link
Collaborator

Duplicate of #3721

The main issue to do this is that the standard library is located in the nargo binary itself (the standard library is read at compile-time and stored inside the binary as if it were a filesystem). I don't know why it was done like that but it prevents us from jumping into a source code file... because there's no such file.

I think Rust stores the standard library source code somewhere when you install it. It would be nice if Noir did the same, because then you'd be able to jump there.

I also considered somehow implementing this with LSP virutal files... except that there's no such thing in LSP, it's a VSCode-only thing and it's kind of hard to implement.

@TomAFrench TomAFrench marked this as a duplicate of #3721 Feb 21, 2025
@TomAFrench
Copy link
Member

TomAFrench commented Feb 21, 2025

We bundle the stdlib files as our installation tool is a bash script so we can't ensure integrity of these.

@iAmMichaelConnor
Copy link
Collaborator Author

iAmMichaelConnor commented Feb 21, 2025

Thanks for the detailed replies!

I think Rust stores the standard library source code somewhere when you install it. It would be nice if Noir did the same, because then you'd be able to jump there.

This would be great. If I use any other external dependency in my noir project, that dependency gets stored somewhere on my machine (somewhere in ~/.nargo/ or something?) and I can "go to definition", so my naive brain would expect the same to be doable with the stdlib? After all; isn't it technically just an external dependency?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 📋 Backlog
Development

No branches or pull requests

3 participants