|
From: | Perry Smith |
Subject: | Tree sitter question / problem |
Date: | Fri, 9 Dec 2022 08:20:17 -0600 |
As a result of not knowing what I’m doing, this took me a half a day to figure this out. And I fear it is going to be hard for me to explain things. Feel free to ask me questions. I’m working on ruby-ts-mode and it is patterned mostly after c-ts-mode because I want the versatility. I have this bit of code and it is the content of the comment that is the topic of the email:
I also have this in my ruby-ts-mode--font-lock-settings:
(I understand this is just two snippets of a more complex set up but I’m hoping that c-ts-mode can be reviewed for more context if needed.) The Ruby parser I got from git@github.com:casouri/tree-sitter-module.git and followed the instructions. As the comment states, if I add “false” into the list of keywords, then **none** of the keywords get highlighted. I can understand that “false” doesn’t get highlighted for some reason but having the entire query stop working seems like it might be a bug or at least a weakness that should be addressed. If I turn on treesit-inspect-mode and put the cursor on top of false in a Ruby file, it says only (false) instead of something like (while “while”) that other keyword nodes that do not exhibit this problem show and I’m jumping to the conclusion that that is part of the problem. Perhaps the parser should report (false “false”) but at the same time, it seems rather weak that the whole query stops working. Thank you, Perry p.s. while I know of no other language that is similar to Ruby, I’m adding in the versatility for the mode to be readily adapted to other languages and also has the ability, like c-mode, to easily have different styles. I was never 100% satisfied with existing modes and always wanted to tweak them. I think with the tree sitter concepts, this is going to be much easier and more frequent. |
signature.asc
Description: Message signed with OpenPGP
[Prev in Thread] | Current Thread | [Next in Thread] |