Skip to content

Commit fee31b4

Browse files
committed
Fix a bug
1 parent 0ffea10 commit fee31b4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Extension/src/LanguageServer/protocolFilter.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ export function createProtocolFilter(): Middleware {
3434
const mappingString: string = baseFileName + "@" + document.fileName;
3535
client.addFileAssociations(mappingString, "cpp");
3636
client.sendDidChangeSettings();
37-
// Changes to the languageId in the editor take precendence over setTextDocumentLanguage.
38-
// So, this may or may not cause the file to be closed and reopened.
37+
// This will definitely cause the file to be closed and reopened.
38+
// setTextDocumentLanguage takes precedence over setting the languageId in UI.
3939
void vscode.languages.setTextDocumentLanguage(document, "cpp");
40+
return;
4041
}
4142
// client.takeOwnership() will call client.TrackedDocuments.add() again, but that's ok. It's a Set.
4243
client.takeOwnership(document);

0 commit comments

Comments
 (0)