neovim / tree-sitter-vimdoc

Tree-sitter parser for Vim help files
Apache License 2.0
97 stars 13 forks source link

fix: argument in "vim.foo({bar})" #108

Closed justinmk closed 1 year ago

justinmk commented 1 year ago

(Continues https://github.com/neovim/tree-sitter-vimdoc/pull/103 )

Problem: In "vim.foo({bar})", {bar} is not recognized as (argument).

Solution: Add more special-cases for plain (word).

Closes #102

Notes

clason commented 1 year ago

There's still a parse error (but not wrong highlighting) in

(but not in map.txt on |,| anymore 🎉 ).

justinmk commented 1 year ago

There's still a parse error in :h v_aB

Looks like the { in "[count] [{" is causing an error. Could be fixed by changing the " to backticks.

clason commented 1 year ago

Ah, I had assumed that the ERROR node would be rooted at the misparsed node, but you are right. This file (and map.txt) has a bunch of careless quotes that merit cleaning up.

(I have hesitated to touch upstream docs so far, but if it's open season now...)

justinmk commented 1 year ago

This definitely improves things, but also causes a few errors. Will see if those can be avoided with some tweaks.