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

Extension doesn't seem to activate automatically #6

Open
nikomatsakis opened this issue Jun 9, 2024 · 5 comments
Open

Extension doesn't seem to activate automatically #6

nikomatsakis opened this issue Jun 9, 2024 · 5 comments

Comments

@nikomatsakis
Copy link
Collaborator

nikomatsakis commented Jun 9, 2024

I'm not sure why but I seem to have to run "IntoRust: Enable codelens" from the command palette to get things to show up. I haven't tested whether e.g. using activationEvents: ["*"] instead of the current "active on rust" would help:

https://github.com/nikomatsakis/intorust.vscode/blob/ffff983688652133fe4a5fc80221fba683a6e6f5/package.json#L18-L20

...but it's worth a try. That might be a clue. If not that, well, I don't know, something!

@doc-jones
Copy link

I have a couple of questions on this.

  1. Based upon a couple of other example extensions I've seen the activationEvents value was simply [ ].
    So activationEvents: [ ] have you seen/tried this?
  2. In package.json main is specified as "./dist/extension.js".
    a. In the docs it is stated that "main" in package.json would be set to "./out/extension.js" for extensions in dev and "./dist/extension.js" for production. Is this extension in production? Does it matter?

@nikomatsakis
Copy link
Collaborator Author

nikomatsakis commented Jun 12, 2024 via email

@kwdev
Copy link
Collaborator

kwdev commented Jun 12, 2024

I wonder if it is a timing issue, I haven't had to run "IntoRust: Enable codelens". After opening the "Extension Development Host" window (is that what you're doing?), it seems to depend on how/when the CodeLensProvider.provideCodeLenses is triggered, when diagnostics are available, etc. Putting focus on the window usually triggers it, or editing the file.

@doc-jones
Copy link

I believe that [] would mean "never activate unless explicitly used". I think that ["*"] means "always active immediately". The former is too weak and the latter seems stronger than necessary. The current setting (activate when Rust code is used) seems right, but for some reason the codelens items don't show up. It might be something dumb like the default configuration being false.

Yes, I see the difference between [] and ["*"]. I'm still catching up on the extensions documentation.

@nikomatsakis
Copy link
Collaborator Author

nikomatsakis commented Jun 13, 2024 via email

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

3 participants