You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: LANGUAGE_EXTENSIONS map has bare makefile key and is missing common extensions #15859
The LANGUAGE_EXTENSIONS map in packages/opencode/src/lsp/language.ts has two problems:
Bare makefile key (bug): Line 58 has makefile: "makefile" — the only entry without a leading dot. Since path.extname() always returns dot-prefixed strings (e.g. .mk), this key never matches anything. The adjacent .makefile entry is also wrong since no files have a .makefile extension.
Missing extensions: Several file extensions supported by built-in formatters (formatter.ts) are absent from the language map, meaning LSP features won't activate for those file types:
C/C++ headers: .h, .hpp, .hxx, .hh, .h++ (used by clang-format)
Python stubs: .pyi (used by ruff)
R uppercase: .R (used by air formatter)
Config/data: .toml, .jsonc (used by prettier/biome)
Markup: .mdx (used by prettier/biome)
GraphQL: .graphql, .gql (used by prettier/biome)
OpenCode version
1.2.15 (current dev branch)
Steps to reproduce
Open a .h or .hpp file — LSP won't detect the language
Open a .toml or .graphql file — same issue
Look at language.ts line 58 — bare makefile key never matches
The current issue is broader (also covering the bare makefile key bug and other missing extensions), so it may make sense to reference or consolidate with that existing issue.
Still reproducible on 1.18.30 (Windows, "lsp": true): the .jsonc entry named in this issue is still missing from LANGUAGE_EXTENSIONS, and the effect is silence, not an error.
Mechanism
.jsonc is absent from LANGUAGE_EXTENSIONS, so the didOpenlanguageId falls back to "plaintext". Biome's built-in server does list .jsonc in its extensions (so opencode routes the file to Biome), but Biome emits no diagnostics for languageId: "plaintext" — the file silently skips diagnostics.
Set "lsp": true in ~/.config/opencode/opencode.jsonc.
Create a directory that contains a Biome root marker (e.g. package-lock.json).
Write two files with identical bytes — broken.json and broken.jsonc:
{
"a": 1,
"b":
}
Write each and read the tool result's <diagnostics> block.
Expected vs actual
Expected: both .json and .jsonc report the parse error. Actual: only .json reports; .jsonc produces no diagnostics for that file.
Verbatim tool output after writing broken.json:
LSP errors detected in this file, please fix:
<diagnostics file="...\jsonc-bug-probe\broken.json">
ERROR [4:1] Expected an array, an object, or a literal but instead found '}'.
</diagnostics>
Writing broken.jsonc (same bytes, same directory) produced no<diagnostics> block for it.
Independent check that the server can parse it: the same .jsonc bytes report error[biome] (parse) at 4:0: Expected an array, an object, or a literal but instead found '}'. when routed through oh-my-openagent's own lsp_diagnostics path — so Biome handles .jsonc; only opencode's languageId is wrong.
Proposed fix
Add the missing entries to LANGUAGE_EXTENSIONS, at minimum:
".jsonc": "jsonc",
plus the other omissions already listed in this issue (.toml, .mdx, .pyi, .h/.hpp/.hh/.hxx/.h++, .R, and the bare makefile key).
Activity
github-actions commentedon Mar 3, 2026
This issue might be a duplicate of existing issues. Please check:
LANGUAGE_EXTENSIONSThe current issue is broader (also covering the bare
makefilekey bug and other missing extensions), so it may make sense to reference or consolidate with that existing issue.xiong-ZH-zq commentedon Mar 22, 2026
+1, It would be helpful if support R LSP
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
Bearmancer commentedon Sep 13, 2026
Still reproducible on 1.18.30 (Windows,
"lsp": true): the.jsoncentry named in this issue is still missing fromLANGUAGE_EXTENSIONS, and the effect is silence, not an error.Mechanism
.jsoncis absent fromLANGUAGE_EXTENSIONS, so thedidOpenlanguageIdfalls back to"plaintext". Biome's built-in server does list.jsoncin itsextensions(so opencode routes the file to Biome), but Biome emits no diagnostics forlanguageId: "plaintext"— the file silently skips diagnostics.Source at
dev:packages/opencode/src/lsp/language.ts:1—export const LANGUAGE_EXTENSIONS: Record<string, string> = {packages/opencode/src/lsp/language.ts:53—".json": "json",— and no.jsonckey anywhere in the mappackages/opencode/src/lsp/client.ts:560—const languageId = LANGUAGE_EXTENSIONS[extension] ?? "plaintext"Steps to reproduce
"lsp": truein~/.config/opencode/opencode.jsonc.package-lock.json).broken.jsonandbroken.jsonc:{ "a": 1, "b": }<diagnostics>block.Expected vs actual
Expected: both
.jsonand.jsoncreport the parse error.Actual: only
.jsonreports;.jsoncproduces no diagnostics for that file.Verbatim tool output after writing
broken.json:Writing
broken.jsonc(same bytes, same directory) produced no<diagnostics>block for it.Independent check that the server can parse it: the same
.jsoncbytes reporterror[biome] (parse) at 4:0: Expected an array, an object, or a literal but instead found '}'.when routed through oh-my-openagent's ownlsp_diagnosticspath — so Biome handles.jsonc; only opencode'slanguageIdis wrong.Proposed fix
Add the missing entries to
LANGUAGE_EXTENSIONS, at minimum:plus the other omissions already listed in this issue (
.toml,.mdx,.pyi,.h/.hpp/.hh/.hxx/.h++,.R, and the baremakefilekey).Environment: opencode
1.18.30· Windows · pluginoh-my-openagent 4.19.4· verified2026-09-13.Bearmancer commentedon Sep 13, 2026
Environment (software)
~/.local/share/opencode/log/opencode.log·~/.omo/agent/OmO-debug.log·~/.omo/agent/logs/config-reload.logOS facts collected with:
No hardware, hostname, username, or credentials included.