提交 d689094a 编写于 作者: J Johannes Rieken

fix #43559

上级 789b345e
......@@ -155,16 +155,17 @@ export class ReferencesController implements editorCommon.IEditorContribution {
// show widget
return this._widget.setModel(this._model).then(() => {
// set title
this._widget.setMetaTitle(options.getMetaTitle(this._model));
// set 'best' selection
let uri = this._editor.getModel().uri;
let pos = new Position(range.startLineNumber, range.startColumn);
let selection = this._model.nearestReference(uri, pos);
if (selection) {
return this._widget.setSelection(selection);
if (this._widget) { // might have been closed
// set title
this._widget.setMetaTitle(options.getMetaTitle(this._model));
// set 'best' selection
let uri = this._editor.getModel().uri;
let pos = new Position(range.startLineNumber, range.startColumn);
let selection = this._model.nearestReference(uri, pos);
if (selection) {
return this._widget.setSelection(selection);
}
}
return undefined;
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册