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 minimal support for cargo scripts #15456

Closed
wants to merge 1 commit into from

Conversation

HKalbasi
Copy link
Member

This PR runs cargo metadata -Zscript --manifest-path=file.rs on files opened as detached file, and then r-a will magically detect dependencies.

It doesn't touch anything in the salsa area. So, detached files need to be opened in a separate window and they are as bad as they were (no progress on #14318), and on each save operation (it needs to be on disk for cargo metadata to work) it reads the file, checks if the //! cargo.toml part of the script is changed, and if so it will reload the workspace and run cargo metadata again. I think this part works good enough, but not detecting the cargo scripts inside normal projects is definitely not good.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 13, 2023
@bors
Copy link
Collaborator

bors commented Sep 8, 2023

☔ The latest upstream changes (presumably #15574) made this pull request unmergeable. Please resolve the merge conflicts.

@HKalbasi HKalbasi added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 20, 2023
@Veykril Veykril marked this pull request as draft February 8, 2024 09:43
@Veykril Veykril added the S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work. label Feb 12, 2024
@Veykril
Copy link
Member

Veykril commented Apr 19, 2024

Updated the implementation building on this in a new PR #17110

@Veykril Veykril closed this Apr 19, 2024
bors added a commit that referenced this pull request Apr 19, 2024
Cargo script mvp

Based on #15456,

As the original PR stated, detached files are still horrendous to work with.
lnicola pushed a commit to lnicola/rust that referenced this pull request Apr 20, 2024
Cargo script mvp

Based on rust-lang/rust-analyzer#15456,

As the original PR stated, detached files are still horrendous to work with.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants