Closed brianrourkeboll closed 4 months ago
Holy smokes these look amazing. THANK YOU for taking the time to port us over to the new API - its already much cleaner and easier to follow what some of the matches are trying to do.
Thanks again @brianrourkeboll - this looks awesome :)
Great work @brianrourkeboll!
SyntaxTraversal.Traverse
/SyntaxVisitorBase<_>
API to one of the analogous APIs added to FCS in https://github.com/dotnet/fsharp/pull/16462 — usuallyParsedInput.tryPick
, occasionally alsoParsedInput.tryNode
orParsedInput.tryPickLast
.ParsedInput.tryPick
.Note: while
SyntaxCollectorBase
+walkAst
could also theoretically be replaced byParsedInput.fold
, I have not done so in this PR.[^1]: The one usage I didn't update is
tryGetExplicitTypeInfo
— this would in theory actually be quite easy to solve usingParsedInput.tryNode
, except that I discovered that FCS doesn't actually calldive
/pick
for patterns (like it does for expressions and other node types) and usesList.tryPick
instead, which means that the deepest matching pattern is not always returned. I may try to see if that's something that can be fixed in FCS.