HiPhish / rainbow-delimiters.nvim

Rainbow delimiters for Neovim with Tree-sitter
https://gitlab.com/HiPhish/rainbow-delimiters.nvim
Apache License 2.0
533 stars 39 forks source link

feat(fsharp): add F# support #35

Open SoxPopuli opened 1 year ago

SoxPopuli commented 1 year ago

Adds queries for F# files.

Treesitter doesn't have a grammar for F# files by default, but one can be installed from this repo. As far as I am aware, this is the only actively developed custom grammar for F# so the chances of people installing the wrong grammar should be minimal, that being said, I would understand if you were to reject this PR on those grounds.

You should be able to run the test file directly using the dotnet F# repl: dotnet fsi <path-to-file>

Danielkonge commented 10 months ago

To be able to add the F# queries, they will be need to be updated to the new syntax.

For the first one you commented out, something like this might work?

(argument_patterns
  "(" @delimiter
  ("(" ")")*
  ")" @delimiter @sentinel
) @container

(It depends on how the F# parser's tree structure looks, and I haven't checked it.)