microsoft / vscode-generator-code

Visual Studio Code extension generator
Other
1.3k stars 224 forks source link

Extension not being activated #413

Open YusufSuleman opened 1 year ago

YusufSuleman commented 1 year ago

Hello, I am making an extension, if I run it, the extension doesn't even get loaded. It doesn't say that the extension is even activated, in the debug console. I have the default code generated by making a new typescript extension, I am using Arch Linux which was updated a few days ago.

sonicwang1989 commented 1 year ago

@YusufSuleman modify activationEvents in package.json like this: "activationEvents": [ "*" ],

YusufSuleman commented 1 year ago

@sonicwang1989 Still not working, nothing changed

kexposito commented 1 year ago

@YusufSuleman, I had the same issue, just updated visual code and all it's working fine now 🎉

Kadajett commented 1 year ago

Same issue here. Gonna try to update?

mikesmullin commented 1 year ago

Yes I found under Help menu there was an option to restart to apply pending update. Then it worked. I wonder if the project triggered vscode to recognize it had some new dependency, or if its just been that long for me?

debemdeboas commented 1 year ago

I'm having the same issue. Tried with JS and TS, no dice. I'm using WSL2, if that makes any difference. The extension doesn't seem to be loaded at all.

kexposito commented 1 year ago

Try using this engine:

  "engines": {
    "vscode": "^1.78.0"
  }
debemdeboas commented 1 year ago

Try using this engine:

  "engines": {
    "vscode": "^1.78.0"
  }

This worked! Thank you! Any idea as to a more permanent fix?

kexposito commented 1 year ago

Try using this engine:

  "engines": {
    "vscode": "^1.78.0"
  }

This worked! Thank you! Any idea as to a more permanent fix?

I have no clue about that :/ I realize that the issue was that version. So I tried change on my addon in it and it worked. Really happy that these also help you

Aoko-Blue commented 1 year ago

@YusufSuleman modify activationEvents in package.json like this: "activationEvents": [ "*" ],

Thank you for your method. It does work, but I would like to know why doing so can solve the problem?

BestBugMaker commented 11 months ago

Try using this engine:

  "engines": {
    "vscode": "^1.78.0"
  }

Can u tell me how to add this config?

jtaavola commented 11 months ago

Try using this engine:

  "engines": {
    "vscode": "^1.78.0"
  }

Can u tell me how to add this config?

It's in the package.json. The generator will specify latest version of VSCode, so if you're not up to date the extension won't be activated. You can either chance engines.vscode to the VSCode version you are on, or update your VSCode.

Narayanbhat166 commented 8 months ago

Hey, the issue still seems to persist. However when i changed the engine to the above mentioned one ^1.78.0 it seems to work. Any idea why this is happening?

jtaavola commented 8 months ago

Hey, the issue still seems to persist. However when i changed the engine to the above mentioned one ^1.78.0 it seems to work. Any idea why this is happening?

engines.vscode indicates the version of vscode that your extension works on. The generator defaults to the latest version of vscode I believe.

https://docs.npmjs.com/cli/v10/configuring-npm/package-json#engines