"activationEvents": [
"onLanguage:yml"
],
This activation event is emitted and interested extensions will be
activated whenever a file that resolves to a certain language gets
opened. [from onLanguage api]
So when you open a yml
file the extension is activated, not any particular command. The rest of your package.json
really has nothing to do with this onLanguage:yml
activation.
You can see this if you simply have this in your extension.js
:
async function activate(context) {
someFunction(); // this function will be run whenever you switch to a `yml` file.
// this will be run too, but it just registers the command, does not trigger it
// the command is triggered in other ways
vscode.commands.registerCommand('flutter-pub-version-checker.helloWorld'.....{} )
}
Your command flutter-pub-version-checker.helloWorld
is not activated by the language switch - it is activated through the command palette or a keybinding or a menu item selection.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…