File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,14 @@ async function checkJavaExtActivated(_context: vscode.ExtensionContext): Promise
7676 return true ;
7777}
7878
79+ const RESPONSIVE_REQUESTS : Set < string > = new Set ( [
80+ "textDocument/completion" ,
81+ "completionItem/resolve" ,
82+ "textDocument/signatureHelp" ,
83+ "textDocument/definition" ,
84+ "textDocument/hover" ,
85+ "workspace/executeCommand/java.edit.handlePasteEvent" ,
86+ ] ) ;
7987const INTERESTED_REQUESTS : Set < string > = new Set ( [
8088 "initialize" ,
8189 "textDocument/completion" ,
@@ -96,6 +104,18 @@ async function traceLSPPerformance(javaExt: vscode.Extension<any>) {
96104 return ;
97105 }
98106
107+ // Trace the timeout requests
108+ if ( traceEvent . duration > 5000
109+ || ( traceEvent . duration > 1000 && RESPONSIVE_REQUESTS . has ( traceEvent . type ) ) ) {
110+ sendInfo ( "" , {
111+ name : "lsp.timeout" ,
112+ kind : escapeLspRequestName ( traceEvent . type ) ,
113+ duration : Math . trunc ( traceEvent . duration ) ,
114+ javaversion : javaExtVersion ,
115+ remark : sampling ,
116+ } ) ;
117+ }
118+
99119 if ( traceEvent . error ) {
100120 let code : number = traceEvent . error ?. code || 0 ;
101121 let errorMessage : string = traceEvent . error ?. message || String ( traceEvent . error ) ;
You can’t perform that action at this time.
0 commit comments