cursorless-dev / vscode-parse-tree

Syntax trees for VSCode using tree-sitter
MIT License
40 stars 35 forks source link

xml Tree sitter parser fails on `<?` #74

Closed AndreasArvidsson closed 3 weeks ago

AndreasArvidsson commented 6 months ago

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

pokey commented 6 months ago

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

AndreasArvidsson commented 6 months ago

I tried it as well and got this error image

I guess we should file an issue then?

AndreasArvidsson commented 6 months ago

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

AndreasArvidsson commented 6 months ago

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

ObserverOfTime commented 5 months ago

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

pokey commented 3 weeks ago

I can confirm this issue is fixed. Thanks!

pokey commented 3 weeks ago

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 commented 3 weeks ago

this is now released in vscode-parse-tree 0.31.0

AndreasArvidsson commented 3 weeks ago

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