mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-06-13 07:10:26 +08:00
don't leak...
This commit is contained in:
@ -12,7 +12,8 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
// * registers for text files (`'plaintext'`), and
|
||||
// * return the 'Hello World' and
|
||||
// a snippet-based completion item.
|
||||
vscode.languages.registerCompletionItemProvider('plaintext', {
|
||||
let registration = vscode.languages.registerCompletionItemProvider('plaintext', {
|
||||
|
||||
provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken, context: vscode.CompletionContext) {
|
||||
return [
|
||||
new vscode.CompletionItem('Hello World!'),
|
||||
@ -21,6 +22,8 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
}
|
||||
});
|
||||
|
||||
context.subscriptions.push(registration);
|
||||
|
||||
function createSnippetItem(): vscode.CompletionItem {
|
||||
|
||||
// Read more here:
|
||||
|
||||
Reference in New Issue
Block a user