mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Use vscode.Disposable.from for better consistency
Co-authored-by: pierceboggan <1091304+pierceboggan@users.noreply.github.com>
This commit is contained in:
@ -170,11 +170,13 @@ export function activate(_context: vscode.ExtensionContext) {
|
||||
providerDisposable = vscode.languages.registerInlineCompletionItemProvider({ pattern: '**' }, patternBasedProvider);
|
||||
|
||||
// Add a disposable that will clean up the current provider when the extension is deactivated
|
||||
_context.subscriptions.push({
|
||||
dispose: () => {
|
||||
if (providerDisposable) {
|
||||
providerDisposable.dispose();
|
||||
_context.subscriptions.push(
|
||||
vscode.Disposable.from({
|
||||
dispose: () => {
|
||||
if (providerDisposable) {
|
||||
providerDisposable.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user