提交 b6fdf094 编写于 作者: M Martin Aeschlimann

foxes #4648: [codelens] Uncaught TypeError: Cannot read property 'symbol' of undefined

上级 a0ead9a7
......@@ -279,8 +279,18 @@ class CodeLens {
});
}
public updateCodeLensSymbols(data: ICodeLensData[]): void {
public updateCodeLensSymbols(data: ICodeLensData[], helper: CodeLensHelper): void {
while (this._decorationIds.length) {
helper.removeDecoration(this._decorationIds.pop());
}
this._data = data;
this._decorationIds = new Array<string>(this._data.length);
this._data.forEach((codeLensData, i) => {
helper.addDecoration({
range: codeLensData.symbol.range,
options: {}
}, id => this._decorationIds[i] = id);
});
}
public computeIfNecessary(currentModelsVersionId: number, model: editorCommon.IModel): ICodeLensData[] {
......@@ -556,7 +566,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution {
this._lenses[codeLensIndex].dispose(helper, accessor);
this._lenses.splice(codeLensIndex, 1);
} else if (codeLensLineNumber === symbolsLineNumber) {
this._lenses[codeLensIndex].updateCodeLensSymbols(groups[groupsIndex]);
this._lenses[codeLensIndex].updateCodeLensSymbols(groups[groupsIndex], helper);
groupsIndex++;
codeLensIndex++;
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册