From a5564f730efec60317aced036b4dacdc0850bb3d Mon Sep 17 00:00:00 2001 From: Jake Nelson Date: Tue, 18 Nov 2025 14:53:03 +1100 Subject: [PATCH] feat: add Swift syntax highlighting support (#4434) --- packages/opencode/parsers-config.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/opencode/parsers-config.ts b/packages/opencode/parsers-config.ts index ef149524..e63323d7 100644 --- a/packages/opencode/parsers-config.ts +++ b/packages/opencode/parsers-config.ts @@ -212,5 +212,19 @@ export default { ], }, }, + { + filetype: "swift", + wasm: "https://github.com/alex-pinkus/tree-sitter-swift/releases/download/0.7.1/tree-sitter-swift.wasm", + queries: { + highlights: [ + // NOTE: Using parser repo queries instead of nvim-treesitter due to incompatible #lua-match? predicates + // "https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/highlights.scm + "https://raw.githubusercontent.com/alex-pinkus/tree-sitter-swift/main/queries/highlights.scm", + ], + locals: [ + "https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/swift/locals.scm", + ], + }, + }, ], }