提交 c9051438 编写于 作者: M Matt Bierner

Fix case where opening tsserver log before loading any ts file may cause undefined access

上级 45e6e908
......@@ -706,13 +706,19 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient
return workspace.openTextDocument(this.tsServerLogFile)
.then(doc => {
if (!doc) {
return false;
}
return window.showTextDocument(doc, window.activeTextEditor ? window.activeTextEditor.viewColumn : undefined)
.then(editor => !!editor);
}, () => {
window.showWarningMessage(localize(
'openTsServerLog.openFileFailedFailed',
'Could not open TS Server log file'));
return null;
}, () => false)
.then(didOpen => {
if (!didOpen) {
window.showWarningMessage(localize(
'openTsServerLog.openFileFailedFailed',
'Could not open TS Server log file'));
}
return didOpen;
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册