@@ -53,7 +53,7 @@ import {
5353import { Location , TextEdit , WorkspaceEdit } from './commonTypes' ;
5454import * as configs from './configurations' ;
5555import { DataBinding } from './dataBinding' ;
56- import { CppSourceStr , clients , configPrefix , updateLanguageConfigurations , watchForCrashes } from './extension' ;
56+ import { CppSourceStr , clients , configPrefix , updateLanguageConfigurations , usesCrashHandler , watchForCrashes } from './extension' ;
5757import { LocalizeStringParams , getLocaleId , getLocalizedString } from './localization' ;
5858import { PersistentFolderState , PersistentWorkspaceState } from './persistentState' ;
5959import { createProtocolFilter } from './protocolFilter' ;
@@ -544,7 +544,8 @@ interface GetIncludesResult
544544}
545545
546546// Requests
547- const InitializationRequest : RequestType < CppInitializationParams , string , void > = new RequestType < CppInitializationParams , string , void > ( 'cpptools/initialize' ) ;
547+ const PreInitializationRequest : RequestType < void , string , void > = new RequestType < void , string , void > ( 'cpptools/preinitialize' ) ;
548+ const InitializationRequest : RequestType < CppInitializationParams , void , void > = new RequestType < CppInitializationParams , void , void > ( 'cpptools/initialize' ) ;
548549const QueryCompilerDefaultsRequest : RequestType < QueryDefaultCompilerParams , configs . CompilerDefaults , void > = new RequestType < QueryDefaultCompilerParams , configs . CompilerDefaults , void > ( 'cpptools/queryCompilerDefaults' ) ;
549550const QueryTranslationUnitSourceRequest : RequestType < QueryTranslationUnitSourceParams , QueryTranslationUnitSourceResult , void > = new RequestType < QueryTranslationUnitSourceParams , QueryTranslationUnitSourceResult , void > ( 'cpptools/queryTranslationUnitSource' ) ;
550551const SwitchHeaderSourceRequest : RequestType < SwitchHeaderSourceParams , string , void > = new RequestType < SwitchHeaderSourceParams , string , void > ( 'cpptools/didSwitchHeaderSource' ) ;
@@ -1592,10 +1593,14 @@ export class DefaultClient implements Client {
15921593 languageClient . registerProposedFeatures ( ) ;
15931594 await languageClient . start ( ) ;
15941595
1596+ if ( usesCrashHandler ( ) ) {
1597+ watchForCrashes ( await languageClient . sendRequest ( PreInitializationRequest , null ) ) ;
1598+ }
1599+
15951600 // Move initialization to a separate message, so we can see log output from it.
15961601 // A request is used in order to wait for completion and ensure that no subsequent
15971602 // higher priority message may be processed before the Initialization request.
1598- watchForCrashes ( await languageClient . sendRequest ( InitializationRequest , cppInitializationParams ) ) ;
1603+ await languageClient . sendRequest ( InitializationRequest , cppInitializationParams ) ;
15991604 }
16001605
16011606 public async sendDidChangeSettings ( ) : Promise < void > {
0 commit comments