@@ -144,17 +144,27 @@ module internal NoteworthyParamInfoLocationsImpl =
144144 NotFound, Some inner
145145 | _ -> NotFound, Some inner
146146
147-
147+ let (| StaticParameters | _ |) pos synType =
148+ match synType with
149+ | SynType.App( SynType.LongIdent( LongIdentWithDots( lid, _) as lidwd), Some( openm), args, commas, closemOpt, _ pf, wholem) ->
150+ let lidm = lidwd.Range
151+ let betweenTheBrackets = mkRange wholem.FileName openm.Start wholem.End
152+ if AstTraversal.rangeContainsPosEdgesExclusive betweenTheBrackets pos && args |> List.forall isStaticArg then
153+ let commasAndCloseParen = [ for c in commas -> c.End ] @ [ wholem.End ]
154+ Some ( FSharpNoteworthyParamInfoLocations( pathOfLid lid, lidm, openm.Start, commasAndCloseParen, closemOpt.IsSome, args |> List.map digOutIdentFromStaticArg))
155+ else
156+ None
157+ | _ ->
158+ None
148159
149160 let traverseInput ( pos , parseTree ) =
150-
151161 AstTraversal.Traverse( pos, parseTree, { new AstTraversal.AstVisitorBase<_>() with
152162 member this.VisitExpr(_ path, traverseSynExpr, defaultTraverse, expr) =
153163 let expr = expr // fix debug locals
154164 match expr with
155165
156166 // new LID<tyarg1, ...., tyargN>(...) and error recovery of these
157- | SynExpr.New(_, synType, synExpr, _ range ) ->
167+ | SynExpr.New(_, synType, synExpr, _ ) ->
158168 let constrArgsResult , cacheOpt = searchSynArgExpr traverseSynExpr pos synExpr
159169 match constrArgsResult, cacheOpt with
160170 | Found( parenLoc, args, isThereACloseParen), _ ->
@@ -163,7 +173,9 @@ module internal NoteworthyParamInfoLocationsImpl =
163173 | NotFound, Some cache ->
164174 cache
165175 | _ ->
166- traverseSynExpr synExpr
176+ match synType with
177+ | StaticParameters pos loc -> Some loc
178+ | _ -> traverseSynExpr synExpr
167179
168180 // EXPR< = error recovery of a form of half-written TypeApp
169181 | SynExpr.App(_, _, SynExpr.App(_, true , SynExpr.Ident op, synExpr, openm), SynExpr.ArbitraryAfterError _, wholem) when op.idText = " op_LessThan" ->
@@ -221,18 +233,10 @@ module internal NoteworthyParamInfoLocationsImpl =
221233
222234 | _ -> defaultTraverse expr
223235
224- member this.VisitTypeAbbrev( tyAbbrevRhs, _ m) =
236+ member this.VisitTypeAbbrev( tyAbbrevRhs, _ m) =
225237 match tyAbbrevRhs with
226- | SynType.App( SynType.LongIdent( LongIdentWithDots( lid, _) as lidwd), Some( openm), args, commas, closemOpt, _ pf, wholem) ->
227- let lidm = lidwd.Range
228- let betweenTheBrackets = mkRange wholem.FileName openm.Start wholem.End
229- if AstTraversal.rangeContainsPosEdgesExclusive betweenTheBrackets pos && args |> List.forall isStaticArg then
230- let commasAndCloseParen = [ for c in commas -> c.End ] @ [ wholem.End ]
231- Some ( FSharpNoteworthyParamInfoLocations( pathOfLid lid, lidm, openm.Start, commasAndCloseParen, closemOpt.IsSome, args |> List.map digOutIdentFromStaticArg))
232- else
233- None
234- | _ ->
235- None
238+ | StaticParameters pos loc -> Some loc
239+ | _ -> None
236240
237241 member this.VisitImplicitInherit( defaultTraverse, ty, expr, m) =
238242 match defaultTraverse expr with
0 commit comments