vscode-parse-tree icon indicating copy to clipboard operation
vscode-parse-tree copied to clipboard

xml Tree sitter parser fails on `<?`

Open AndreasArvidsson opened this issue 2 years ago • 5 comments

File starting with <? fails with error: image

<?xml version="1.0" encoding="UTF-8"?>
<root>
</root>

There is some weirdness where that even if you comment this line you have to reload the vscode window until the parser starts working again. On the other hand if you load the language without this line and then added it appears to be working, but the range of the first node after <?...?> becomes incorrect.

The parser we are using is tested for this so I do wonder if we are doing something incorrectly with our implementation. https://github.com/ObserverOfTime/tree-sitter-xml/blob/master/tree-sitter-xml/test/corpus/standard.txt

AndreasArvidsson avatar Dec 09 '23 12:12 AndreasArvidsson

Their parser has tests for it, as you mention, but the tests generally don't run on the wasm version, and when I tried their wasm version on its own, I got an error message

pokey avatar Dec 09 '23 14:12 pokey

I tried it as well and got this error image

I guess we should file an issue then?

AndreasArvidsson avatar Dec 10 '23 07:12 AndreasArvidsson

This might be a related issue. The error message looks similar enough https://github.com/tree-sitter/tree-sitter/issues/2610

AndreasArvidsson avatar Dec 10 '23 07:12 AndreasArvidsson

The problem appears to be that resolveSymbol("isalnum") returns undefined. .apply is then called on that undefined value

AndreasArvidsson avatar Dec 10 '23 07:12 AndreasArvidsson

Can you check if ObserverOfTime/tree-sitter-xml@b1b5a3e solves the issue?

ObserverOfTime avatar Jan 26 '24 11:01 ObserverOfTime

I can confirm this issue is fixed. Thanks!

pokey avatar Jun 11 '24 17:06 pokey

oh actually didn't realise this issue was on our repo rather than tree-sitter-xml. I'll leave this open here until we bump to the newer tree-sitter-xml, but I have it working on a branch so I'm confident the issue is fied in tree-sitter-xml

pokey avatar Jun 11 '24 17:06 pokey

this is now released in vscode-parse-tree 0.31.0

pokey avatar Jun 14 '24 09:06 pokey

Tested and working. Finally I can use Cursorless together with maven!

AndreasArvidsson avatar Jun 14 '24 10:06 AndreasArvidsson