-
-
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 support for webassembly text format #4040
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1781,3 +1781,25 @@ language-server = { command = "bass", args = ["--lsp"] } | |
[[grammar]] | ||
name = "bass" | ||
source = { git = "https://github.com/vito/tree-sitter-bass", rev = "501133e260d768ed4e1fd7374912ed5c86d6fd90" } | ||
|
||
[[language]] | ||
name = "wat" | ||
scope = "source.webassembly" | ||
comment-token = ";;" | ||
file-types = ["wat"] | ||
roots = [] | ||
|
||
[[grammar]] | ||
name = "wat" | ||
source = { git = "https://github.com/wasm-lsp/tree-sitter-wasm", rev = "2ca28a9f9d709847bf7a3de0942a84e912f59088", subpath = "wat" } | ||
|
||
[[language]] | ||
name = "wast" | ||
scope = "source.webassembly" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The scopes are the same between these two. I think wat could be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've tentatively set this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could use |
||
comment-token = ";;" | ||
file-types = ["wast"] | ||
roots = [] | ||
|
||
[[grammar]] | ||
name = "wast" | ||
source = { git = "https://github.com/wasm-lsp/tree-sitter-wasm", rev = "2ca28a9f9d709847bf7a3de0942a84e912f59088", subpath = "wast" } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
; inherits: wat | ||
|
||
[ | ||
"assert_return" | ||
"assert_trap" | ||
"assert_exhaustion" | ||
"assert_malformed" | ||
"assert_invalid" | ||
"assert_unlinkable" | ||
"assert_trap" | ||
|
||
"invoke" | ||
"get" | ||
|
||
"script" | ||
"input" | ||
"output" | ||
|
||
"binary" | ||
"quote" | ||
] @keyword |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
["module" "func" "param" "result" "type" "memory" "elem" "data" "table" "global"] @keyword | ||
|
||
["import" "export"] @keyword.control.import | ||
|
||
["local"] @keyword.storage.type | ||
|
||
[(name) (string)] @string | ||
|
||
(identifier) @function | ||
|
||
[(comment_block) (comment_line)] @comment | ||
|
||
[(nat) (float) (align_offset_value)] @constant.numeric.integer | ||
|
||
(value_type) @type | ||
jrvidal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
["(" ")"] @punctuation.bracket |
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 think it would make more sense to call this
webassembly
, but it seems that this name determines the symbol that will be imported from the grammer dynamic library, and that's fixed totree_sitter_wat
.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.
@the-mikedavis Do you think it'd be worth separating a human-readable name from the symbol name for tree sitter? I could do that in a subsequent PR.
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.
There's an issue along those lines: #3164
It would only be a cosmetic improvement for the file-type statusline element though