Fix an undefined access when an edit is done before cpptools starts (#13206)
* Fix an undefined access.
This commit is contained in:
Родитель
3614cab5ac
Коммит
77f30faf00
|
@ -1842,7 +1842,8 @@ export class DefaultClient implements Client {
|
|||
public onDidChangeTextDocument(textDocumentChangeEvent: vscode.TextDocumentChangeEvent): void {
|
||||
if (util.isCpp(textDocumentChangeEvent.document)) {
|
||||
// If any file has changed, we need to abort the current rename operation
|
||||
if (workspaceReferences.renamePending) {
|
||||
if (workspaceReferences !== undefined // Occurs when a document changes before cpptools starts.
|
||||
&& workspaceReferences.renamePending) {
|
||||
workspaceReferences.cancelCurrentReferenceRequest(refs.CancellationSender.User);
|
||||
}
|
||||
|
||||
|
|
|
@ -298,7 +298,7 @@ async function onDidChangeSettings(event: vscode.ConfigurationChangeEvent): Prom
|
|||
}
|
||||
}
|
||||
|
||||
async function onDidChangeTextDocument(event: vscode.TextDocumentChangeEvent): Promise<void> {
|
||||
function onDidChangeTextDocument(event: vscode.TextDocumentChangeEvent): void {
|
||||
const me: Client = clients.getClientFor(event.document.uri);
|
||||
me.onDidChangeTextDocument(event);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче