@@ -149,25 +149,30 @@ open Ionide.ProjInfo.Logging
149149
150150
151151/// listener for the the events generated from the fsc ActivitySource
152- type ProgressListener ( lspClient : FSharpLspClient ) =
152+ type ProgressListener ( lspClient : FSharpLspClient , traceNamespace : string array ) =
153153
154- let isOneOf list string = list |> List.exists ( fun f -> f string)
154+ let isOneOf list string =
155+ list |> Array.exists ( fun f -> f string)
155156
157+ let strEquals ( other : string ) ( this : string ) =
158+ this.Equals( other, StringComparison.InvariantCultureIgnoreCase)
156159
157160 let strContains ( substring : string ) ( str : string ) = str.Contains( substring)
158161
159- let interestingActivities =
160- [
161-
162- strContains " BoundModel."
163- strContains " IncrementalBuild."
164- strContains " CheckDeclarations."
165- strContains " ParseAndCheckInputs."
166- strContains " BackgroundCompiler."
167- strContains " IncrementalBuildSyntaxTree."
168- strContains " ParseAndCheckFile."
169- strContains " ParseAndCheckInputs."
170- strContains " CheckDeclarations." ]
162+ let interestingActivities = traceNamespace |> Array.map strContains
163+ // [
164+ // strEquals "BoundModel.TypeCheck"
165+ // strContains "BackgroundCompiler."
166+ // // strContains "BoundModel."
167+ // // strContains "IncrementalBuild."
168+ // // strContains "CheckDeclarations."
169+ // // strContains "ParseAndCheckInputs."
170+ // // strContains "BackgroundCompiler."
171+ // // strContains "IncrementalBuildSyntaxTree."
172+ // // strContains "ParseAndCheckFile."
173+ // // strContains "ParseAndCheckInputs."
174+ // // strContains "CheckDeclarations."
175+ // ]
171176
172177 let logger = LogProvider.getLoggerByName " Compiler"
173178
@@ -179,12 +184,14 @@ type ProgressListener(lspClient: FSharpLspClient) =
179184 let isStopped ( activity : Activity ) =
180185#if NET6_ 0
181186 false
187+ ||
182188#else
183189 activity.IsStopped
190+ ||
184191#endif
185192 // giving this 1 seconds to report something, otherwise assume it's a dead activity
186- || (( DateTime.UtcNow - activity.StartTimeUtc) > TimeSpan.FromSeconds( 1 .)
187- && activity.Duration = TimeSpan.Zero)
193+ (( DateTime.UtcNow - activity.StartTimeUtc) > TimeSpan.FromSeconds( 5 .)
194+ && activity.Duration = TimeSpan.Zero)
188195
189196 let getTagItemSafe key ( a : Activity ) = a.GetTagItem key |> Option.ofObj
190197
@@ -200,7 +207,6 @@ type ProgressListener(lspClient: FSharpLspClient) =
200207 >> Option.map IO.Path.GetFileName
201208 >> Option.defaultValue String.Empty
202209
203-
204210 let getUserOpName =
205211 getTagItemSafe Tracing.SemanticConventions.FCS.userOpName
206212 >> Option.map string
@@ -218,9 +224,10 @@ type ProgressListener(lspClient: FSharpLspClient) =
218224 inflightEvents.TryRemove( a.Id) |> ignore
219225 else
220226 // FSC doesn't start their spans with tags so we have to see if it's been added later https://github.com/dotnet/fsharp/issues/14776
221- let fileName = getFileName a
222- let userOpName = getUserOpName a
223- do ! p.Report( message = $" {fileName} - {userOpName}" )
227+ let message = String.Join( " - " , [ getFileName a; getProject a; getUserOpName a ])
228+
229+
230+ do ! p.Report( message = message)
224231
225232 match ! inbox.TryReceive( 250 ) with
226233 | None ->
@@ -233,10 +240,10 @@ type ProgressListener(lspClient: FSharpLspClient) =
233240 let fileName = getFileName activity
234241 let userOpName = getUserOpName activity
235242
236- logger.debug (
237- Log.setMessageI
238- $" Started : {activity.DisplayName:DisplayName} - {userOpName:UserOpName} - {fileName:fileName}"
239- )
243+ // logger.debug (
244+ // Log.setMessageI
245+ // $"Started : {activity.DisplayName:DisplayName} - {userOpName:UserOpName} - {fileName:fileName}"
246+ // )
240247
241248 if
242249 activity.DisplayName |> isOneOf interestingActivities
@@ -253,10 +260,10 @@ type ProgressListener(lspClient: FSharpLspClient) =
253260 let userOpName = getUserOpName activity
254261 let duration = activity.Duration.ToString()
255262
256- logger.debug (
257- Log.setMessageI
258- $" Finished : {activity.DisplayName:DisplayName} - {userOpName:UserOpName} - {fileName:fileName} - took {duration:duration}"
259- )
263+ // logger.debug (
264+ // Log.setMessageI
265+ // $"Finished : {activity.DisplayName:DisplayName} - {userOpName:UserOpName} - {fileName:fileName} - took {duration:duration}"
266+ // )
260267
261268 if activity.DisplayName |> isOneOf interestingActivities then
262269 match inflightEvents.TryRemove( activity.Id) with
0 commit comments