feat: add yaml language server support by Sam-3Degrees · Pull Request #1345 · anomalyco/opencode · GitHub
Skip to content

feat: add yaml language server support#1345

Closed
Sam-3Degrees wants to merge 2 commits into
anomalyco:devfrom
Sam-3Degrees:dev
Closed

feat: add yaml language server support#1345
Sam-3Degrees wants to merge 2 commits into
anomalyco:devfrom
Sam-3Degrees:dev

Conversation

@Sam-3Degrees

Copy link
Copy Markdown

Summary

  • Add YAML language server support to opencode
  • Enables syntax highlighting, error detection, and schema validation for .yml and .yaml files
  • Uses yaml-language-server via Bun's package runner for automatic installation

Testing

  • ✅ Verified LSP starts correctly: service=lsp.client serverID=yaml starting client and initialized
  • ✅ Tested with multiple YAML file formats (.yml, .yaml)

Fixes

Copilot AI review requested due to automatic review settings July 26, 2025 14:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds YAML language server support to opencode, enabling syntax highlighting, error detection, and schema validation for .yml and .yaml files. The implementation uses yaml-language-server via Bun's package runner for automatic installation.

  • Adds a new YAML language server configuration to the LSP server definitions
  • Configures support for both .yml and .yaml file extensions
  • Uses Bun's package runner to automatically install and run yaml-language-server

Comment thread packages/opencode/src/lsp/server.ts Outdated

Copilot AI Jul 26, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding error handling for the case where yaml-language-server is not available, similar to how the TypeScript language server checks for tsserver existence before spawning the process.

Suggested change
const proc = spawn(BunProc.which(), ["x", "yaml-language-server", "--stdio"], {
const bin = Bun.which("yaml-language-server", {
PATH: process.env["PATH"] + ":" + Global.Path.bin,
})
if (!bin) {
log.error("yaml-language-server is not available. Please install it and try again.")
return
}
const proc = spawn(bin, ["--stdio"], {

Copilot uses AI. Check for mistakes.
Address code review feedback by:
- Check if yaml-language-server binary exists before spawning
- Add informative error message when binary is not found
- Follow same pattern as other language servers in codebase
- Use direct binary path instead of 'bun x' for better reliability

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
@github-actions

github-actions Bot commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot closed this Feb 2, 2026
bussard76 pushed a commit to bussard76/openwork that referenced this pull request May 12, 2026
* fix(i18n): restore missing page translations

* fix(i18n): correct settings locale labels

* fix(dev): avoid reusing another checkout's Vite server

---------

Co-authored-by: src-opn <src-opn@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support YAML language server

2 participants