neovim / tree-sitter-vimdoc

Tree-sitter parser for Vim help files

Repository from Github https://github.comneovim/tree-sitter-vimdocRepository from Github https://github.comneovim/tree-sitter-vimdoc

Argument in some functions is not recognized if not preceded by whitespace

clason opened this issue · comments

Consider

vim.foo({bar})

Tree:

(block) ; [1:1 - 2:0]
 (line) ; [1:1 - 2:0]
  (word) ; [1:1 - 14]

But

vim.foo( {bar})

Tree:

(block) ; [1:1 - 2:0]
 (line) ; [1:1 - 2:0]
  (word) ; [1:1 - 8]
  (argument) ; [1:10 - 14]
   text: (word) ; [1:11 - 13]
  (word) ; [1:15 - 15]

Needless to say, that affects much of our docs.

Works fine without the dot, though:

nvim_foo({bar})

Tree:

(block) ; [1:1 - 2:0]
 (line) ; [1:1 - 2:0]
  (word) ; [1:1 - 9]
  (argument) ; [1:10 - 14]
   text: (word) ; [1:11 - 13]
  (word) ; [1:15 - 15]

But only for the first argument; if there are more arguments and these are not preceded by whitespace (as is usual), these don't get caught:

nvim_foo({bar},{baz})

Tree:

(block) ; [1:1 - 2:0]
 (line) ; [1:1 - 2:0]
  (word) ; [1:1 - 9]
  (argument) ; [1:10 - 14]
   text: (word) ; [1:11 - 13]
  (word) ; [1:15 - 21]