@@ -59,7 +59,7 @@ import { CopilotCompletionContextFeatures, CopilotCompletionContextProvider } fr
59
59
import { CustomConfigurationProvider1 , getCustomConfigProviders , isSameProviderExtensionId } from './customProviders' ;
60
60
import { DataBinding } from './dataBinding' ;
61
61
import { cachedEditorConfigSettings , getEditorConfigSettings } from './editorConfig' ;
62
- import { CppSourceStr , clients , configPrefix , initializeIntervalTimer , updateLanguageConfigurations , usesCrashHandler , watchForCrashes } from './extension' ;
62
+ import { CppSourceStr , clients , configPrefix , initializeIntervalTimer , isWritingCrashCallStack , updateLanguageConfigurations , usesCrashHandler , watchForCrashes } from './extension' ;
63
63
import { LocalizeStringParams , getLocaleId , getLocalizedString } from './localization' ;
64
64
import { PersistentFolderState , PersistentState , PersistentWorkspaceState } from './persistentState' ;
65
65
import { RequestCancelled , ServerCancelled , createProtocolFilter } from './protocolFilter' ;
@@ -942,6 +942,8 @@ export class DefaultClient implements Client {
942
942
public getShowConfigureIntelliSenseButton ( ) : boolean { return this . showConfigureIntelliSenseButton ; }
943
943
public setShowConfigureIntelliSenseButton ( show : boolean ) : void { this . showConfigureIntelliSenseButton = show ; }
944
944
945
+ private lastInvokedLspMessage : string = "" ; // e.g. cpptools/hover
946
+
945
947
/**
946
948
* don't use this.rootFolder directly since it can be undefined
947
949
*/
@@ -1677,7 +1679,6 @@ export class DefaultClient implements Client {
1677
1679
closed : ( ) => {
1678
1680
languageClientCrashTimes . push ( Date . now ( ) ) ;
1679
1681
languageClientCrashedNeedsRestart = true ;
1680
- telemetry . logLanguageServerEvent ( "languageClientCrash" ) ;
1681
1682
let restart : boolean = true ;
1682
1683
if ( languageClientCrashTimes . length < 5 ) {
1683
1684
void clients . recreateClients ( ) ;
@@ -1691,6 +1692,27 @@ export class DefaultClient implements Client {
1691
1692
void clients . recreateClients ( ) ;
1692
1693
}
1693
1694
}
1695
+
1696
+ // Wait 1 second to allow time for the file watcher to signal a crash call stack write has occurred.
1697
+ setTimeout ( ( ) => {
1698
+ const sanitizedLspMessage = this . lastInvokedLspMessage . replace ( '/' , '.' ) ;
1699
+ telemetry . logLanguageServerEvent ( "languageClientCrash" ,
1700
+ {
1701
+ lastInvokedLspMessage : sanitizedLspMessage
1702
+ } ,
1703
+ {
1704
+ restarting : Number ( restart ) ,
1705
+ writingCrashCallStack : Number ( isWritingCrashCallStack ) ,
1706
+ initializingWorkspace : Number ( this . model . isInitializingWorkspace . Value ) ,
1707
+ indexingWorkspace : Number ( this . model . isIndexingWorkspace . Value ) ,
1708
+ parsingWorkspace : Number ( this . model . isParsingWorkspace . Value ) ,
1709
+ parsingFiles : Number ( this . model . isParsingFiles . Value ) ,
1710
+ updatingIntelliSense : Number ( this . model . isUpdatingIntelliSense . Value ) ,
1711
+ runningCodeAnalysis : Number ( this . model . isRunningCodeAnalysis . Value )
1712
+ }
1713
+ ) ;
1714
+ } , 1000 ) ;
1715
+
1694
1716
const message : string = restart ? localize ( 'server.crashed.restart' , 'The language server crashed. Restarting...' )
1695
1717
: localize ( 'server.crashed2' , 'The language server crashed 5 times in the last 3 minutes. It will not be restarted.' ) ;
1696
1718
@@ -2747,55 +2769,59 @@ export class DefaultClient implements Client {
2747
2769
const message : string = notificationBody . status ;
2748
2770
util . setProgress ( util . getProgressExecutableSuccess ( ) ) ;
2749
2771
const testHook : TestHook = getTestHook ( ) ;
2750
- if ( message . endsWith ( "Idle" ) ) {
2751
- const status : IntelliSenseStatus = { status : Status . Idle } ;
2752
- testHook . updateStatus ( status ) ;
2753
- } else if ( message . endsWith ( "Parsing" ) ) {
2754
- this . model . isParsingWorkspace . Value = true ;
2755
- this . model . isInitializingWorkspace . Value = false ;
2756
- this . model . isIndexingWorkspace . Value = false ;
2757
- const status : IntelliSenseStatus = { status : Status . TagParsingBegun } ;
2758
- testHook . updateStatus ( status ) ;
2759
- } else if ( message . endsWith ( "Initializing" ) ) {
2760
- this . model . isInitializingWorkspace . Value = true ;
2761
- this . model . isIndexingWorkspace . Value = false ;
2762
- this . model . isParsingWorkspace . Value = false ;
2763
- } else if ( message . endsWith ( "Indexing" ) ) {
2764
- this . model . isIndexingWorkspace . Value = true ;
2765
- this . model . isInitializingWorkspace . Value = false ;
2766
- this . model . isParsingWorkspace . Value = false ;
2767
- } else if ( message . endsWith ( "files" ) ) {
2768
- this . model . isParsingFiles . Value = true ;
2769
- } else if ( message . endsWith ( "IntelliSense" ) ) {
2770
- timeStamp = Date . now ( ) ;
2771
- this . model . isUpdatingIntelliSense . Value = true ;
2772
- const status : IntelliSenseStatus = { status : Status . IntelliSenseCompiling } ;
2773
- testHook . updateStatus ( status ) ;
2774
- } else if ( message . endsWith ( "IntelliSense done" ) ) {
2775
- getOutputChannelLogger ( ) . appendLineAtLevel ( 6 , localize ( "update.intellisense.time" , "Update IntelliSense time (sec): {0}" , ( Date . now ( ) - timeStamp ) / 1000 ) ) ;
2776
- this . model . isUpdatingIntelliSense . Value = false ;
2777
- const status : IntelliSenseStatus = { status : Status . IntelliSenseReady } ;
2778
- testHook . updateStatus ( status ) ;
2779
- } else if ( message . endsWith ( "Parsing done" ) ) { // Tag Parser Ready
2780
- this . model . isParsingWorkspace . Value = false ;
2781
- const status : IntelliSenseStatus = { status : Status . TagParsingDone } ;
2782
- testHook . updateStatus ( status ) ;
2783
- util . setProgress ( util . getProgressParseRootSuccess ( ) ) ;
2784
- } else if ( message . endsWith ( "files done" ) ) {
2785
- this . model . isParsingFiles . Value = false ;
2786
- } else if ( message . endsWith ( "Analysis" ) ) {
2787
- this . model . isRunningCodeAnalysis . Value = true ;
2788
- this . model . codeAnalysisTotal . Value = 1 ;
2789
- this . model . codeAnalysisProcessed . Value = 0 ;
2790
- } else if ( message . endsWith ( "Analysis done" ) ) {
2791
- this . model . isRunningCodeAnalysis . Value = false ;
2792
- } else if ( message . includes ( "Squiggles Finished - File name:" ) ) {
2793
- const index : number = message . lastIndexOf ( ":" ) ;
2794
- const name : string = message . substring ( index + 2 ) ;
2795
- const status : IntelliSenseStatus = { status : Status . IntelliSenseReady , filename : name } ;
2796
- testHook . updateStatus ( status ) ;
2797
- } else if ( message . endsWith ( "No Squiggles" ) ) {
2798
- util . setIntelliSenseProgress ( util . getProgressIntelliSenseNoSquiggles ( ) ) ;
2772
+ if ( message . startsWith ( "C_Cpp: " ) ) {
2773
+ if ( message . endsWith ( "Idle" ) ) {
2774
+ const status : IntelliSenseStatus = { status : Status . Idle } ;
2775
+ testHook . updateStatus ( status ) ;
2776
+ } else if ( message . endsWith ( "Parsing" ) ) {
2777
+ this . model . isParsingWorkspace . Value = true ;
2778
+ this . model . isInitializingWorkspace . Value = false ;
2779
+ this . model . isIndexingWorkspace . Value = false ;
2780
+ const status : IntelliSenseStatus = { status : Status . TagParsingBegun } ;
2781
+ testHook . updateStatus ( status ) ;
2782
+ } else if ( message . endsWith ( "Initializing" ) ) {
2783
+ this . model . isInitializingWorkspace . Value = true ;
2784
+ this . model . isIndexingWorkspace . Value = false ;
2785
+ this . model . isParsingWorkspace . Value = false ;
2786
+ } else if ( message . endsWith ( "Indexing" ) ) {
2787
+ this . model . isIndexingWorkspace . Value = true ;
2788
+ this . model . isInitializingWorkspace . Value = false ;
2789
+ this . model . isParsingWorkspace . Value = false ;
2790
+ } else if ( message . endsWith ( "files" ) ) {
2791
+ this . model . isParsingFiles . Value = true ;
2792
+ } else if ( message . endsWith ( "IntelliSense" ) ) {
2793
+ timeStamp = Date . now ( ) ;
2794
+ this . model . isUpdatingIntelliSense . Value = true ;
2795
+ const status : IntelliSenseStatus = { status : Status . IntelliSenseCompiling } ;
2796
+ testHook . updateStatus ( status ) ;
2797
+ } else if ( message . endsWith ( "IntelliSense done" ) ) {
2798
+ getOutputChannelLogger ( ) . appendLineAtLevel ( 6 , localize ( "update.intellisense.time" , "Update IntelliSense time (sec): {0}" , ( Date . now ( ) - timeStamp ) / 1000 ) ) ;
2799
+ this . model . isUpdatingIntelliSense . Value = false ;
2800
+ const status : IntelliSenseStatus = { status : Status . IntelliSenseReady } ;
2801
+ testHook . updateStatus ( status ) ;
2802
+ } else if ( message . endsWith ( "Parsing done" ) ) { // Tag Parser Ready
2803
+ this . model . isParsingWorkspace . Value = false ;
2804
+ const status : IntelliSenseStatus = { status : Status . TagParsingDone } ;
2805
+ testHook . updateStatus ( status ) ;
2806
+ util . setProgress ( util . getProgressParseRootSuccess ( ) ) ;
2807
+ } else if ( message . endsWith ( "files done" ) ) {
2808
+ this . model . isParsingFiles . Value = false ;
2809
+ } else if ( message . endsWith ( "Analysis" ) ) {
2810
+ this . model . isRunningCodeAnalysis . Value = true ;
2811
+ this . model . codeAnalysisTotal . Value = 1 ;
2812
+ this . model . codeAnalysisProcessed . Value = 0 ;
2813
+ } else if ( message . endsWith ( "Analysis done" ) ) {
2814
+ this . model . isRunningCodeAnalysis . Value = false ;
2815
+ } else if ( message . includes ( "Squiggles Finished - File name:" ) ) {
2816
+ const index : number = message . lastIndexOf ( ":" ) ;
2817
+ const name : string = message . substring ( index + 2 ) ;
2818
+ const status : IntelliSenseStatus = { status : Status . IntelliSenseReady , filename : name } ;
2819
+ testHook . updateStatus ( status ) ;
2820
+ } else if ( message . endsWith ( "No Squiggles" ) ) {
2821
+ util . setIntelliSenseProgress ( util . getProgressIntelliSenseNoSquiggles ( ) ) ;
2822
+ }
2823
+ } else if ( message . includes ( "/" ) ) {
2824
+ this . lastInvokedLspMessage = message ;
2799
2825
}
2800
2826
}
2801
2827
0 commit comments