tree-sitter-vim
tree-sitter-vim copied to clipboard
fix(ranges): parse ranges for all command
'<,'>s/foo/bar errors:
(script_file [0, 0] - [1, 0]
(range_statement [0, 0] - [0, 5]
start: (mark [0, 0] - [0, 2])
end: (mark [0, 3] - [0, 5]))
(ERROR [0, 5] - [0, 14]
(marker_definition [0, 7] - [0, 14])))
after:
(script_file [0, 0] - [1, 0]
(unknown_builtin_statement [0, 0] - [0, 14]
start: (mark [0, 0] - [0, 2])
end: (mark [0, 3] - [0, 5])
(unknown_command_name [0, 5] - [0, 6])
(arguments [0, 6] - [0, 14]
(command_argument [0, 6] - [0, 14]))))
I don't know if parsing ranges before all commands has issues though.
Please commit the generated parser.c (and other files).
I forgot to make them optional ...
I forgot to make them optional ...
I ran into another problem, since the ending ("/") in range marks were optional statements that used an range in pattern ranges would result in errors. ( and commands also in my case)
/acall/
(script_file [0, 0] - [1, 0]
(range_statement [0, 0] - [0, 2]
start: (pattern [0, 1] - [0, 2]))
(ERROR [0, 2] - [0, 6]))
I think they were optional because range statements don't need to end, which is why i kept _range for range statements and made a new _complete_range for commands and statements.
~~I am running make and nothing is changing, and the artifact seems related to matchparen?~~
Never mind i missed the drop down.
Hey @clason i have 2 questions. Should i rebase this off of fix_ci ? I want to add a query for ranges do i add it in this pr or do i open another one?