mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-06-13 07:10:26 +08:00
To keep things simple, this doesn't use the nls-dev package. I think this demystifies a lot of things when you see what is actually going on behind the scenes.
28 lines
958 B
TypeScript
28 lines
958 B
TypeScript
/* --------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
* ------------------------------------------------------------------------------------------ */
|
|
|
|
import * as nls from 'vscode-nls';
|
|
const localize = nls.config(process.env.VSCODE_NLS_CONFIG)();
|
|
|
|
import * as vscode from 'vscode';
|
|
import { sayByeCommand } from './command/sayBye';
|
|
|
|
export function activate(context: vscode.ExtensionContext) {
|
|
const helloCmd = vscode.commands.registerCommand('extension.sayHello', () => {
|
|
const message = localize('sayHello.text', 'Hello')
|
|
vscode.window.showInformationMessage(message);
|
|
});
|
|
|
|
const byeCmd = vscode.commands.registerCommand(
|
|
'extension.sayBye',
|
|
sayByeCommand
|
|
);
|
|
|
|
context.subscriptions.push(helloCmd, byeCmd);
|
|
}
|
|
|
|
export function deactivate() {
|
|
}
|