anomalyco / anomalyco/opencode
[BUG]: No Swift syntax highlighting — highlights.scm from main is incompatible with pinned tree-sitter-swift 0.7.1 wasm
@kommander is already working on this.
Since Sep 2, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
about: Swift files get no syntax highlighting in the TUI because the pinned parser and the fetched highlights query are incompatible
labels: ["bug"]
title: "[BUG]: No Swift syntax highlighting — highlights.scm from main is incompatible with pinned tree-sitter-swift 0.7.1 wasm"
Description
Swift files get no syntax highlighting in the TUI (file views, diffs, code blocks). The TUI silently falls back to plain text.
Root cause: parsers-config.ts pins the Swift parser wasm to tree-sitter-swift 0.7.1 but fetches highlights.scm from the grammar repo's main branch:
{
filetype: "swift",
wasm: "https://github.com/alex-pinkus/tree-sitter-swift/releases/download/0.7.1/tree-sitter-swift.wasm",
queries: {
highlights: [
"https://raw.githubusercontent.com/alex-pinkus/tree-sitter-swift/main/queries/highlights.scm",
],
...
},
}
main's highlights query has drifted from the 0.7.1 parser (e.g. it references a nil_literal node that doesn't exist in 0.7.1), so the query fails to compile and highlighting for the whole language is dropped. I verified this directly with web-tree-sitter 0.25.8:
- wasm 0.7.1 +
main'shighlights.scm→QUERY COMPILE FAILED: Bad node name 'nil_literal' - wasm 0.7.1 +
0.7.1-taggedhighlights.scm→ compiles and matches fine
This is the same wasm/query version-mismatch pattern flagged in review on #43496 ("swift (wasm 0.7.1 vs highlights 0.7.3)"), which is still unfixed on dev as of today.
Suggested fix: pin the highlights query to the 0.7.1 tag (one-line change), or bump the wasm to a release that matches main's queries.
Plugins
none
OpenCode version
1.18.25
Steps to reproduce
- Open any
.swiftfile in the TUI (or view a diff / a```swiftcode block) - Observe the text renders unhighlighted while other languages (Go, Rust, Python, ...) are highlighted
Screenshot and/or share link
n/a
Operating System
macOS 15.5
Terminal
Ghostty
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.