intorust / intorust.vscode

A VSCode extension for learning Rust
Other
9 stars 2 forks source link

Extension doesn't seem to activate automatically #6

Open nikomatsakis opened 4 weeks ago

nikomatsakis commented 4 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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.

On Wed, Jun 12, 2024, at 2:23 AM, Doc Jones wrote:

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?

— Reply to this email directly, view it on GitHub https://github.com/intorust/intorust.vscode/issues/6#issuecomment-2162197132, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABF4ZRDUIELZHCAEA5ZTTDZG7SP7AVCNFSM6AAAAABJA256RCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRSGE4TOMJTGI. You are receiving this because you authored the thread.Message ID: @.***>

kwdev commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

Maybe I'm just impatient

On Wed, Jun 12, 2024, at 9:54 AM, Kari Wilhelm wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/intorust/intorust.vscode/issues/6#issuecomment-2163074051, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABF4ZT7TASUI7HKCKXH3EDZHBHLDAVCNFSM6AAAAABJA256RCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRTGA3TIMBVGE. You are receiving this because you authored the thread.Message ID: @.***>