File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ import * as vscode from "vscode";
6
6
import { sendError , sendInfo } from "vscode-extension-telemetry-wrapper" ;
7
7
import { LSDaemon } from "./daemon" ;
8
8
9
+ const INTERESTED_REQUESTS : Set < string > = new Set ( [
10
+ "initialize" ,
11
+ "textDocument/completion" ,
12
+ ] ) ;
9
13
const delay = promisify ( setTimeout ) ;
10
14
11
15
let daemon : LSDaemon ;
@@ -46,6 +50,17 @@ async function checkJavaExtActivated(_context: vscode.ExtensionContext): Promise
46
50
return false ;
47
51
}
48
52
53
+ // Trace the interested LSP requests performance
54
+ javaExt . exports ?. onDidRequestEnd ( ( traceEvent : any ) => {
55
+ if ( INTERESTED_REQUESTS . has ( traceEvent . type ) ) {
56
+ sendInfo ( "" , {
57
+ name : "lsp" ,
58
+ kind : traceEvent . type ,
59
+ duration : Math . trunc ( traceEvent . duration ) ,
60
+ } ) ;
61
+ }
62
+ } ) ;
63
+
49
64
// on ServiceReady
50
65
javaExt . exports . onDidServerModeChange ( async ( mode : string ) => {
51
66
if ( mode === "Hybrid" ) { // begin to start standard language server
You can’t perform that action at this time.
0 commit comments