// The module 'vscode' contains the VS Code extensibility API // Import the module and reference it with the alias vscode in your code below import { window, commands, Disposable, ExtensionContext, StatusBarAlignment, StatusBarItem, TextDocument } from'vscode';
// This method is called when your extension is activated. Activation is // controlled by the activation events defined in package.json. exportfunctionactivate(context: ExtensionContext) {
// Use the console to output diagnostic information (console.log) and errors (console.error). // This line of code will only be executed once when your extension is activated. console.log('Congratulations, your extension "WordCount" is now active!');
// create a new word counter let wordCounter = newWordCounter();
// sayHello 를 sayHi 함수로 변경 let disposable = commands.registerCommand('extension.sayHi', () => { wordCounter.updateWordCount(); });
// Add to a list of disposables which are disposed when this extension is deactivated. context.subscriptions.push(wordCounter); context.subscriptions.push(disposable); }