diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 50da6d0..c1dadf8 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -12,6 +12,7 @@ {"id":"zed-css-variables-foa","title":"Add framework examples and commit artifacts","description":"Add Vue/Svelte/Astro/Ripple examples in example/ and commit existing AGENTS.md + extension.wasm updates","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-03T18:49:36.851219+02:00","created_by":"applesucks","updated_at":"2026-01-03T18:50:32.419325+02:00","closed_at":"2026-01-03T18:50:32.419325+02:00","close_reason":"Added Vue/Svelte/Astro/Ripple examples and committed existing artifacts"} {"id":"zed-css-variables-j5t","title":"Default ignore globs should include /** to avoid scanning vendor dirs","status":"closed","priority":2,"issue_type":"bug","created_at":"2026-01-06T18:48:54.159425+02:00","created_by":"applesucks","updated_at":"2026-01-06T22:00:54.426342+02:00","closed_at":"2026-01-06T22:00:54.426342+02:00","close_reason":"Done"} {"id":"zed-css-variables-qye","title":"Investigate whether completion UI can be styled with CSS","description":"Determine if Zed completion window supports CSS styling or is limited to theme settings.","status":"closed","priority":3,"issue_type":"task","assignee":"applesucks","created_at":"2026-01-03T18:39:02.500207+02:00","created_by":"applesucks","updated_at":"2026-01-03T18:39:34.119615+02:00","closed_at":"2026-01-03T18:39:34.119615+02:00","close_reason":"Zed completion UI is not CSS-styleable; only theme + font settings apply."} +{"id":"zed-css-variables-ult","title":"Allow local Rust LSP binary override","description":"Add a dev override to point the extension at a local css-variable-lsp binary for testing, and rebuild extension.wasm.","status":"closed","priority":2,"issue_type":"task","owner":"putaluta@tuta.io","created_at":"2026-02-01T18:42:44.245131+02:00","created_by":"lmn451","updated_at":"2026-02-01T20:02:53.815069+02:00","closed_at":"2026-02-01T20:02:53.815069+02:00","close_reason":"Added jsLspPath override for local TS LSP"} {"id":"zed-css-variables-vdr","title":"Add command-line flags to control color box display","description":"Implement --no-color-preview and --color-only-variables flags (and CSS_LSP_COLOR_ONLY_VARIABLES env var) to control when color decorations are shown. This allows users to show color boxes only on variable definitions, not on usages.","status":"closed","priority":2,"issue_type":"feature","created_at":"2026-01-01T14:20:42.664382+02:00","updated_at":"2026-01-01T14:22:40.047257+02:00","closed_at":"2026-01-01T14:22:40.047257+02:00"} {"id":"zed-css-variables-vh5","title":"Improve CSS variable completion window size","status":"closed","priority":2,"issue_type":"task","assignee":"applesucks","created_at":"2026-01-03T18:06:24.387975+02:00","created_by":"applesucks","updated_at":"2026-01-03T18:35:59.083014+02:00","closed_at":"2026-01-03T18:35:59.083014+02:00","close_reason":"No Zed setting for completion popup size; only UI/buffer font size affects it."} {"id":"zed-css-variables-xgl","title":"Update README to current state","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-02T18:52:58.240381+02:00","created_by":"applesucks","updated_at":"2026-01-02T18:56:28.390544+02:00","closed_at":"2026-01-02T18:56:28.390544+02:00","close_reason":"Updated README to reflect current Zed extension behavior and pinned LSP version"} diff --git a/.zed/settings.json b/.zed/settings.json new file mode 100644 index 0000000..e138c21 --- /dev/null +++ b/.zed/settings.json @@ -0,0 +1,5 @@ +{ + "lsp": { + "css-variables": {} + } +} diff --git a/CHANGELOG.md b/CHANGELOG.md index e2fa8c8..f856085 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,21 @@ All notable changes to this project will be documented in this file. +## 0.1.0 + +- **Major**: Extension now automatically downloads the latest `css-variable-lsp` release +- Changed `CSS_VARIABLES_RELEASE_TAG` from pinned version (v0.1.6) to "latest" +- GitHub's `/releases/latest/download/` endpoint automatically resolves to the newest release +- Extension fetches the most recent LSP version on each fresh install without extension updates +- Simplified implementation using hardcoded "latest" tag for reliability +- Updated extension version to 0.1.0 + ## 0.0.9 +- Bump `css-variable-lsp` to v0.1.6 +- Add Linux/Windows ARM64 release asset support - Add undefinedVarFallback setting for var() fallback diagnostics -- Document new undefined var fallback flag/env and default -- Rebuild extension.wasm +- Add npm fallback when Rust binary download fails ## 0.0.8 @@ -16,7 +26,8 @@ All notable changes to this project will be documented in this file. ## 0.0.7 -- Updated to `css-variable-lsp` v1.0.12 +- Pinned `css-variable-lsp` to v0.1.5 +- Download prebuilt release assets instead of npm install ## 0.0.6 diff --git a/Cargo.lock b/Cargo.lock index 3a1148f..b604fc5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,74 +2,397 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + [[package]] name = "anyhow" version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" +[[package]] +name = "auditable-serde" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7bf8143dfc3c0258df908843e169b5cc5fcf76c7718bd66135ef4a9cd558c5" +dependencies = [ + "semver", + "serde", + "serde_json", + "topological-sort", +] + [[package]] name = "bitflags" version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" +[[package]] +name = "bumpalo" +version = "3.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "equivalent" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "filetime" +version = "0.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db" +dependencies = [ + "cfg-if", + "libc", + "libredox", +] + +[[package]] +name = "flate2" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b375d6465b98090a5f25b1c7703f3859783755aa9a80433b36e0379a3ec2f369" +dependencies = [ + "crc32fast", + "miniz_oxide", + "zlib-rs", +] + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash", +] + [[package]] name = "hashbrown" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "icu_collections" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" dependencies = [ - "unicode-segmentation", + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" + +[[package]] +name = "icu_properties" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" + +[[package]] +name = "icu_provider" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", ] [[package]] name = "id-arena" -version = "2.2.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] [[package]] name = "indexmap" -version = "2.12.0" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.16.1", "serde", "serde_core", ] [[package]] name = "itoa" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] -name = "leb128" -version = "0.2.5" +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libc" +version = "0.2.180" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" +checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" + +[[package]] +name = "libredox" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616" +dependencies = [ + "bitflags", + "libc", + "redox_syscall", +] + +[[package]] +name = "linux-raw-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" + +[[package]] +name = "litemap" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" [[package]] name = "log" -version = "0.4.28" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "memchr" @@ -77,35 +400,108 @@ version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn", +] + [[package]] name = "proc-macro2" -version = "1.0.103" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.42" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" dependencies = [ "proc-macro2", ] [[package]] -name = "ryu" -version = "1.0.20" +name = "redox_syscall" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +checksum = "49f3fe0889e69e2ae9e41f4d6c4c0181701d00e4697b356fb1f74173a5e0ee27" +dependencies = [ + "bitflags", +] + +[[package]] +name = "rustix" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] [[package]] name = "semver" version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +dependencies = [ + "serde", + "serde_core", +] [[package]] name = "serde" @@ -139,17 +535,29 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.145" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ "itoa", "memchr", - "ryu", "serde", "serde_core", + "zmij", ] +[[package]] +name = "simd-adler32" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" + +[[package]] +name = "slab" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" + [[package]] name = "smallvec" version = "1.15.1" @@ -165,11 +573,17 @@ dependencies = [ "smallvec", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + [[package]] name = "syn" -version = "2.0.110" +version = "2.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a99801b5bd34ede4cf3fc688c5919368fea4e4814a4664359503e6015b280aea" +checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" dependencies = [ "proc-macro2", "quote", @@ -177,16 +591,54 @@ dependencies = [ ] [[package]] -name = "unicode-ident" -version = "1.0.22" +name = "synstructure" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] -name = "unicode-segmentation" -version = "1.12.0" +name = "tar" +version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" +checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tinystr" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "topological-sort" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" + +[[package]] +name = "typed-path" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e43ffa54726cdc9ea78392023ffe9fe9cf9ac779e1c6fcb0d23f9862e3879d20" + +[[package]] +name = "unicode-ident" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" [[package]] name = "unicode-xid" @@ -194,78 +646,123 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "wasm-encoder" -version = "0.201.0" +version = "0.227.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9c7d2731df60006819b013f64ccc2019691deccf6e11a1804bc850cd6748f1a" +checksum = "80bb72f02e7fbf07183443b27b0f3d4144abf8c114189f2e088ed95b696a7822" dependencies = [ - "leb128", + "leb128fmt", + "wasmparser", ] [[package]] name = "wasm-metadata" -version = "0.201.0" +version = "0.227.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fd83062c17b9f4985d438603cde0a5e8c5c8198201a6937f778b607924c7da2" +checksum = "ce1ef0faabbbba6674e97a56bee857ccddf942785a336c8b47b42373c922a91d" dependencies = [ "anyhow", + "auditable-serde", + "flate2", "indexmap", "serde", "serde_derive", "serde_json", "spdx", + "url", "wasm-encoder", "wasmparser", ] [[package]] name = "wasmparser" -version = "0.201.0" +version = "0.227.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84e5df6dba6c0d7fafc63a450f1738451ed7a0b52295d83e868218fa286bf708" +checksum = "0f51cad774fb3c9461ab9bccc9c62dfb7388397b5deda31bf40e8108ccd678b2" dependencies = [ "bitflags", + "hashbrown 0.15.5", "indexmap", "semver", ] +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + [[package]] name = "wit-bindgen" -version = "0.22.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "288f992ea30e6b5c531b52cdd5f3be81c148554b09ea416f058d16556ba92c27" +checksum = "10fb6648689b3929d56bbc7eb1acf70c9a42a29eb5358c67c10f54dbd5d695de" dependencies = [ - "bitflags", "wit-bindgen-rt", "wit-bindgen-rust-macro", ] [[package]] name = "wit-bindgen-core" -version = "0.22.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e85e72719ffbccf279359ad071497e47eb0675fe22106dea4ed2d8a7fcb60ba4" +checksum = "92fa781d4f2ff6d3f27f3cc9b74a73327b31ca0dc4a3ef25a0ce2983e0e5af9b" dependencies = [ "anyhow", + "heck", "wit-parser", ] [[package]] name = "wit-bindgen-rt" -version = "0.22.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb8738270f32a2d6739973cbbb7c1b6dd8959ce515578a6e19165853272ee64" +checksum = "c4db52a11d4dfb0a59f194c064055794ee6564eb1ced88c25da2cf76e50c5621" +dependencies = [ + "bitflags", + "futures", + "once_cell", +] [[package]] name = "wit-bindgen-rust" -version = "0.22.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a39a15d1ae2077688213611209849cad40e9e5cccf6e61951a425850677ff3" +checksum = "9d0809dc5ba19e2e98661bf32fc0addc5a3ca5bf3a6a7083aa6ba484085ff3ce" dependencies = [ "anyhow", "heck", "indexmap", + "prettyplease", + "syn", "wasm-metadata", "wit-bindgen-core", "wit-component", @@ -273,11 +770,12 @@ dependencies = [ [[package]] name = "wit-bindgen-rust-macro" -version = "0.22.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d376d3ae5850526dfd00d937faea0d81a06fa18f7ac1e26f386d760f241a8f4b" +checksum = "ad19eec017904e04c60719592a803ee5da76cb51c81e3f6fbf9457f59db49799" dependencies = [ "anyhow", + "prettyplease", "proc-macro2", "quote", "syn", @@ -287,9 +785,9 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.201.0" +version = "0.227.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "421c0c848a0660a8c22e2fd217929a0191f14476b68962afd2af89fd22e39825" +checksum = "635c3adc595422cbf2341a17fb73a319669cc8d33deed3a48368a841df86b676" dependencies = [ "anyhow", "bitflags", @@ -306,9 +804,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.201.0" +version = "0.227.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196d3ecfc4b759a8573bf86a9b3f8996b304b3732e4c7de81655f875f6efdca6" +checksum = "ddf445ed5157046e4baf56f9138c124a0824d4d1657e7204d71886ad8ce2fc11" dependencies = [ "anyhow", "id-arena", @@ -322,21 +820,156 @@ dependencies = [ "wasmparser", ] +[[package]] +name = "writeable" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" + +[[package]] +name = "xattr" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" +dependencies = [ + "libc", + "rustix", +] + +[[package]] +name = "yoke" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + [[package]] name = "zed-css-variables" -version = "0.0.8" +version = "0.1.0" dependencies = [ "anyhow", + "flate2", + "serde_json", + "tar", "zed_extension_api", + "zip", ] [[package]] name = "zed_extension_api" -version = "0.0.6" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca8bcaea3feb2d2ce9dbeb061ee48365312a351faa7014c417b0365fe9e459" +checksum = "0729d50b4ca0a7e28e590bbe32e3ca0194d97ef654961451a424c661a366fca0" dependencies = [ "serde", "serde_json", "wit-bindgen", ] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zip" +version = "7.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c42e33efc22a0650c311c2ef19115ce232583abbe80850bc8b66509ebef02de0" +dependencies = [ + "crc32fast", + "flate2", + "indexmap", + "memchr", + "typed-path", + "zopfli", +] + +[[package]] +name = "zlib-rs" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40990edd51aae2c2b6907af74ffb635029d5788228222c4bb811e9351c0caad3" + +[[package]] +name = "zmij" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfcd145825aace48cff44a8844de64bf75feec3080e0aa5cdbde72961ae51a65" + +[[package]] +name = "zopfli" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05cd8797d63865425ff89b5c4a48804f35ba0ce8d125800027ad6017d2b5249" +dependencies = [ + "bumpalo", + "crc32fast", + "log", + "simd-adler32", +] diff --git a/Cargo.toml b/Cargo.toml index e6a7eab..af12107 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zed-css-variables" -version = "0.0.8" +version = "0.1.0" edition = "2021" license = "GPL-3.0" @@ -9,4 +9,8 @@ crate-type = ["cdylib"] [dependencies] anyhow = "1" -zed_extension_api = "0.0.*" +zed_extension_api = "0.7" +serde_json = "1.0" +flate2 = "1.1.8" +tar = "0.4.44" +zip = { version = "7.2.0", default-features = false, features = ["deflate"] } diff --git a/PUBLISHING.md b/PUBLISHING.md index 5aba399..ed2bc63 100644 --- a/PUBLISHING.md +++ b/PUBLISHING.md @@ -3,10 +3,11 @@ ## Pre-Publishing Checklist ✅ **Version Updated** -- [x] `extension.toml` version: 0.0.9 +- [x] `extension.toml` version: 0.1.0 - [x] CHANGELOG.md updated with release notes ✅ **Code Quality** + - [x] All tests passing (`cargo test --lib`) - [x] Integration tests passing (`./test_extension.sh`) - [x] Clean install test passing (`./test_clean_install.sh`) @@ -16,6 +17,7 @@ **Note:** All tests validate the extension works correctly without requiring Docker. ✅ **Documentation** + - [x] README.md updated with latest features - [x] Installation instructions clear - [x] Development setup documented @@ -23,12 +25,14 @@ - [x] Known limitations documented ✅ **Extension Configuration** -- [x] `npm:install` capability declared -- [x] LSP version: css-variable-lsp@latest +- [x] `download_file` capability declared (primary: Rust binary) +- [x] `npm:install` fallback available +- [x] LSP version: css-variable-lsp latest (auto-resolved via GitHub API) / latest (npm fallback) - [x] Extension metadata complete (name, description, repository) - [x] License specified (GPL-3.0) ✅ **Git & Repository** + - [x] All changes committed - [ ] Changes pushed to GitHub - [ ] Git tags created for version @@ -38,60 +42,77 @@ ### Method 1: Via Zed Extension Marketplace (Recommended) 1. **Ensure you're logged in to Zed** + - Open Zed - Sign in with your GitHub account 2. **Publish the extension** - - The Zed team reviews extensions submitted via GitHub - - Extensions are typically published from the repository - -3. **Repository Requirements** - - Public GitHub repository ✅ - - Valid `extension.toml` ✅ - - Valid `extension.wasm` ✅ - - Clear README ✅ + - Open Extensions panel (Cmd+Shift+X) + - Click on the installed dev extension + - Click "Publish" (if available) -### Method 2: Manual Distribution +### Method 2: Via zed-industries/extensions Repository -Users can install directly from the repository: +1. **Fork the extensions repository** -1. Clone the repository -2. Build the extension (see README.md) -3. In Zed: Extensions → Install Dev Extension → Select directory + ```bash + git clone https://github.com/zed-industries/extensions + cd extensions + ``` -## Post-Publishing +2. **Add your extension as a submodule** -- [ ] Test installation from marketplace -- [ ] Verify LSP auto-installation works -- [ ] Check that all features work in fresh installation -- [ ] Monitor for user feedback and issues -- [ ] Update documentation if needed + ```bash + git submodule add https://github.com/lmn451/css-variables-zed extensions/css-variables + ``` -## Updating the Extension +3. **Create a pull request** + - Push your fork + - Open PR against zed-industries/extensions -When releasing a new version: +## Version Bumping Process 1. Update version in `extension.toml` -2. Update CHANGELOG.md -3. Run all tests -4. Build and update `extension.wasm` -5. Commit changes with descriptive message -6. Push to GitHub -7. Create a git tag: `git tag v0.0.X && git push origin v0.0.X` - -## Release Checklist for v0.0.9 -- [x] Updated to css-variable-lsp@1.0.5-beta.1 -- [x] Added npm:install capability -- [x] Created comprehensive test suite -- [x] Updated documentation -- [x] All tests passing -- [x] Code committed -- [ ] Code pushed to GitHub -- [ ] Create git tag v0.0.9 -- [ ] Submit to Zed extension marketplace - -## Contact & Support - -- **Repository**: https://github.com/lmn451/css-variables-zed -- **Issues**: https://github.com/lmn451/css-variables-zed/issues -- **License**: GPL-3.0 +2. Update CHANGELOG.md with release notes +3. Rebuild WASM: + ```bash + cargo build --release --target wasm32-wasip1 + cp target/wasm32-wasip1/release/zed_css_variables.wasm extension.wasm + ``` +4. Run tests: + ```bash + cargo test --lib + ./test_extension.sh + ./test_clean_install.sh + ``` +5. Commit and tag: + ```bash + git add -A + git commit -m "release: v0.0.X" + git tag v0.0.X + git push && git push --tags + ``` + +## Testing Before Publish + +```bash +# Run all tests +cargo test --lib +./test_extension.sh +./test_clean_install.sh + +# Test in Zed +# 1. Open Zed +# 2. Extensions → Install Dev Extension +# 3. Select this directory +# 4. Open a project with CSS files +# 5. Verify completions, hover, go-to-definition work +``` + +## Rollback Process + +If issues are discovered after publishing: + +1. Revert to previous version in `extension.toml` +2. Rebuild and republish +3. Document issue in CHANGELOG.md diff --git a/README.md b/README.md index 6dbec9f..57f1980 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,9 @@ Project-wide CSS custom properties (variables) support for Zed, powered by `css- 3. Search for "CSS Variables" 4. Click Install -On first use (and whenever a newer version is available), the extension installs the latest `css-variable-lsp` via Zed's `npm:install` capability using Zed's built-in Node.js runtime. No manual Node.js or npm setup is required. +On first use, the extension downloads a prebuilt `css-variable-lsp` release asset and caches it in +the extension working directory. If the download fails, it falls back to the npm package via Zed's +built-in Node.js runtime. No manual Node.js or npm setup is required. ## Configuration @@ -47,6 +49,12 @@ Provided lists replace the defaults (include any defaults you still want). `undefinedVarFallback` controls diagnostics when a `var(--name, fallback)` has an undefined variable; supported values are `warning` (default), `info`, and `off`. +Binary resolution order (first match wins): +1) `lsp.css-variables.binary.path` (can point to a local dev build) +2) Download the pinned Rust release asset and cache it +3) `css-variable-lsp` in PATH +4) Fall back to npm package `css-variable-lsp` + Defaults: - `lookupFiles`: @@ -79,7 +87,7 @@ include `/**` at the end (for example `**/dist/**`). ### NPM Package Version (Optional) -To opt into beta releases, set `npmVersion` in the same `settings` object: +To opt into beta releases (used only when falling back to npm), set `npmVersion` in the same `settings` object: ```json { @@ -93,10 +101,6 @@ To opt into beta releases, set `npmVersion` in the same `settings` object: } ``` -Defaults to `latest`. You can also provide an explicit version string (e.g. `1.0.14-beta.3`). -When set to a dist-tag like `beta`, the extension attempts to install that tag on startup to keep it current. -If npm is unavailable, it falls back to the already installed version. - ## LSP Flags & Environment The extension launches `css-variable-lsp` with `--color-only-variables` and `--stdio`. @@ -144,9 +148,8 @@ Defaults: - `**/out/**` - `**/.git/**` -Zed forwards `cssVariables.lookupFiles` as repeated `--lookup-file` flags, -`cssVariables.blacklistFolders` as repeated `--ignore-glob` flags, and -`cssVariables.undefinedVarFallback` as `--undefined-var-fallback`. +Zed forwards `cssVariables.lookupFiles` as repeated `--lookup-file` flags and +`cssVariables.blacklistFolders` as repeated `--ignore-glob` flags. ### Completion Path Examples @@ -168,7 +171,6 @@ Assume a variable is defined in `/Users/you/project/src/styles/theme.css` and yo ### Prerequisites - Rust with `wasm32-wasip1` target: `rustup target add wasm32-wasip1` -- Node.js and npm (for testing only) ### Building @@ -189,7 +191,7 @@ cargo test --lib # Run integration tests ./test_extension.sh -# Run clean installation test (validates npm package installation) +# Run clean installation test (validates download capability) ./test_clean_install.sh ``` @@ -199,12 +201,31 @@ cargo test --lib 2. Open Zed -> Extensions -> Install Dev Extension 3. Select this directory +### Using a Local LSP Build + +To test a local build of `css-lsp-rust`, set `binary.path` in your settings: + +```json +{ + "lsp": { + "css-variables": { + "binary": { + "path": "/path/to/css-lsp-rust/target/debug/css-variable-lsp" + } + } + } +} +``` + ## Known Limitations - Cascade resolution is best-effort; the LSP does not model DOM nesting or selector combinators. - Rename operations replace full declarations/usages and may adjust formatting. -### Latest: v0.0.9 -- Adds `undefinedVarFallback` to control diagnostics for `var()` fallbacks -- Documents the undefined-var fallback flag/env defaults +### Latest: v0.1.0 + +- Pins `css-variable-lsp` to v0.1.6 +- Adds Linux/Windows ARM64 release asset support +- Adds `undefinedVarFallback` setting for var() fallback diagnostics +- Downloads a prebuilt release asset on first run, falls back to npm if needed - Runs the server with `--color-only-variables` by default diff --git a/example/index.html b/example/index.html index 428d8a2..8fccff7 100644 --- a/example/index.html +++ b/example/index.html @@ -10,6 +10,7 @@ :root { background-color: var(--primary); --secondary-color: #f0f0f0; + color: var(--accent-2); } diff --git a/example/index.svelte b/example/index.svelte index 6df2b77..03e8f46 100644 --- a/example/index.svelte +++ b/example/index.svelte @@ -2,13 +2,15 @@ :root { --svelte-color: #2563eb; --svelte-bg: #dbeafe; + --asdf: 2px; } .panel { padding: 1rem; border-radius: 0.5rem; color: var(--svelte-color); - background: var(--svelte-bg); + background: var(--asdf); + border-color: var(--asdf); } diff --git a/example/index.vue b/example/index.vue index d6c84fc..22940bf 100644 --- a/example/index.vue +++ b/example/index.vue @@ -1,7 +1,10 @@ -