ionide / FsAutoComplete

F# language server using Language Server Protocol
Other
389 stars 151 forks source link

`SyntaxTraversal.Traverse` → `ParsedInput.tryPick` (etc.) #1241

Closed brianrourkeboll closed 4 months ago

brianrourkeboll commented 4 months ago

Note: while SyntaxCollectorBase + walkAst could also theoretically be replaced by ParsedInput.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 using ParsedInput.tryNode, except that I discovered that FCS doesn't actually call dive/pick for patterns (like it does for expressions and other node types) and uses List.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.

baronfel commented 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.

baronfel commented 4 months ago

Thanks again @brianrourkeboll - this looks awesome :)

nojaf commented 4 months ago

Great work @brianrourkeboll!