mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
gracefully handle the case in which a delegate command has been disposed before execution, fixes #3265
This commit is contained in:
@@ -87,7 +87,7 @@ class CodeLensAdapter implements modes.ICodeLensSupport {
|
||||
data.symbols.push(<modes.ICodeLensSymbol>{
|
||||
id: String(i),
|
||||
range: TypeConverters.fromRange(lens.range),
|
||||
command: TypeConverters.Command.from(lens.command, { commands: this._commands, disposables: data.disposables })
|
||||
command: TypeConverters.Command.from(lens.command, data.disposables)
|
||||
});
|
||||
});
|
||||
|
||||
@@ -144,7 +144,7 @@ class CodeLensAdapter implements modes.ICodeLensSupport {
|
||||
};
|
||||
}
|
||||
|
||||
symbol.command = TypeConverters.Command.from(command, { commands: this._commands, disposables: cachedData.disposables });
|
||||
symbol.command = TypeConverters.Command.from(command, cachedData.disposables);
|
||||
return symbol;
|
||||
});
|
||||
});
|
||||
@@ -315,7 +315,6 @@ class QuickFixAdapter implements modes.IQuickFixSupport {
|
||||
});
|
||||
|
||||
this._cachedCommands = dispose(this._cachedCommands);
|
||||
const ctx = { commands: this._commands, disposables: this._cachedCommands };
|
||||
|
||||
return asWinJsPromise(token => this._provider.provideCodeActions(doc, ran, { diagnostics: allDiagnostics }, token)).then(commands => {
|
||||
if (!Array.isArray(commands)) {
|
||||
@@ -323,7 +322,7 @@ class QuickFixAdapter implements modes.IQuickFixSupport {
|
||||
}
|
||||
return commands.map((command, i) => {
|
||||
return <modes.IQuickFix> {
|
||||
command: TypeConverters.Command.from(command, ctx),
|
||||
command: TypeConverters.Command.from(command, this._cachedCommands),
|
||||
score: i
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user