Feat/initial extension#1
Open
oddcelot wants to merge 5 commits into
Open
Conversation
Runs the official @unocss/language-server for completion, hover, color previews and matched-utility underlining. Auto-installs the server from npm via Zed's bundled Node, honoring a settings binary override.
Author
This was referenced Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds a Zed extension for UnoCSS, backed by the official
@unocss/language-server— completion, hover, color previews, and matched-utility underlining.This is split out of unocss/unocss#5227, which originally bundled the extension together with the server's new
semanticTokenscapability. The server-side change stays in the monorepo as this repo is the standalone extension that consumes it.Why a new extension
There's an existing community extension (
bajrangCoder/zed-unocss), but it relies on a fork of the language server and only attaches toTSX. This one uses the official server and additionally attaches to plainTypeScriptandCSS, so Lit components (class="..."insidehtml`...`in.tsfiles) and stylesheets get completion, hover, and color previews too.What's in here
zed_extension_api) that fetches@unocss/language-serverfrom npm on first use rather than vendoring it, with an offline fallback to an already-installed copy and abinarysettings override for pointing at a local build.lsp.unocss.settingsare wrapped under theunocssnamespace the server expects (unless already nested);initialization_optionsare forwarded too.languageIds, attaching to HTML, CSS, JavaScript, TypeScript, TSX, Vue, Svelte, Astro, Markdown, PHP, ERB (plus Elm/Marko/Pug, which only match when the user has those community language extensions installed).READMEand an example.zed/settings.jsoncovering setup, the Lit.ts/.jspipeline-filter requirement, and the opt-in underline configuration.Underlining matched utilities
The server emits each matched utility as a
unocsssemantic token (an editor-agnostic equivalent of the VSCode underline decoration). As part of this work the server'ssemanticTokensdefault was switched from off to on, so tokens are emitted by default (setunocss.semanticTokens: falseto opt out) — the earlier off-by-default behavior in unocss/unocss#5227 is superseded.Rendering the tokens in Zed is still opt-in on the editor side: enable per-language
semantic_tokens, then add asemantic_token_rulesstyle underglobal_lsp_settingsin user settings. The README documents both steps.Notes for reviewers
unocssID there is currently the community extension, so publishing needs an ID takeover coordinated with the Zed maintainers. For now it installs as a dev extension.extension.tomlauthors/repositorymay want adjusting to the org's preference 🙂Tip
The semantic tokens are quite nice and since this has to be configured in user settings anyway, you can adjust it to your heart's content.
