Repository navigation
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
Nowaker
force-pushed
the
file-languages
branch
from
October 12, 2026 20:45
f885d7e to
d6087eb
Compare
Nowaker
added a commit
to Nowaker/opencode
that referenced
this pull request
Oct 12, 2026
The opencode typecheck failed on the bundled grammar queries since 60edf2a; 8e3a183 declares *.scm, and file-languages (PR anomalyco#54706) is amended with the same declaration. AI-Model: anthropic/claude-opus-5-5 AI-Variant: high AI-Tool: opencode 1.19.0-vt-227-dfb56f76c7 AI-Platform: linux AI-Harness: Vibeterm e6434eb AI-Session-ID: ses_ed1e2b932ffe6tTqhsOiGuYXRE
…ools write, edit and apply_patch color a file by its extension, and many files people edit every day came out plain: no parser was registered for SQL, Dockerfiles, ini/systemd units or HAML, `.sh` files mapped to "shellscript" while the parser is "bash" (likewise Makefiles and Terraform), and extensionless files such as Dockerfile, Gemfile, PKGBUILD or a script with a #! line had no language at all. `detectFiletype` (packages/tui/src/util/filetype.ts) adds file names, dotenv files, ini-style config and systemd/quadlet units, the parser names for shellscript/makefile/terraform, and for a file still unknown the interpreter on its #! line, read from the content or from a diff whose first hunk starts at line 1. write, edit, apply_patch and the permission diff use it; diffs keep their red/green backgrounds with the syntax colors on top. New parsers: erb from the tree-sitter-embedded-template release, with Ruby and HTML injected. SQL, Dockerfile, ini and HAML publish no wasm, so packages/tui/src/parsers bundles builds of them with their highlights queries and licenses, embedded in the binary through file imports; its README names each source commit and the rebuild command. SQL is 2.4 MB, each of the other three under 50 KB. packages/opencode/src/audio.d.ts declares `*.scm` beside `*.wasm`: the opencode program compiles parsers-config.ts without tui's assets.d.ts. A write that is still running already has its whole content, so it now shows as a colored block titled "Writing" instead of one line. `syntax.files: false` in tui.json goes back to extension-only detection.
Nowaker
force-pushed
the
file-languages
branch
from
October 13, 2026 01:14
d6087eb to
e6978e6
Compare
4 of 6 tasks
Nowaker
added a commit
to Nowaker/opencode
that referenced
this pull request
Oct 13, 2026
Heredoc bodies written to systemd, networkd and quadlet files are colored as ini (246c6c1); PRs anomalyco#54705 and anomalyco#54706 amended; vt-259 on desktop and m4max. AI-Model: anthropic/claude-opus-5-5 AI-Variant: high AI-Tool: opencode 1.19.0-vt-227-dfb56f76c7 AI-Platform: linux AI-Harness: Vibeterm 41f09c2 AI-Session-ID: ses_ed1e2b932ffe6tTqhsOiGuYXRE
Author
|
Closing: this targets the v1 TUI, which upstream now maintains for critical fixes only, so it is not going to be merged. The branch stays on Nowaker/opencode if anyone wants to pick it up. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: I'm aware v1 is now the maintenance branch and new features go to v2 only. This PR is here for others to use, and I'll submit the v2 version once I've migrated my whole plugin system to it.
Issue for this PR
Closes #54702
Type of change
What does this PR do?
detectFiletype(util/filetype.ts), used by write, edit, apply_patch and the permission diff: file names (Dockerfile, Containerfile, Makefile, Gemfile, PKGBUILD, shell rc files), dotenv files, ini-style config (.ini,.cfg,.confincluding*.d/drop-ins,.desktop) and systemd units (.service,.socket,.timer,.target,.slice,.scope,.mount,.automount,.swap,.path,.device), networkd (.network,.netdev,.link) and quadlet files (.container,.volume,.pod,.kube,.image,.build), the parser names forshellscript/makefile/terraform, and for a file still unknown the interpreter on its#!line, from the content or a diff whose first hunk starts at line 1. Diffs keep their red/green backgrounds with syntax on top.packages/tui/src/parsersbundles builds with their queries and licenses (embedded via file imports); its README names each source commit and the rebuild command. SQL is 2.4 MB, the other three under 100 KB together.writealready has its whole content, so it shows as a colored block titled "Writing" instead of one line.syntax.files: falsegoes back to extension-only detection. On by default. Documented in tui.mdx.How did you verify your code works?
bun typecheck;bun test test/util test/config.test.tsx test/cli/tui: 137 pass (38 detection cases)..sqldiff and a writtenDockerfilecolored.Screenshots / recordings
CREATE/FROM/RUNkeywords,TEXTtype over the green added-line background:Checklist
This PR is AI generated, but under direct supervision and on request of @Nowaker.