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

Unexpectedly Triggering rust-analyzer #243

Open
GreenYun opened this issue Jun 23, 2024 · 7 comments
Open

Unexpectedly Triggering rust-analyzer #243

GreenYun opened this issue Jun 23, 2024 · 7 comments

Comments

@GreenYun
Copy link

GreenYun commented Jun 23, 2024

When I open a C project using meson build system, and this extension activates my rust-analyzer extension by activationEvent: 'onTaskType:cargo', cause rust-analyzer to complain missing cargo.toml error.

@tristan957
Copy link
Contributor

Could you add your tasks.json file to the ticket?

@GreenYun
Copy link
Author

Could you add your tasks.json file to the ticket?

I do not add any tasks.json to my project or the environment.

Steps to reproduce: Make a new dir, put meson.build into it, also configure a C project with some random C source codes. At this point, rust-analyzer will not be activated because no Rust project detected. When manually or automatically (re)configure the project by the extension, it calls meson setup as well as the extension event rust-analyzer: 'onTaskType:cargo' that activates rust-analyzer.

@tristan957
Copy link
Contributor

If you don't have a tasks.json, I don't how this activation event could occur

@GreenYun
Copy link
Author

Here is some log from VS Code after I manually configure my meson project via the extension:

2024-06-26 14:53:34.754 [info] ExtensionService#_doActivateExtension vscode.grunt, startup: false, activationEvent: 'onTaskType:grunt'
2024-06-26 14:53:34.761 [info] ExtensionService#_doActivateExtension vscode.gulp, startup: false, activationEvent: 'onTaskType:gulp'
2024-06-26 14:53:34.765 [info] ExtensionService#_doActivateExtension vscode.jake, startup: false, activationEvent: 'onTaskType:jake'
2024-06-26 14:53:34.768 [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'onTaskType:typescript'
2024-06-26 14:53:34.823 [info] ExtensionService#_doActivateExtension DavidAnson.vscode-markdownlint, startup: false, activationEvent: 'onTaskType:markdownlint'
2024-06-26 14:53:34.872 [info] ExtensionService#_doActivateExtension rust-lang.rust-analyzer, startup: false, activationEvent: 'onTaskType:cargo'
2024-06-26 14:54:27.869 [info] ExtensionService#_doActivateExtension vscode.configuration-editing, startup: false, activationEvent: 'onLanguage:jsonc'
2024-06-26 14:54:27.888 [info] ExtensionService#_doActivateExtension vscode.json-language-features, startup: false, activationEvent: 'onLanguage:jsonc'

It seems that the extension tried everything and there was only rust-analyzer that I installed onto my VS Code, which was activated.

@tristan957
Copy link
Contributor

tristan957 commented Jun 26, 2024

This sounds very similar: microsoft/vscode#192043. What are your thoughts?

@GreenYun
Copy link
Author

That makes sense. However, working with CMake plugin on my machine does not have this annoying issue. How strange!

@tristan957
Copy link
Contributor

Yeah. Let's keep this open, but I'm pretty sure it isn't a problem with the extension because the only interaction we have with rust-analyzer is setting the path to the rust-projects.json file or whatever it is called.

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

No branches or pull requests

2 participants