@@ -338,6 +338,10 @@ export interface LocalizeDocumentSymbol {
338
338
children : LocalizeDocumentSymbol [ ] ;
339
339
}
340
340
341
+ export interface GetDocumentSymbolResult {
342
+ symbols : LocalizeDocumentSymbol [ ] ;
343
+ }
344
+
341
345
export interface LocalizeSymbolInformation {
342
346
name : string ;
343
347
kind : vscode . SymbolKind ;
@@ -369,6 +373,10 @@ export interface FormatParams {
369
373
onChanges : boolean ;
370
374
}
371
375
376
+ export interface FormatResult {
377
+ edits : TextEdit [ ] ;
378
+ }
379
+
372
380
export interface GetFoldingRangesParams {
373
381
uri : string ;
374
382
}
@@ -386,7 +394,6 @@ export interface CppFoldingRange {
386
394
}
387
395
388
396
export interface GetFoldingRangesResult {
389
- canceled : boolean ;
390
397
ranges : CppFoldingRange [ ] ;
391
398
}
392
399
@@ -404,7 +411,6 @@ interface SemanticToken {
404
411
405
412
export interface GetSemanticTokensResult {
406
413
fileVersion : number ;
407
- canceled : boolean ;
408
414
tokens : SemanticToken [ ] ;
409
415
}
410
416
@@ -532,16 +538,17 @@ const QueryCompilerDefaultsRequest: RequestType<QueryDefaultCompilerParams, conf
532
538
const QueryTranslationUnitSourceRequest : RequestType < QueryTranslationUnitSourceParams , QueryTranslationUnitSourceResult , void > = new RequestType < QueryTranslationUnitSourceParams , QueryTranslationUnitSourceResult , void > ( 'cpptools/queryTranslationUnitSource' ) ;
533
539
const SwitchHeaderSourceRequest : RequestType < SwitchHeaderSourceParams , string , void > = new RequestType < SwitchHeaderSourceParams , string , void > ( 'cpptools/didSwitchHeaderSource' ) ;
534
540
const GetDiagnosticsRequest : RequestType < void , GetDiagnosticsResult , void > = new RequestType < void , GetDiagnosticsResult , void > ( 'cpptools/getDiagnostics' ) ;
535
- export const GetDocumentSymbolRequest : RequestType < GetDocumentSymbolRequestParams , LocalizeDocumentSymbol [ ] , void > = new RequestType < GetDocumentSymbolRequestParams , LocalizeDocumentSymbol [ ] , void > ( 'cpptools/getDocumentSymbols' ) ;
541
+ export const GetDocumentSymbolRequest : RequestType < GetDocumentSymbolRequestParams , GetDocumentSymbolResult , void > = new RequestType < GetDocumentSymbolRequestParams , GetDocumentSymbolResult , void > ( 'cpptools/getDocumentSymbols' ) ;
536
542
export const GetSymbolInfoRequest : RequestType < WorkspaceSymbolParams , LocalizeSymbolInformation [ ] , void > = new RequestType < WorkspaceSymbolParams , LocalizeSymbolInformation [ ] , void > ( 'cpptools/getWorkspaceSymbols' ) ;
537
543
export const GetFoldingRangesRequest : RequestType < GetFoldingRangesParams , GetFoldingRangesResult , void > = new RequestType < GetFoldingRangesParams , GetFoldingRangesResult , void > ( 'cpptools/getFoldingRanges' ) ;
538
544
export const GetSemanticTokensRequest : RequestType < GetSemanticTokensParams , GetSemanticTokensResult , void > = new RequestType < GetSemanticTokensParams , GetSemanticTokensResult , void > ( 'cpptools/getSemanticTokens' ) ;
539
- export const FormatDocumentRequest : RequestType < FormatParams , TextEdit [ ] , void > = new RequestType < FormatParams , TextEdit [ ] , void > ( 'cpptools/formatDocument' ) ;
540
- export const FormatRangeRequest : RequestType < FormatParams , TextEdit [ ] , void > = new RequestType < FormatParams , TextEdit [ ] , void > ( 'cpptools/formatRange' ) ;
541
- export const FormatOnTypeRequest : RequestType < FormatParams , TextEdit [ ] , void > = new RequestType < FormatParams , TextEdit [ ] , void > ( 'cpptools/formatOnType' ) ;
545
+ export const FormatDocumentRequest : RequestType < FormatParams , FormatResult , void > = new RequestType < FormatParams , FormatResult , void > ( 'cpptools/formatDocument' ) ;
546
+ export const FormatRangeRequest : RequestType < FormatParams , FormatResult , void > = new RequestType < FormatParams , FormatResult , void > ( 'cpptools/formatRange' ) ;
547
+ export const FormatOnTypeRequest : RequestType < FormatParams , FormatResult , void > = new RequestType < FormatParams , FormatResult , void > ( 'cpptools/formatOnType' ) ;
542
548
const CreateDeclarationOrDefinitionRequest : RequestType < CreateDeclarationOrDefinitionParams , CreateDeclarationOrDefinitionResult , void > = new RequestType < CreateDeclarationOrDefinitionParams , CreateDeclarationOrDefinitionResult , void > ( 'cpptools/createDeclDef' ) ;
543
549
const GoToDirectiveInGroupRequest : RequestType < GoToDirectiveInGroupParams , Position | undefined , void > = new RequestType < GoToDirectiveInGroupParams , Position | undefined , void > ( 'cpptools/goToDirectiveInGroup' ) ;
544
550
const GenerateDoxygenCommentRequest : RequestType < GenerateDoxygenCommentParams , GenerateDoxygenCommentResult | undefined , void > = new RequestType < GenerateDoxygenCommentParams , GenerateDoxygenCommentResult , void > ( 'cpptools/generateDoxygenComment' ) ;
551
+ const ChangeCppPropertiesRequest : RequestType < CppPropertiesParams , void , void > = new RequestType < CppPropertiesParams , void , void > ( 'cpptools/didChangeCppProperties' ) ;
545
552
546
553
// Notifications to the server
547
554
const DidOpenNotification : NotificationType < DidOpenTextDocumentParams > = new NotificationType < DidOpenTextDocumentParams > ( 'textDocument/didOpen' ) ;
@@ -554,7 +561,6 @@ const ResumeParsingNotification: NotificationType<void> = new NotificationType<v
554
561
const ActiveDocumentChangeNotification : NotificationType < TextDocumentIdentifier > = new NotificationType < TextDocumentIdentifier > ( 'cpptools/activeDocumentChange' ) ;
555
562
const RestartIntelliSenseForFileNotification : NotificationType < TextDocumentIdentifier > = new NotificationType < TextDocumentIdentifier > ( 'cpptools/restartIntelliSenseForFile' ) ;
556
563
const TextEditorSelectionChangeNotification : NotificationType < Range > = new NotificationType < Range > ( 'cpptools/textEditorSelectionChange' ) ;
557
- const ChangeCppPropertiesNotification : NotificationType < CppPropertiesParams > = new NotificationType < CppPropertiesParams > ( 'cpptools/didChangeCppProperties' ) ;
558
564
const ChangeCompileCommandsNotification : NotificationType < FileChangedParams > = new NotificationType < FileChangedParams > ( 'cpptools/didChangeCompileCommands' ) ;
559
565
const ChangeSelectedSettingNotification : NotificationType < FolderSelectedSettingParams > = new NotificationType < FolderSelectedSettingParams > ( 'cpptools/didChangeSelectedSetting' ) ;
560
566
const IntervalTimerNotification : NotificationType < IntervalTimerParams > = new NotificationType < IntervalTimerParams > ( 'cpptools/onIntervalTimer' ) ;
@@ -1697,7 +1703,8 @@ export class DefaultClient implements Client {
1697
1703
}
1698
1704
1699
1705
public async logDiagnostics ( ) : Promise < void > {
1700
- const response : GetDiagnosticsResult = await this . requestWhenReady ( ( ) => this . languageClient . sendRequest ( GetDiagnosticsRequest , null ) ) ;
1706
+ await this . awaitUntilLanguageClientReady ( ) ;
1707
+ const response : GetDiagnosticsResult = await this . languageClient . sendRequest ( GetDiagnosticsRequest , null ) ;
1701
1708
const diagnosticsChannel : vscode . OutputChannel = getDiagnosticsChannel ( ) ;
1702
1709
diagnosticsChannel . clear ( ) ;
1703
1710
@@ -2593,7 +2600,7 @@ export class DefaultClient implements Client {
2593
2600
2594
2601
private doneInitialCustomBrowseConfigurationCheck : boolean = false ;
2595
2602
2596
- private onConfigurationsChanged ( cppProperties : configs . CppProperties ) : void {
2603
+ private async onConfigurationsChanged ( cppProperties : configs . CppProperties ) : Promise < void > {
2597
2604
if ( ! cppProperties . Configurations ) {
2598
2605
return ;
2599
2606
}
@@ -2623,7 +2630,7 @@ export class DefaultClient implements Client {
2623
2630
params . configurations . push ( modifiedConfig ) ;
2624
2631
} ) ;
2625
2632
2626
- this . languageClient . sendNotification ( ChangeCppPropertiesNotification , params ) ;
2633
+ await this . languageClient . sendRequest ( ChangeCppPropertiesRequest , params ) ;
2627
2634
const lastCustomBrowseConfigurationProviderId : PersistentFolderState < string | undefined > | undefined = cppProperties . LastCustomBrowseConfigurationProviderId ;
2628
2635
const lastCustomBrowseConfigurationProviderVersion : PersistentFolderState < Version > | undefined = cppProperties . LastCustomBrowseConfigurationProviderVersion ;
2629
2636
const lastCustomBrowseConfiguration : PersistentFolderState < WorkspaceBrowseConfiguration | undefined > | undefined = cppProperties . LastCustomBrowseConfiguration ;
0 commit comments