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

Add "Open Cargo.toml" action #6462

Closed
matklad opened this issue Nov 4, 2020 · 7 comments · Fixed by #6519
Closed

Add "Open Cargo.toml" action #6462

matklad opened this issue Nov 4, 2020 · 7 comments · Fixed by #6519
Labels
A-vscode vscode plugin issues E-has-instructions Issue has some instructions and pointers to code to get started E-medium good first issue S-actionable Someone could pick this issue up and work on it right now

Comments

@matklad
Copy link
Member

matklad commented Nov 4, 2020

Invoking it should open Cargo.toml for the current file.

This should be implemented at the rust-analyzer layer (ie, not in the IDE layer).

This needs custom protocol extension.

See c9f8789#diff-4bec6bfceb4323ffd0d2ff1ad25070234f084f31ddd5577bbdb510de878a3811 for an example which adds custom extension

@matklad matklad added good first issue E-medium E-has-instructions Issue has some instructions and pointers to code to get started A-vscode vscode plugin issues S-actionable Someone could pick this issue up and work on it right now labels Nov 4, 2020
@p3achyjr
Copy link

p3achyjr commented Nov 5, 2020

I can take this up if no one else is working on it. This would open the Cargo.toml of the current crate, right?

@lnicola
Copy link
Member

lnicola commented Nov 6, 2020

Yes, but there might be some corner cases:

  • the project is not Cargo-based
  • the file is generated by a build script
  • the file is included in multiple crates

@matklad
Copy link
Member Author

matklad commented Nov 6, 2020

This would open the Cargo.toml of the current crate, right?

Right! i suggest looking at handle_runnables for the logic of discovering the current crate/package

@p3achyjr
Copy link

p3achyjr commented Nov 7, 2020

Thanks @matklad, @lnicola. This might not be the right place to ask this, but how can I actually go about testing this? It seems like this would involves changes to both client + server, and looking at ./docs/dev.md, it just says that there is no specific workflow for this case.

@matklad
Copy link
Member Author

matklad commented Nov 7, 2020

We just don't such features -- there's relatively few bugs on the interesection between client and server, and conventinal testing is not too efficient here.

@p3achyjr
Copy link

p3achyjr commented Nov 7, 2020

ah, got it 👍. What about manually verifying it works? Like installing a dev build and running that in vscode?

@lnicola
Copy link
Member

lnicola commented Nov 9, 2020

@p3achyjr you can uninstall the store extension, run cargo xtask install in a clone of the repository, and maybe update rust-analyzer.serverPath to point to the executable in ~/cargo/bin or %HOME%\.cargo\bin (it might not be in PATH).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-vscode vscode plugin issues E-has-instructions Issue has some instructions and pointers to code to get started E-medium good first issue S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants