Skip to content

Commit 1d79e27

Browse files
committed
Fix lint issue
1 parent 2b9137f commit 1d79e27

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Extension/src/LanguageServer/protocolFilter.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import * as path from 'path';
88
import * as vscode from 'vscode';
99
import { Middleware } from 'vscode-languageclient';
1010
import * as util from '../common';
11+
import { logAndReturn } from '../Utility/Async/returns';
1112
import { Client } from './client';
1213
import { clients } from './extension';
1314
import { shouldChangeFromCToCpp } from './utils';
@@ -36,20 +37,20 @@ export function createProtocolFilter(): Middleware {
3637
client.addFileAssociations(mappingString, "cpp");
3738
client.sendDidChangeSettings();
3839
// This will cause the file to be closed and reopened.
39-
vscode.languages.setTextDocumentLanguage(document, "cpp");
40+
void vscode.languages.setTextDocumentLanguage(document, "cpp");
4041
return;
4142
}
4243
// client.takeOwnership() will call client.TrackedDocuments.add() again, but that's ok. It's a Set.
4344
client.onDidOpenTextDocument(document);
4445
client.takeOwnership(document);
45-
sendMessage(document).then(() => {
46+
void sendMessage(document).then(() => {
4647
// For a file already open when we activate, sometimes we don't get any notifications about visible
4748
// or active text editors, visible ranges, or text selection. As a workaround, we trigger
4849
// onDidChangeVisibleTextEditors here, only for the first file opened.
4950
if (!anyFileOpened) {
5051
anyFileOpened = true;
5152
const cppEditors: vscode.TextEditor[] = vscode.window.visibleTextEditors.filter(e => util.isCpp(e.document));
52-
client.onDidChangeVisibleTextEditors(cppEditors);
53+
client.onDidChangeVisibleTextEditors(cppEditors).catch(logAndReturn.undefined);
5354
}
5455
});
5556
}
@@ -68,8 +69,8 @@ export function createProtocolFilter(): Middleware {
6869
if (me.TrackedDocuments.has(uriString)) {
6970
me.onDidCloseTextDocument(document);
7071
me.TrackedDocuments.delete(uriString);
71-
sendMessage(document);
72+
void sendMessage(document);
7273
}
73-
},
74+
}
7475
};
7576
}

0 commit comments

Comments
 (0)