KaranAhlawat / fsharp-ts-mode

A tree-sitter based major mode for F# in Emacs
GNU General Public License v3.0
1 stars 1 forks source link

treesit-query-error, Node type error #4

Open arialdomartini opened 3 weeks ago

arialdomartini commented 3 weeks ago

Hi. Thank you for this mode! I'm really eager to use it, and hopefully, to be able to support its development.

On Emacs 31, no matter which F# file I open, I get the following:

[jsonrpc] Server exited with status 0
Error during redisplay: (jit-lock-function 1) signaled (treesit-query-error 
"Node type error at" 59 "[(line_comment) (block_comment)] 
@font-lock-comment-face (xml_doc) @font-lock-doc-markup-face" 
"Debug the query with `treesit-query-validate'")

Do you have any suggestion where to start investigating?

KaranAhlawat commented 3 weeks ago

Hello! I was really eager about this mode too, but as you can see, development is slow currently (mostly due to my actual work and learning OCaml). Nevertheless, I'd be happy to help you debug your issue.

As the error message suggest, the best place to start is using the treesit-query-validate function. So You copy the line within the quotes, and then run

(treesit-query-validate 'fsharp "[(line_comment) (block_comment)] @font-lock-comment-face (xml_doc) @font-lock-doc-markup-face")

That should give you a precise idea of which node is causing issues.

KaranAhlawat commented 3 weeks ago

I also pushed a commit to main that should fix that issue, and add a decent bit of indentation support using the fsharp-mode package till we can use the tree-sitter based indentation