Skip to content

Commit

Permalink
Add support for webassembly text format (helix-editor#4040)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrvidal authored and pathwave committed Nov 4, 2022
1 parent 99a6835 commit abc6771
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
2 changes: 2 additions & 0 deletions book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
| vala || | | `vala-language-server` |
| verilog ||| | `svlangserver` |
| vue || | | `vls` |
| wast || | | |
| wat || | | |
| wgsl || | | `wgsl_analyzer` |
| xit || | | |
| yaml || || `yaml-language-server` |
Expand Down
22 changes: 22 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.wat"
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.wast"
comment-token = ";;"
file-types = ["wast"]
roots = []

[[grammar]]
name = "wast"
source = { git = "https://github.com/wasm-lsp/tree-sitter-wasm", rev = "2ca28a9f9d709847bf7a3de0942a84e912f59088", subpath = "wast" }
21 changes: 21 additions & 0 deletions runtime/queries/wast/highlights.scm
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
17 changes: 17 additions & 0 deletions runtime/queries/wat/highlights.scm
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

["(" ")"] @punctuation.bracket

0 comments on commit abc6771

Please sign in to comment.