|
| 1 | +import sqlWasm from "./parsers/sql/tree-sitter-sql.wasm" with { type: "file" } |
| 2 | +import sqlHighlights from "./parsers/sql/highlights.scm" with { type: "file" } |
| 3 | +import dockerfileWasm from "./parsers/dockerfile/tree-sitter-dockerfile.wasm" with { type: "file" } |
| 4 | +import dockerfileHighlights from "./parsers/dockerfile/highlights.scm" with { type: "file" } |
| 5 | +import iniWasm from "./parsers/ini/tree-sitter-ini.wasm" with { type: "file" } |
| 6 | +import iniHighlights from "./parsers/ini/highlights.scm" with { type: "file" } |
| 7 | +import hamlWasm from "./parsers/haml/tree-sitter-haml.wasm" with { type: "file" } |
| 8 | +import hamlHighlights from "./parsers/haml/highlights.scm" with { type: "file" } |
| 9 | +import hamlInjections from "./parsers/haml/injections.scm" with { type: "file" } |
| 10 | + |
| 11 | +const erbInjections: Record<string, string> = { code: "ruby", content: "html" } |
| 12 | +const hamlInjectionNodes: Record<string, string> = { ruby_code: "ruby", ruby_attributes: "ruby" } |
| 13 | + |
1 | 14 | export default { |
2 | 15 | // NOTE: FOR markdown, javascript and typescript, we use the opentui built-in parsers |
3 | 16 | // Warn: when taking queries from the nvim-treesitter repo, make sure to include the query dependencies as well |
@@ -382,5 +395,44 @@ export default { |
382 | 395 | ], |
383 | 396 | }, |
384 | 397 | }, |
| 398 | + { |
| 399 | + filetype: "erb", |
| 400 | + wasm: "https://github.com/tree-sitter/tree-sitter-embedded-template/releases/download/v0.25.0/tree-sitter-embedded_template.wasm", |
| 401 | + queries: { |
| 402 | + highlights: [ |
| 403 | + "https://raw.githubusercontent.com/tree-sitter/tree-sitter-embedded-template/v0.25.0/queries/highlights.scm", |
| 404 | + ], |
| 405 | + injections: [ |
| 406 | + "https://raw.githubusercontent.com/tree-sitter/tree-sitter-embedded-template/v0.25.0/queries/injections-erb.scm", |
| 407 | + ], |
| 408 | + }, |
| 409 | + injectionMapping: { |
| 410 | + nodeTypes: erbInjections, |
| 411 | + }, |
| 412 | + }, |
| 413 | + // No release of these grammars publishes a wasm build, so ./parsers bundles one (see its README). |
| 414 | + { |
| 415 | + filetype: "sql", |
| 416 | + wasm: sqlWasm, |
| 417 | + queries: { highlights: [sqlHighlights] }, |
| 418 | + }, |
| 419 | + { |
| 420 | + filetype: "dockerfile", |
| 421 | + wasm: dockerfileWasm, |
| 422 | + queries: { highlights: [dockerfileHighlights] }, |
| 423 | + }, |
| 424 | + { |
| 425 | + filetype: "ini", |
| 426 | + wasm: iniWasm, |
| 427 | + queries: { highlights: [iniHighlights] }, |
| 428 | + }, |
| 429 | + { |
| 430 | + filetype: "haml", |
| 431 | + wasm: hamlWasm, |
| 432 | + queries: { highlights: [hamlHighlights], injections: [hamlInjections] }, |
| 433 | + injectionMapping: { |
| 434 | + nodeTypes: hamlInjectionNodes, |
| 435 | + }, |
| 436 | + }, |
385 | 437 | ], |
386 | 438 | } |
0 commit comments