Skip to content

Add CUE language support via cue lsp#1474

Merged
MischaPanch merged 9 commits into
oraios:mainfrom
freeformz:ffz/add-cue-language-support
May 18, 2026
Merged

Add CUE language support via cue lsp#1474
MischaPanch merged 9 commits into
oraios:mainfrom
freeformz:ffz/add-cue-language-support

Conversation

@freeformz
Copy link
Copy Markdown
Contributor

@freeformz freeformz commented May 11, 2026

Adds support for the CUE configuration language via the LSP mode of the official cue CLI (cue lsp, introduced in recent cue releases).

Summary

  • Language server: CueLanguageServer using LanguageServerDependencyProviderSinglePath. The cue binary is auto-downloaded from cue-lang/cue GitHub releases and SHA-256-verified for linux-x64/arm64, darwin-x64/arm64, and win-x64/arm64. Default pinned version: v0.16.1. Users can override the binary via ls_specific_settings.cue.ls_path (pre-installed cue, e.g. from Homebrew or go install) or pin a different release via ls_specific_settings.cue.cue_version.
  • Protocol detail: cue lsp issues a workspace/configuration request to the client during startup and blocks until it gets a reply. The implementation registers a handler returning empty config objects per requested item.
  • Registration: Language.CUE (.cue extension), factory case in src/solidlsp/ls.py, pytest marker cue in pyproject.toml and test/conftest.py.
  • Test repo (test/resources/repos/cue/test_repo/): a three-file CUE module rooted at cue.mod/ that exercises:
    • Definitions (#Person, #Greeting, #BuildGreeting) in schema.cue and lib.cue.
    • Concrete values (alice, greetingForAlice, locale) in main.cue.
    • Cross-file references between all three files.
    • The repo parses cleanly with cue vet and evaluates with cue export.
  • Tests (test/solidlsp/cue/test_cue_basic.py): 8 tests covering LS startup, hierarchical document symbols, full symbol tree, cross-file definitions, and within/cross-file references. Line/char positions were captured from real cue lsp v0.16.1 responses and asserted exactly.
  • Docs: README language list, docs/01-about/020_programming-languages.md, and CHANGELOG.md.

Verification

  • All 8 cue tests pass locally (macOS arm64).
  • poe lint and poe type-check clean.
  • No CI install step needed: the dependency provider auto-downloads the binary on first run (~10 MB, fast).

Notes

Happy to adjust naming, version-pinning convention, initialization options, or anything else.

freeformz and others added 2 commits May 11, 2026 13:40
Adds a CueLanguageServer implementation driven by the LSP mode of the
official `cue` CLI (`cue lsp`), introduced in recent cue releases.

- Auto-downloads the `cue` binary from cue-lang/cue GitHub releases
  (SHA-256-verified) for linux-x64/arm64, darwin-x64/arm64, and
  win-x64/arm64; `ls_specific_settings.cue.ls_path` overrides with a
  pre-installed binary.
- Handles the `workspace/configuration` request that cue lsp issues
  during startup (without a reply, cue blocks before servicing requests).
- Registers `Language.CUE` (.cue extension), adds pytest marker `cue`,
  and wires the LS factory.
- Adds a three-file test repo rooted at `cue.mod/` exercising
  cross-file definitions, references, and hierarchical document
  symbols; 8 basic tests assert exact line/char positions captured
  from cue lsp v0.16.1.
- Updates README, programming-languages doc, and CHANGELOG.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add a comment next to the pinned SHA256 dicts showing how to regenerate
  them from `gh release view`'s `assets[].digest` field, mirroring the
  guidance that taplo / pascal carry.
- Note in the class docstring that overriding `cue_version` to an
  unpinned version skips SHA256 verification (since only the bundled
  versions have known checksums), so it should be paired with `ls_path`
  for integrity — matches the convention used by ada.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@freeformz freeformz marked this pull request as ready for review May 11, 2026 21:13
Copy link
Copy Markdown
Contributor

@MischaPanch MischaPanch left a comment

Choose a reason for hiding this comment

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

Thanks, almost good to be merged. Pls address the minor comments and solve the merge conflict in the readme

Comment thread src/solidlsp/language_servers/cue_language_server.py Outdated
Comment thread src/solidlsp/ls_config.py Outdated
freeformz and others added 3 commits May 17, 2026 16:06
Adds a CueLanguageServer implementation driven by the LSP mode of the
official `cue` CLI (`cue lsp`), introduced in recent cue releases.

- Auto-downloads the `cue` binary from cue-lang/cue GitHub releases
  (SHA-256-verified) for linux-x64/arm64, darwin-x64/arm64, and
  win-x64/arm64; `ls_specific_settings.cue.ls_path` overrides with a
  pre-installed binary.
- Handles the `workspace/configuration` request that cue lsp issues
  during startup (without a reply, cue blocks before servicing requests).
- Registers `Language.CUE` (.cue extension), adds pytest marker `cue`,
  and wires the LS factory.
- Adds a three-file test repo rooted at `cue.mod/` exercising
  cross-file definitions, references, and hierarchical document
  symbols; 8 basic tests assert exact line/char positions captured
  from cue lsp v0.16.1.
- Updates README, programming-languages doc, and CHANGELOG.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add a comment next to the pinned SHA256 dicts showing how to regenerate
  them from `gh release view`'s `assets[].digest` field, mirroring the
  guidance that taplo / pascal carry.
- Note in the class docstring that overriding `cue_version` to an
  unpinned version skips SHA256 verification (since only the bundled
  versions have known checksums), so it should be paired with `ls_path`
  for integrity — matches the convention used by ada.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Drop the INITIAL_CUE_VERSION / INITIAL_CUE_SHA256_BY_PLATFORM pair and
  collapse _cue_sha to the single DEFAULT_* path. The INITIAL_* concept
  exists in other LSes purely for backwards compatibility with their
  pre-existing legacy unversioned install dir; CUE is brand new, so the
  unversioned-dir reservation has no users to preserve. Every install
  now goes into a versioned `cue-<version>` subdir.
- Drop the docstring under Language.CUE in ls_config.py; other entries
  in the enum (e.g. PYTHON, RUST, GO) don't carry one either.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@freeformz freeformz force-pushed the ffz/add-cue-language-support branch from b4e751f to acf8dd7 Compare May 17, 2026 23:10
@freeformz freeformz requested a review from MischaPanch May 17, 2026 23:36
freeformz and others added 3 commits May 18, 2026 09:29
…support

Resolves README.md conflict in the supported-languages list by combining
CUE (this branch) with GDScript and Svelte (origin/main).
Reconciles local merge of origin/main with the latest PR review feedback
(commits d034ad8 and acf8dd7). Conflicts resolved:

- src/solidlsp/ls_config.py: keep the PR-side decision to drop the
  Language.CUE docstring (commit acf8dd7).
- src/solidlsp/language_servers/cue_language_server.py: take the PR-side
  version that collapses the INITIAL_CUE_VERSION/INITIAL_CUE_SHA256_BY_PLATFORM
  pair (commit acf8dd7).
- CHANGELOG.md: drop the duplicate CUE entry that lived in v1.5.0 from
  the original feature branch (origin/main now has the canonical CUE entry
  earlier in the same section); preserve the new Memories/CLI/Tools
  sections from origin/main.
@MischaPanch MischaPanch merged commit ffd5dfd into oraios:main May 18, 2026
7 of 8 checks passed
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.

2 participants