opencode
opencode copied to clipboard
fix: yaml-ls initialization and bootstrap environment issues
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 innode_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, andschemaStoreby default in the server initialization options.
Verification
- Verified that
yaml-lsnow correctly identifies syntax errors and provides schema-based diagnostics. - Verified that the server spawns correctly using
bun x.
Issue: https://github.com/anomalyco/opencode/issues/7842
With the changes, meaning, LSP working:
Latest OpenCode 1.1.14:
Adding again a new key, with the fix applied: