@@ -77,27 +77,29 @@ mutable struct LanguageServerInstance
77
77
# folder. Primarily for projects and manifests outside of the workspace.
78
78
_extra_tracked_files:: Vector{URI}
79
79
80
+ _send_request_metrics:: Bool
81
+
80
82
function LanguageServerInstance (@nospecialize (pipe_in), @nospecialize (pipe_out), env_path= " " , depot_path= " " , err_handler= nothing , symserver_store_path= nothing , download= true , symbolcache_upstream = nothing , julia_exe:: Union{NamedTuple{(:path,:version),Tuple{String,VersionNumber}},Nothing} = nothing )
81
83
endpoint = JSONRPC. JSONRPCEndpoint (pipe_in, pipe_out, err_handler)
82
84
jw = JuliaWorkspace ()
83
- if hasfield (typeof (jw. runtime), :performance_tracing_callback )
84
- jw. runtime. performance_tracing_callback = (name, start_time, duration) -> begin
85
- if g_operationId[] != " " && endpoint. status === :running
86
- JSONRPC. send (
87
- endpoint,
88
- telemetry_event_notification_type,
89
- Dict (
90
- " command" => " request_metric" ,
91
- " operationId" => string (uuid4 ()),
92
- " operationParentId" => g_operationId[],
93
- " name" => name,
94
- " duration" => duration,
95
- " time" => string (Dates. unix2datetime (start_time), " Z" )
96
- )
97
- )
98
- end
99
- end
100
- end
85
+ # if hasfield(typeof(jw.runtime), :performance_tracing_callback)
86
+ # jw.runtime.performance_tracing_callback = (name, start_time, duration) -> begin
87
+ # if g_operationId[] != "" && endpoint.status === :running
88
+ # JSONRPC.send(
89
+ # endpoint,
90
+ # telemetry_event_notification_type,
91
+ # Dict(
92
+ # "command" => "request_metric",
93
+ # "operationId" => string(uuid4()),
94
+ # "operationParentId" => g_operationId[],
95
+ # "name" => name,
96
+ # "duration" => duration,
97
+ # "time" => string(Dates.unix2datetime(start_time), "Z")
98
+ # )
99
+ # )
100
+ # end
101
+ # end
102
+ # end
101
103
102
104
new (
103
105
endpoint,
@@ -134,7 +136,8 @@ mutable struct LanguageServerInstance
134
136
jw,
135
137
Dict {URI,Int} (),
136
138
Dict {URI,JuliaWorkspaces.TextFile} (),
137
- URI[]
139
+ URI[],
140
+ false
138
141
)
139
142
end
140
143
end
@@ -442,16 +445,18 @@ function Base.run(server::LanguageServerInstance; timings = [])
442
445
toc = time_ns ()
443
446
duration = (toc - tic) / 1e+6
444
447
445
- JSONRPC. send (
446
- server. jr_endpoint,
447
- telemetry_event_notification_type,
448
- Dict (
449
- " command" => " request_metric" ,
450
- " operationId" => g_operationId[],
451
- " name" => msg[" method" ],
452
- " time" => start_time,
453
- " duration" => duration)
454
- )
448
+ if server. _send_request_metrics
449
+ JSONRPC. send (
450
+ server. jr_endpoint,
451
+ telemetry_event_notification_type,
452
+ Dict (
453
+ " command" => " request_metric" ,
454
+ " operationId" => g_operationId[],
455
+ " name" => msg[" method" ],
456
+ " time" => start_time,
457
+ " duration" => duration)
458
+ )
459
+ end
455
460
elseif message. type == :symservmsg
456
461
@debug " Received new data from Julia Symbol Server."
457
462
0 commit comments