@@ -149,25 +149,29 @@ open Ionide.ProjInfo.Logging
149149
150150
151151/// listener for the the events generated from the fsc ActivitySource
152- type ProgressListener ( lspClient : FSharpLspClient ) =
153-
154- let isOneOf list string = list |> List.exists ( fun f -> f string)
152+ type ProgressListener ( lspClient : FSharpLspClient , traceNamespace : string array ) =
155153
154+ let isOneOf list string = list |> Array.exists ( fun f -> f string)
156155
156+ let strEquals ( other : string ) ( this : string ) = this.Equals( other, StringComparison.InvariantCultureIgnoreCase)
157157 let strContains ( substring : string ) ( str : string ) = str.Contains( substring)
158158
159159 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." ]
160+ traceNamespace
161+ |> Array.map strContains
162+ // [
163+ // strEquals "BoundModel.TypeCheck"
164+ // strContains "BackgroundCompiler."
165+ // // strContains "BoundModel."
166+ // // strContains "IncrementalBuild."
167+ // // strContains "CheckDeclarations."
168+ // // strContains "ParseAndCheckInputs."
169+ // // strContains "BackgroundCompiler."
170+ // // strContains "IncrementalBuildSyntaxTree."
171+ // // strContains "ParseAndCheckFile."
172+ // // strContains "ParseAndCheckInputs."
173+ // // strContains "CheckDeclarations."
174+ // ]
171175
172176 let logger = LogProvider.getLoggerByName " Compiler"
173177
@@ -179,11 +183,13 @@ type ProgressListener(lspClient: FSharpLspClient) =
179183 let isStopped ( activity : Activity ) =
180184#if NET6_ 0
181185 false
186+ ||
182187#else
183188 activity.IsStopped
189+ ||
184190#endif
185191 // giving this 1 seconds to report something, otherwise assume it's a dead activity
186- || (( DateTime.UtcNow - activity.StartTimeUtc) > TimeSpan.FromSeconds( 1 .)
192+ (( DateTime.UtcNow - activity.StartTimeUtc) > TimeSpan.FromSeconds( 5 .)
187193 && activity.Duration = TimeSpan.Zero)
188194
189195 let getTagItemSafe key ( a : Activity ) = a.GetTagItem key |> Option.ofObj
@@ -200,7 +206,6 @@ type ProgressListener(lspClient: FSharpLspClient) =
200206 >> Option.map IO.Path.GetFileName
201207 >> Option.defaultValue String.Empty
202208
203-
204209 let getUserOpName =
205210 getTagItemSafe Tracing.SemanticConventions.FCS.userOpName
206211 >> Option.map string
@@ -218,9 +223,17 @@ type ProgressListener(lspClient: FSharpLspClient) =
218223 inflightEvents.TryRemove( a.Id) |> ignore
219224 else
220225 // 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}" )
226+ let message =
227+ String.Join( " - " ,
228+ [
229+ getFileName a
230+ getProject a
231+ getUserOpName a
232+ ]
233+ )
234+
235+
236+ do ! p.Report( message = message)
224237
225238 match ! inbox.TryReceive( 250 ) with
226239 | None ->
@@ -233,10 +246,10 @@ type ProgressListener(lspClient: FSharpLspClient) =
233246 let fileName = getFileName activity
234247 let userOpName = getUserOpName activity
235248
236- logger.debug (
237- Log.setMessageI
238- $" Started : {activity.DisplayName:DisplayName} - {userOpName:UserOpName} - {fileName:fileName}"
239- )
249+ // logger.debug (
250+ // Log.setMessageI
251+ // $"Started : {activity.DisplayName:DisplayName} - {userOpName:UserOpName} - {fileName:fileName}"
252+ // )
240253
241254 if
242255 activity.DisplayName |> isOneOf interestingActivities
@@ -253,10 +266,10 @@ type ProgressListener(lspClient: FSharpLspClient) =
253266 let userOpName = getUserOpName activity
254267 let duration = activity.Duration.ToString()
255268
256- logger.debug (
257- Log.setMessageI
258- $" Finished : {activity.DisplayName:DisplayName} - {userOpName:UserOpName} - {fileName:fileName} - took {duration:duration}"
259- )
269+ // logger.debug (
270+ // Log.setMessageI
271+ // $"Finished : {activity.DisplayName:DisplayName} - {userOpName:UserOpName} - {fileName:fileName} - took {duration:duration}"
272+ // )
260273
261274 if activity.DisplayName |> isOneOf interestingActivities then
262275 match inflightEvents.TryRemove( activity.Id) with
0 commit comments