Mine and another extension have merged, and for the now deprecated extension we're going through and making sure that users will be well informed about the merger. One thing I'd like to do to make things obvious, is to have a warning message come up on activation of the deprecated extension.
In the package.json
I've added
"activationEvents": [
"onLanguage:ada",
"onLanguage:adc",
"onLanguage:ali",
"onLanguage:gpr"
],
"main": "./out/extension.js",
And have an extension.ts
with the following:
import * as vscode from 'vscode';
export function activate(context: vscode.ExtensionContext) {
vscode.window.showWarningMessage('Hello World!');
}
export function deactivate() {}
But no warning message appears. I tried replacing this with a console logging statement, and sure enough, I got the logged message in the debugging host, so it's certainly running the activate()
function. So then I switched back to trying to show a warning, put some breakpoints down, and ran it. It skipped right over the warning message function. So then I put both the console log and warning message in the function, put break points for both, and ran it. It did the console log fine, then the break points "moved", skipped right over the warning message, and finished the function.
I don't know javascript/typescript very well at all, so this is completely bizarre behavior to me. I know hoisting can cause variables to actually be declared at different locations from where they are written but I know of know similar rules for function execution. Seems like no matter what I do it will not reach the warning message function, even though it should, from my perspective.