ymotongpoo / vsc-licenser

License handler extension for Visual Studio Code.
Apache License 2.0
45 stars 40 forks source link

Auto header insertion not working at startup because extension is not activated until licenser command issued manually #98

Closed mdurling closed 3 years ago

mdurling commented 3 years ago

Please make sure to use this template to report issue. Any issue report that does not follow this template will be ignored.

Runtime environment

Expected behavior

Extension should be active and insert headers automatically following startup.

Actual behavior

A licenser command must be executed manually before auto insertion is enabled.

Steps to reproduce the issue

  1. Launch VS Code
  2. Create a new file (header is not inserted)
  3. Manually run "licenser: Insert license header"
  4. Create another new file (header is inserted automatically)

VS Code supports an onStartupFinished activation event which could perhaps be used:

"activationEvents": [
    "onStartupFinished"
]
tevosouza commented 3 years ago

Hi @drtyh2o, How are u? I think that this problem occurs because the activate method is not implemented yet, I'll take a look when I have some time.

mdurling commented 3 years ago

I think that this problem occurs because the activate method is not implemented yet, I'll take a look when I have some time.

I took a peek at the code and there is an activate method (I think one is required). I modified the activationEvents in the package.json of my local installation as above and the extension activates during startup and automatic header insertion works. Thanks for looking into this. Cool extension!