-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Activate on top level Cargo.toml
and rust-project.json
files
#16550
Merged
bors
merged 1 commit into
rust-lang:master
from
DavisVaughan:feature/activate-on-top-level-cargo-toml
Feb 13, 2024
Merged
Activate on top level Cargo.toml
and rust-project.json
files
#16550
bors
merged 1 commit into
rust-lang:master
from
DavisVaughan:feature/activate-on-top-level-cargo-toml
Feb 13, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Veykril
approved these changes
Feb 13, 2024
I definitely observed this behavior before as well, thanks for double checking! |
☀️ Test successful - checks-actions |
This was referenced May 9, 2024
This was referenced May 28, 2024
This was referenced Jun 11, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I believe there is an issue with how rust-analyzer is activated from within a VS Code project.
IIUC, the intent is that when you open a rust project with a top level
Cargo.toml
, then rust-analyzer should just start right up due to a VS Code activation event. This is not currently the case. i.e. run something likecargo new ~/Desktop/hithere
, then open that folder in VS Code:Screen.Recording.2024-02-13.at.10.02.21.AM.mov
It is not until you actually open a Rust file that the extension starts up.
It looks like this was introduced in #10442. I do agree that recursive searching with
**/
is likely overkill, but I'm not sure*/Cargo.toml
is working as expected in this comment (#10442 (comment)):That does not seem to be the case for me. I even went into VS Code itself and added some fake tests for
glob.match()
(which is eventually what gets used for this) and*/Cargo.toml
doesn't seem to match a top levelCargo.toml
(and I think that makes sense).Lastly, the VS Code search filtering uses the same glob patterns, and it also doesn't match with
*/Cargo.toml
:Screen.Recording.2024-02-12.at.6.10.45.PM.mov
If you want both top level
Cargo.toml
s and 1-level-deepCargo.toml
s to be detected by VS Code's activation events, then I think we need to lay both of those conditions out explicitly, which I've done in this PR. That does fix the problem for me.Screen.Recording.2024-02-13.at.10.10.44.AM.mov