Skip to content

KCL extension for Zed - #13567

Open
bcorey wants to merge 3 commits into
mainfrom
bcorey/zed-extension
Open

KCL extension for Zed#13567
bcorey wants to merge 3 commits into
mainfrom
bcorey/zed-extension

Conversation

@bcorey

@bcorey bcorey commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

I had codex write a Zed extension wrapper around the KCL LSP. Jon pointed out we could better organize the directories associated with the LSP and clients, so that's been rolled into this PR as well.

Testing

Zed
I installed this extension in Zed as a "dev extension". At first it was reporting all errors twice. This has been fixed by preventing the lsp server from reporting errors on both push and pull interactions with the server. VSCode client had to be tested as well to validate this didn't break things over there.

  1. Used "Install dev extension" on the extensions page.
  2. selected the modeling-app/rust/kcl-lsp-zed-client folder
  3. Normally the extension pulls the latest LSP release. Overrode with the local build to get the error reporting fix included.
  4. tested "format buffer" command
  5. tested syntax error detection

VSCode

  1. built lsp client & server
  2. installed from VSIX
  3. configured extension to point at the lsp server binary
  4. tested "format document"
  5. tested syntax error detection

Questions

  • Zed extension works without configuring an API key. is it reading my ZOO_API_KEY env variable automatically or is no key needed?
  • does anything here look dissimilar to how we do things for our vscode extension?

After Merging

This extension needs to be added to the official extension library once, after which it seems hands-off on our end. The extension will pull the latest KCL LSP release automatically.

  1. fork https://github.com/zed-industries/extensions
  2. add this repo as an HTTPS submodule
git submodule add \
  https://github.com/KittyCAD/modeling-app.git \
  extensions/zoo-kcl
  1. Add this to the registry's extensions.toml
[zoo-kcl]
submodule = "extensions/zoo-kcl"
path = "rust/kcl-language-server/zed"
version = "0.1.3"
  1. run pnpm sort-extensions
  2. open a PR

@bcorey
bcorey requested review from a team as code owners September 1, 2026 17:50
@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
modeling-app Ready Ready Preview Sep 1, 2026 7:59pm UTC

Request Review

@codspeed-hq

codspeed-hq Bot commented Sep 1, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 151 untouched benchmarks
⏩ 126 skipped benchmarks1


Comparing bcorey/zed-extension (21ae5e1) with main (8ba70e6)2

Open in CodSpeed

Footnotes

  1. 126 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (30c939d) during the generation of this report, so 8ba70e6 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@adamchalmers

Copy link
Copy Markdown
Contributor

KCL lib will indeed read your API key from $ZOO_API_TOKEN, if it's set. Might want to let the extension take some sort of configuration to read the API key from somewhere else too.

@bcorey
bcorey force-pushed the bcorey/zed-extension branch from c1dd597 to 21ae5e1 Compare September 1, 2026 19:50
@bcorey

bcorey commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Updated the main comment to note the folder reorganization effort and the test process for both vscode and zed clients. Includes a fix to keep the LSP server from reporting errors on both push and pull interactions.

@bcorey

bcorey commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

/modeling-app/rust/kcl-lsp-server/benches/lsp_semantic_tokens_benchmark_criterion.rs got rolled into my diff during refactors. It seems to have been recently introduced on main, but let me know if it looks out of place after the folder reorg. @adamchalmers

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.

3 participants