diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 9aff90b09a..9d3ff74672 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -405,7 +405,10 @@ const GetDocumentSymbolRequest: RequestType = new RequestType('cpptools/getWorkspaceSymbols'); const GetFoldingRangesRequest: RequestType = new RequestType('cpptools/getFoldingRanges'); const GetSemanticTokensRequest: RequestType = new RequestType('cpptools/getSemanticTokens'); -const DocumentFormatRequest: RequestType = new RequestType('cpptools/format'); +const FormatDocumentRequest: RequestType = new RequestType('cpptools/formatDocument'); +const FormatRangeRequest: RequestType = new RequestType('cpptools/formatRange'); +const FormatOnTypeRequest: RequestType = new RequestType('cpptools/formatOnType'); + // Notifications to the server const DidOpenNotification: NotificationType = new NotificationType('textDocument/didOpen'); const FileCreatedNotification: NotificationType = new NotificationType('cpptools/fileCreated'); @@ -702,7 +705,7 @@ class DocumentFormattingEditProvider implements vscode.DocumentFormattingEditPro } } }; - return this.client.languageClient.sendRequest(DocumentFormatRequest, params) + return this.client.languageClient.sendRequest(FormatDocumentRequest, params) .then((textEdits) => { const result: vscode.TextEdit[] = []; textEdits.forEach((textEdit) => { @@ -759,7 +762,7 @@ class DocumentRangeFormattingEditProvider implements vscode.DocumentRangeFormatt } } }; - return this.client.languageClient.sendRequest(DocumentFormatRequest, params) + return this.client.languageClient.sendRequest(FormatRangeRequest, params) .then((textEdits) => { const result: vscode.TextEdit[] = []; textEdits.forEach((textEdit) => { @@ -816,7 +819,7 @@ class OnTypeFormattingEditProvider implements vscode.OnTypeFormattingEditProvide } } }; - return this.client.languageClient.sendRequest(DocumentFormatRequest, params) + return this.client.languageClient.sendRequest(FormatOnTypeRequest, params) .then((textEdits) => { const result: vscode.TextEdit[] = []; textEdits.forEach((textEdit) => {