-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add smali language support #9089
Conversation
runtime/queries/smali/injections.scm
Outdated
@@ -0,0 +1 @@ | |||
(comment) @comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(comment) @comment | |
((comment) @injection.content | |
(#set! injection.language "comment")) |
we follow tree-sitter for injections https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection, nvim has its own injection format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the change as suggested, and this reminded me to check goto_next_comment
which I found doesn't work.
tree-sitter-subtree does report (comment)
for comment lines, so I don't know what to check beyond that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For that functionality you'll want to look into adding textobjects queries: https://docs.helix-editor.com/master/guides/textobject.html
runtime/queries/smali/indents.scm
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look like nvim indent queries. See https://docs.helix-editor.com/master/guides/indent.html for writing Helix ones
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok I did my best! smali does not use indentation too much (it's basically just a text representation of dalvik bytecode with gotos for control flow). But I checked the behavior with this example with the most indentation I could find and it seems correct:
.method public static updateDigest(Ljava/security/MessageDigest;Ljava/io/File;)V
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
No description provided.