Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e6b8b2d
refactor(language-core): add package manager fallback detection
withxat Apr 24, 2026
c9e210b
refactor(language-service): support nested config fallbacks
withxat Apr 24, 2026
41d29a8
feat(zed): add dev extension launcher
withxat Apr 24, 2026
8baf11f
refactor(language-service): preserve editor-specific ux
withxat Apr 24, 2026
e922aaa
refactor(workspace): adopt package-manager-detector fallback
withxat Apr 24, 2026
a4ef65d
refactor(language-server): unify package manager detection
withxat Apr 27, 2026
3601a47
chore(language-server): align detector dependency placement
withxat Apr 27, 2026
bd342c7
refactor(language-server): use client feature flags
withxat Apr 27, 2026
5723821
fix(language-service): use unicode hover icons outside vscode
withxat Apr 27, 2026
fea3872
refactor(language-service): rename markdown icons option
withxat Apr 27, 2026
2fe4301
style(language-service): use emoji hover icons
withxat Apr 27, 2026
e94126d
refactor(language-service): simplify config lookup
withxat Apr 27, 2026
07e5986
docs: update zed extension readmes
withxat Apr 27, 2026
fc8da4e
feat: polish the implementation
withxat Apr 27, 2026
eaae9c3
chore(zed): mark extension crate private
withxat May 7, 2026
a4311c0
feat(zed): pass client feature initialization options
withxat May 7, 2026
91eebca
fix(language-server): use detector subpath import
withxat May 7, 2026
8e6b4eb
fix(language-service): remove duplicate inlay hint spacing
withxat May 7, 2026
b53f855
feat: sync version with vscode extension
withxat May 8, 2026
c751f50
ci(workflows): add zed release workflows
withxat May 8, 2026
aaca028
ci(release): sync zed versions during bump
withxat May 8, 2026
9fe8e0c
chore(zed): align version and add license
withxat May 8, 2026
5ae5306
ci(workflows): simplify release triggers
withxat May 8, 2026
4e5451d
docs(workflows): clarify zed publish TODOs
withxat May 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/publish-language-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish Language Server

on:
push:
tags:
- v*

jobs:
publish-language-server:
permissions:
contents: write

runs-on: ubuntu-slim
steps:
- name: Setup JS
uses: sxzz/workflows/setup-js@69098296b6f6083ed99f38e2040f2a7238580e27 # v1.4.0
with:
fetch-all: true

- name: Build
run: pnpm build

- name: Verify language server version
run: |
expected_version="${GITHUB_REF_NAME#v}"
actual_version="$(sed -n 's/^ \"version\": \"\(.*\)\",$/\1/p' packages/language-server/package.json | head -n 1)"
if [ "$actual_version" != "$expected_version" ]; then
echo "Expected packages/language-server/package.json version $expected_version but found $actual_version"
exit 1
fi

- name: Pack language server
working-directory: packages/language-server
run: pnpm pack

- name: Rename tarball
working-directory: packages/language-server
run: mv npmx-language-server-*.tgz "npmx-language-server-${GITHUB_REF_NAME#v}.tgz"

- name: Upload language server tarball
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.0.8
with:
files: packages/language-server/npmx-language-server-*.tgz
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Publish Extension
name: Publish VS Code Extension

on:
push:
tags:
- v*
# TODO: Restore this trigger after these Zed release changes are merged to the main branch.
# push:
# tags:
# - v*
workflow_dispatch:
Comment on lines +4 to +8
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Do not merge with tag publishing disabled unless this is intentionally permanent.

Line 4–Line 8 remove automatic tag-triggered publishing, which can silently halt VS Code release automation on v* tags. If this is temporary, gate it behind a short-lived branch-only change or restore the trigger before merge.


jobs:
publish-extension:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/publish-zed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish Zed Extension

on:
push:
tags:
- v*

jobs:
publish-zed-extension:
permissions:
contents: write

runs-on: ubuntu-slim
steps:
- name: Setup JS
uses: sxzz/workflows/setup-js@69098296b6f6083ed99f38e2040f2a7238580e27 # v1.4.0
with:
fetch-all: true

- name: Verify Zed extension version
run: |
expected_version="${GITHUB_REF_NAME#v}"
actual_version="$(sed -n 's/^version = \"\(.*\)\"$/\1/p' extensions/zed/extension.toml | head -n 1)"
if [ "$actual_version" != "$expected_version" ]; then
echo "Expected extensions/zed/extension.toml version $expected_version but found $actual_version"
exit 1
fi

- name: Update Zed extensions registry
uses: huacnlee/zed-extension-action@v2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

# Check if the file exists and read the relevant section
if [ -f .github/workflows/publish-zed.yml ]; then
  echo "=== File exists, reading lines 20-40 for context ==="
  sed -n '20,40p' .github/workflows/publish-zed.yml | cat -n
  echo ""
  echo "=== Full workflow file ==="
  cat -n .github/workflows/publish-zed.yml
else
  echo "File not found"
fi

Repository: npmx-dev/vscode-npmx

Length of output: 2566


🏁 Script executed:

# Check other workflow files to understand pinning patterns in the repo
echo "=== Searching for action usage patterns across all workflows ==="
find .github/workflows -name "*.yml" -o -name "*.yaml" | while read f; do
  echo "--- File: $f ---"
  rg "uses:" "$f" | head -20
done

Repository: npmx-dev/vscode-npmx

Length of output: 1127


Pin the Zed publish action to a commit SHA.

Line 30 uses a mutable tag (@v2) whilst all other actions in the repository (across six workflows) are pinned to commit SHAs. Update to a specific commit digest to maintain consistency with repository security practices and reduce supply-chain risk in release workflows.

with:
extension-name: npmx
# TODO: Update this to the correct fork before enabling automated publishing.
push-to: withxat/issue-zed-extensions
env:
# TODO: Add the COMMITTER_TOKEN secret before enabling automated publishing.
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
Comment on lines +33 to +37
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Do not keep placeholder publishing config in an active tag-triggered workflow.

Line 33–Line 37 still point to a temporary fork and TODO token setup while Line 4–Line 6 already publish on v* tags. This can publish to the wrong destination or fail releases; disable the trigger until final push-to and secrets are ready.

8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
| Package | Description |
| ------- | ----------- |
| [`extensions/vscode`](./extensions/vscode) | [VS Code extension](https://marketplace.visualstudio.com/items?itemName=npmx-dev.vscode-npmx) for npmx |
| [`extensions/zed`](./extensions/zed) | Zed extension for npmx, backed by the shared language server |
| [`packages/shared`](./packages/shared) | Shared constants, types, and LSP protocol definitions |
| [`packages/language-core`](./packages/language-core) | Core logic: extractors, API clients, workspace context |
| [`packages/language-service`](./packages/language-service) | Volar language service plugins (hover, completion, diagnostics, etc.) |
| [`packages/language-server`](./packages/language-server) | Volar language server |

## Features

- **Hover Information** – Quick links to package details and documentation on [npmx.dev](https://npmx.dev), with provenance verification status.
- **Hover Information** – Quick links to package details and documentation on [npmx.dev](https://npmx.dev), with provenance verification status. VS Code uses codicons, while other editors use emoji icons.
- **Version Completion** – Autocomplete package versions with provenance filtering and prerelease exclusion support.
- **Workspace-Aware Resolution** – Dependencies in `package.json`, `pnpm-workspace.yaml`, and `.yarnrc.yml` are resolved from a shared workspace context, including npm, pnpm, yarn, and bun package managers plus root `package.json` catalogs and workspace references.
- **Diagnostics**
Expand All @@ -36,6 +37,11 @@
- Open [npmx.dev](https://npmx.dev) in external browser
- Open `node_modules` files on [npmx.dev](https://npmx.dev) code viewer with syntax highlighting (from editor title, editor context menu, explorer context menu, or command palette)

## Editor Support

- **VS Code** – Primary extension package with hover, completion, diagnostics, document links, catalog decorations, code actions, and commands.
- **Zed** – In-repo development extension using the same language server over stdio. It supports the shared LSP features and forwards `lsp.npmx.settings` as `npmx` workspace configuration.

## Related

- [npmx.dev](https://npmx.dev) – A fast, modern browser for the npm registry
Expand Down
11 changes: 8 additions & 3 deletions extensions/vscode/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { LanguageClient, TransportKind } from '@volar/vscode/node'
import { DEPENDENCY_FILE_GLOB } from 'npmx-language-core/constants'
import { displayName, extensionId } from 'npmx-shared/meta'
import { Hover, MarkdownString } from 'vscode'
import { registerRequests } from './request'

const SUPPORTED_LANGUAGES = [
'javascript',
Expand Down Expand Up @@ -68,12 +67,18 @@ export function launch(serverPath: string) {
synchronize: {
configurationSection: [displayName],
},
initializationOptions: {
npmx: {
clientFeatures: {
catalogInlayHints: false,
iconStyle: 'codicon',
},
},
},
diagnosticCollectionName: displayName,
outputChannelName: `${displayName} Language Server`,
},
)

registerRequests(client)

return { client, ready: client.start() }
}
25 changes: 0 additions & 25 deletions extensions/vscode/src/request.ts

This file was deleted.

3 changes: 3 additions & 0 deletions extensions/zed/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/target
/extension.wasm
/Cargo.lock
13 changes: 13 additions & 0 deletions extensions/zed/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "zed-npmx"
version = "0.7.0"
edition = "2021"
license = "MIT"
publish = false

[lib]
crate-type = [ "cdylib" ]

[dependencies]
serde_json = "1"
zed_extension_api = "0.7.0"
Comment thread
withxat marked this conversation as resolved.
21 changes: 21 additions & 0 deletions extensions/zed/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Xat

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
84 changes: 84 additions & 0 deletions extensions/zed/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# npmx for Zed

This is the in-repo Zed extension for `npmx`. It runs the shared `npmx-language-server`
over stdio, so Zed gets the same core package intelligence used by the VS Code extension.

## Status

- Uses the shared `npmx-language-server`
- Targets local development from this monorepo first
- Defaults to `packages/language-server/dist/index.cjs`
- Launches the language server over `--stdio`
- Supports overriding the launched command through Zed `lsp.npmx.binary` settings
- Forwards `lsp.npmx.settings` to the language server as `npmx` workspace configuration

## Features

- Hover links to package pages and docs on [npmx.dev](https://npmx.dev)
- Emoji hover icons for non-VS Code editors
- Version completion with provenance and prerelease settings
- Diagnostics for upgrades, deprecations, replacements, vulnerabilities, dist tags, and engine mismatches
- Document links for package names
- Workspace-aware dependency resolution for npm, pnpm, yarn, and bun projects

## Local Development

1. Build the language server from the repo root with `pnpm build`.
2. In Zed, install `extensions/zed` as a dev extension.
3. If you want a custom launch command, configure `lsp.npmx.binary` in your Zed settings.

## Settings

Zed settings under `lsp.npmx.settings` are forwarded directly to the language server.
Use scoped npmx settings without the leading `npmx.` prefix:

```json
{
"lsp": {
"npmx": {
"settings": {
"hover": {
"enabled": true
},
"completion": {
"version": "provenance-only",
"excludePrerelease": true
},
"diagnostics": {
"upgrade": true,
"deprecation": true,
"replacement": true,
"vulnerability": true,
"distTag": true,
"engineMismatch": true
},
"packageLinks": "declared"
}
}
}
}
```

To override the launched language server command:

```json
{
"lsp": {
"npmx": {
"binary": {
"path": "node",
"arguments": [
"/absolute/path/to/vscode-npmx/packages/language-server/dist/index.cjs",
"--stdio"
]
}
}
}
}
```

## Notes

- Zed dev extensions require Rust installed via `rustup`; the Zed docs explicitly call out that Homebrew Rust will not work for dev extension compilation.
- This dev extension expects the repo-local language server bundle at `packages/language-server/dist/index.cjs`, so build the monorepo before installing it in Zed.
- If you override `lsp.npmx.binary`, make sure the launched server process still receives an LSP transport argument such as `--stdio`.
34 changes: 34 additions & 0 deletions extensions/zed/extension.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
id = "npmx"
name = "npmx"
description = "npmx language support for Zed"
version = "0.7.0"
schema_version = 1
authors = [ "Xat <i@xat.sh>" ]
repository = "https://github.com/npmx-dev/vscode-npmx/tree/main/extensions/zed"

[language_servers.npmx]
name = "npmx"
languages = [
"JSON",
"YAML",
"JavaScript",
"JSX",
"TypeScript",
"TSX",
"HTML",
"Vue",
"Astro",
"Svelte"
]

[language_servers.npmx.language_ids]
JSON = "json"
YAML = "yaml"
JavaScript = "javascript"
JSX = "javascriptreact"
TypeScript = "typescript"
TSX = "typescriptreact"
HTML = "html"
Vue = "vue"
Astro = "astro"
Svelte = "svelte"
Loading