opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix: yaml-ls initialization and bootstrap environment issues

Open processtrader opened this issue 1 week ago • 3 comments

Summary

This PR fixes the yaml-ls language server which was failing to initialize due to incorrect executable paths and restrictive root detection.

Changes

YAML LSP (yaml-ls)

  • Provisioning Strategy: Switched from hardcoded JS paths to bun x yaml-language-server --stdio. This ensures the server works reliably by using the package manager to resolve the binary, avoiding "file not found" errors caused by version-specific path changes in node_modules.
  • Root Detection: Added support for common YAML project files (.yamllint, kustomization.yaml, docker-compose.yaml) to correctly identify workspace roots in non-Node.js projects.
  • Default Configuration: Enabled completion, hover, validation, and schemaStore by default in the server initialization options.

Verification

  • Verified that yaml-ls now correctly identifies syntax errors and provides schema-based diagnostics.
  • Verified that the server spawns correctly using bun x. image

Issue: https://github.com/anomalyco/opencode/issues/7842

With the changes, meaning, LSP working:

image

Latest OpenCode 1.1.14:

image

Adding again a new key, with the fix applied:

image image

processtrader avatar Jan 05 '26 20:01 processtrader