GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — docs(rfc): Vite+ Project Detection for Editor Extensions by fengmk2 · Pull Request #1614 · voidzero-dev/vite-plus

Conversation

@fengmk2

@fengmk2 fengmk2 commented May 18, 2026

Copy link
Copy Markdown
Member

Summary

Draft RFC defining how the four oxc editor extensions — oxc-vscode, oxc-zed, oxc-intellij-plugin, coc-oxc — determine whether a workspace is a Vite+ project and which vp executable to spawn for --lsp. This is the prerequisite identified in #1557 for removing the per-package bin/oxlint / bin/oxfmt wrappers.

Core rule

A workspace is Vite+ iff some walked-up package.json directly declares vite-plus in dependencies or devDependencies (bounded by the workspace root). The runnable vp binary is resolved separately, also bounded by the workspace root, and validated against a real vite-plus package (name === "vite-plus").

Detector returns a tri-state:

  • null — not Vite+; editor uses plain oxlint/oxfmt.
  • { root, vpPath } — Vite+ and runnable; editor launches vp lint --lsp / vp fmt --lsp.
  • { root } — declared but not yet installed (fresh clone, Berry PnP, broken install); editor falls back to plain oxlint/oxfmt and never spawns a bare vp.

A transitively hoisted node_modules/vite-plus/, a global vp, a vp on \$PATH, and a configured oxc.<tool>.binPath all return null by construction.

Distribution

  • oxc-vscode and coc-oxc consume a shared bundled-devDependency npm package (proposed @voidzero-dev/detect-vite-plus) at packages/detect-vite-plus/.
  • oxc-zed (Rust/WASM) and oxc-intellij-plugin (Kotlin) port the same algorithm against the shared conformance fixtures inside this RFC.

Status

Draft for discussion. Open points called out in the RFC:

  • Final package name.
  • Caching policy in editor consumers.
  • "Declared but not installed" UX (silent fallback vs. install hint).
  • Workspace-root marker parity gap with vite-task (recognized as a known follow-up; deliberately not blocked on).

Refs #1557

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jong-kyung reacted with rocket emoji
All reactions
  • 🚀 1 reaction
@fengmk2 fengmk2 self-assigned this May 18, 2026
@netlify

netlify Bot commented May 18, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

✅ Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 1ee71c2
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a0fd46701fc760008d57063
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sysix
Sysix reviewed May 18, 2026
View reviewed changes
Comment thread rfcs/editor-extension-vite-plus-detection.md
Comment on lines +35 to +37
`dependencies` or `devDependencies`. A `node_modules/vite-plus/`
directory on its own does not qualify — that could be a transitive
install hoisted from an unrelated dependency tree.

@Sysix Sysix May 18, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

A `node_modules/vite-plus/` directory on its own does not qualify — that could be a transitive install hoisted from an unrelated dependency tree.

I am not sure if vite-plus will ever be a dependency of another package. My naive brain does not like this.
VS Code Extension searched for package.json and tries to find node_modules/.bin/xyz.
Opening the package-file, transforming it to JSON, and checking its properties, will be done by every package.json it will find.
On a monorepo this could be expensive. 🤔

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@fengmk2 fengmk2 May 19, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I have considered this issue. If we do not read package.json to determine but instead judge by checking node_modules/vite-plus, there will be an unavoidable problem: if vite-plus is indirectly introduced by a dependency of the project through dependencies or peerDependencies, and it is installed using npm install, vite-plus will be hoisted to node_modules/vite-plus due to the hoisting mechanism, which will lead us to incorrectly determine the current project as Vite+.

If this check is only executed once during the vscode startup phase, the performance should be acceptable?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Sysix Sysix May 19, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

If this check is only executed once during the vscode startup phase, the performance should be acceptable?

The startup is already effected by the package.json search for sub-packages. On a big project this could take over 1 second.
I can accept this performance cost. I have plans to "delay" to search to not block the extension activation.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@nrayburn-tech nrayburn-tech May 20, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I don't think this is a one time problem for startup only. I think it has to be performed every time a file is opened (at least, that's a naive but simple approach).

If I open <repo>/packages/app1/index.ts then I have to check everything from the app1 folder all the way up to the system root until I find something matching the required criteria. If I then open <repo>/packages/app1/something/index.ts I have to do that same check again from something all the way up to the system root until I find something matching the required criteria.
The number of lookups may be mitigated with some more complex strategies (caching, file watchers, etc.).


I'm pretty sure the IntelliJ plugin uses the naive approach today. Anytime a file is opened, search upwards until we find what that plugin considers a root.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread rfcs/editor-extension-vite-plus-detection.md Outdated
Comment on lines +64 to +66
Both phases stop AT the workspace root and never cross into its
parent. The walk-up bound is what prevents a nested checkout from
inheriting an unrelated parent's Vite+ install.

@Sysix Sysix May 18, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Some users will open only a sub-package of a monorepo. Vite-plus from the root will not be detected.
Note: VS Code Extension does search outside the root (beside require.resolve), because mostly they are using Nested Multi Root Workspaces. But we should make sure setups like this will detect vite-plus

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@fengmk2 fengmk2 May 19, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Some users will open only a sub-package of a monorepo

In this case, will there be similar issues with the search for the oxlint bin? When the sub-package does not depend on oxlint, but only the root workspace depends on oxlint.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Sysix Sysix May 19, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Does require.resolve not resolves this correctly 🤔 The problem is for oxlint too :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread rfcs/editor-extension-vite-plus-detection.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread rfcs/editor-extension-vite-plus-detection.md
`<vite-plus>/bin/oxlint` to `<vite-plus>/bin/vp`, update launch
args.

## Conformance fixtures

@Sysix Sysix May 18, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

What happens for workspaces where the root package.json does include oxlint, and only a sub-package includes vite-plus?
Should we prefer the vite-plus from the sub-package, even if other packages will use the roots oxlint?
Maybe related: oxc-project/oxc-vscode#145

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@fengmk2 fengmk2 May 19, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

In this case, if VS Code opens the root workspace, it won’t be treated as a Vite+ project. We also plan to provide a capability similar to #1456: ship a rule via Vite+’s built-in oxlint plugin to prevent mixing oxlint and vite-plus within the same monorepo.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sysix reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread rfcs/editor-extension-vite-plus-detection.md Outdated
Comment on lines +284 to +289
1. **Publish the detector as a shared npm package?** The current
proposal is `@voidzero-dev/detect-vite-plus` at
`packages/detect-vite-plus/`, consumed as a bundled devDependency
by `oxc-vscode` and `coc-oxc`. The alternative is to let each
Node-capable extension copy the ~50-line snippet directly.
Decision deferred to the maintainers.

@Sysix Sysix May 18, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The package makes sense for me. But I am not sure if this will be useful for other editors as they don't have JS runtime and needs to recreate it anyway by hand.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@fengmk2 fengmk2 May 19, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I think coc-oxc can also use this package too, it seem to support Node.js runtime https://github.com/oxc-project/coc-oxc/blob/main/src/common.ts

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sysix reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread rfcs/editor-extension-vite-plus-detection.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread rfcs/editor-extension-vite-plus-detection.md Outdated
Comment on lines +137 to +139
- `$PATH`, user's global `node_modules`, or
`oxc.<tool>.binPath` settings (the last is for oxlint/oxfmt, not
`vp`).

@Sysix Sysix May 18, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I would like to search for global node_modules and $PATH variable too.
Users want a global editor formatter, which they can use without forcing the repo-dependency.

VP-Users needs to know that oxfmt is used and manual install it globally.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@fengmk2 fengmk2 May 19, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

For Vite+ projects, this might not be possible. If the project doesn't have a dependency on vite-plus, the oxc IDE extension probably won't recognize it as a Vite+ project, and therefore won't look for the vp binary in the global path.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Sysix Sysix May 19, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

We need to be careful, formatting in editor is very common. It should work every time, if possible.

IDE extension probably won't recognize it as a Vite+ project

Then it should not find oxlint & oxfmt too, and fallback to global search. Here we can search for vite-plus first, and then fallback to oxlint?

Scenario A:
User opens a project where no formatter or linter is installed. It is an old project where he edits one or two files every year. He still wants the formatting capability of the editor without creating a new setup.

Scenario B:
User opens a single file, there is no workspace/root concept anymore. The extension should fall back to globally installed packages, to allow users to format the file (with the default config).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

fengmk2 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@fengmk2 fengmk2 May 22, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Indeed, if it has been clearly determined that the current project is a Vite+ project, then it is necessary to search globally to see if the vp bin exists. Let me make a modification.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread rfcs/editor-extension-vite-plus-detection.md Outdated
| `bin-vp-orphan` | Declared in root `package.json`, but `node_modules/vite-plus/` is broken (missing `package.json`, wrong `name`, or unparseable) | `{ root: "<repo>" }` — install rejected as orphan |
| `parent-vite-plus-nested-repo` | Outer dir declares + installs `vite-plus`; inner subdir is its own workspace root and does not | From inside the nested workspace: `null` |
| `plain-non-vite-plus` | A normal Node project, no `vite-plus` anywhere | `null` |
| `yarn4-pnp` | Berry/PnP, no `node_modules`, root `package.json` declares `vite-plus` | `{ root: "<repo>" }` — install hint |

@Sysix Sysix May 18, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

No Yarn PnP support for vp? For VSCode oxlint and oxfmt it is supported:
https://github.com/oxc-project/oxc-vscode/blob/aeeb69c6a7990738d31e53dd21b73dce9776f63c/client/findBinary.ts#L171-L196

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@fengmk2 fengmk2 May 19, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

If the current project is detected to be a Vite+ project, the vp binary can be located following the same rules as the oxlint binary, which supports Yarn PnP.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sysix reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
fengmk2 added a commit that referenced this pull request May 19, 2026
@fengmk2
docs(rfc): rename "workspace root" → "root workspace"
b8c4d8b
"Workspace root" collides with the VS Code "workspace" concept, which
caused confusion in PR review (#1614). The monorepo-level concept this
RFC describes is more precisely called the "root workspace" — the
directory at the top of the monorepo containing pnpm-workspace.yaml /
package.json#workspaces / lerna.json.

Updates the prose, the Mermaid diagram labels, the pseudocode helper
name, and the reference TypeScript helper (isWorkspaceRoot →
isRootWorkspace). The literal Rust function name `find_workspace_root`
in vite-task is preserved as a code citation.

Also adds a blockquote in the "rule" section explicitly distinguishing
the monorepo concept from the editor "workspace folder" concept so
future readers don't hit the same confusion.
fengmk2 added 8 commits May 19, 2026 14:48
@fengmk2
docs(rfc): add "Vite+ Project Detection for Editor Extensions"
5159291
Defines a portable rule the four oxc editor extensions
(oxc-vscode, oxc-zed, oxc-intellij-plugin, coc-oxc) use to decide
whether to launch `vp lint --lsp` / `vp fmt --lsp` instead of plain
oxlint / oxfmt, and to resolve which executable to spawn.

Core algorithm (two phases, both bounded by the workspace root):

1. Phase 1 — find the package.json that DIRECTLY declares vite-plus
   in dependencies or devDependencies. A transitively hoisted
   `node_modules/vite-plus/` does not count.
2. Phase 2 — walk up from the declaring ancestor looking for a real
   `node_modules/vite-plus/bin/vp` with a sibling `package.json` that
   parses and has `name === "vite-plus"`.

Result is a tri-state: `null` (not Vite+), `{ root, vpPath }`
(Vite+ and runnable), or `{ root }` (declared but not yet installed —
editors fall back to plain oxlint/oxfmt and never launch a bare vp).

Distribution: for the Node-capable extensions (oxc-vscode, coc-oxc)
the detector ships as a shared bundled-devDependency package
(@voidzero-dev/detect-vite-plus, name TBD) at
`packages/detect-vite-plus/`. oxc-zed (Rust) and
oxc-intellij-plugin (Kotlin) port the same algorithm against the
shared conformance fixtures.

The RFC also documents:
- The four extensions' existing bin-resolution chains with code
  excerpts and file:line citations.
- A Mermaid flowchart of the two-phase algorithm for cross-language
  porters.
- The workspace-root marker set (`pnpm-workspace.yaml`,
  `package.json#workspaces`, `lerna.json`) and a known parity gap
  with vite-task that this RFC does not block on.
- Per-extension migration plans and a conformance fixture table that
  pins down behaviour across every implementation.

Refs #1557
@fengmk2
docs(rfc): correct marker non-targets — .vite-hooks is real, .vp-root…
192c196
… isn't

.vp-root was a fabricated example. Replace with .vite-hooks, which
is the real vite-plus hooks directory (packages/cli/src/config/hooks.ts:67)
and a more useful illustration of "incidental vite-plus artifact that
must not stop the walk-up."

Refs #1557
@fengmk2
docs(rfc): expose installed vite-plus version for LSP gating
2eae28b
The detector now reads node_modules/vite-plus/package.json#version
alongside name validation and returns it in DetectResult as
vpVersion. Editors compare against MIN_VP_VERSION_FOR_LSP (a constant
exported by the shared detector package, filled in when #1557's
wrapper removal lands) to choose between launching `vp lint --lsp`
and falling through to the legacy bin/oxlint wrapper chain shipped
by older vite-plus versions.

Three benefits:
- Smooth rollout: workspaces pinned to older vite-plus keep working
  via the existing wrapper, no breakage on upgrade of the editor
  extension alone.
- Upgrade hint: editors can surface "upgrade vite-plus to enable
  native LSP" when the installed version is too old.
- Forward compatibility: future LSP-only features can raise the
  threshold by bumping the detector package, not by changing every
  consumer.

Changes:
- DetectResult gains optional vpVersion (set whenever vpPath is set).
- resolveVpAt() rejects installs whose package.json has no string
  version, treating them as orphan.
- Public API adds MIN_VP_VERSION_FOR_LSP constant and supportsLsp()
  helper for both consumers to use.
- Per-extension migration plan gains a fourth branch for the
  "installed but version too old" case.
- New conformance fixtures: installed-but-version-too-old,
  installed-no-version-field.
- New open question: the concrete value of MIN_VP_VERSION_FOR_LSP
  (TBD until #1557 ships).
@fengmk2
docs(rfc): address reviewer feedback — tighten and drop version gating
87aded6
826 lines → 302 lines. Reviewer flagged repetition and pushed back on
the version-gating mechanism. Changes:

- Drop MIN_VP_VERSION_FOR_LSP / supportsLsp / vpVersion entirely.
  Editors just attempt `vp lint --lsp`; if it fails on an old vp,
  the editor surfaces an upgrade hint at that point.
- Change "declared but not installed" UX: surface an install hint
  instead of silently falling back to plain oxlint. The reviewer is
  right that plain oxlint without VP_VERSION isn't Vite+-aware
  anyway, so silent fallback misleads more than it helps.
- Heavy trim of repetition: drop "Insight", drop the long
  bin-resolution code excerpts (kept brief file:line refs), fold
  "Why this rule" into the rule section, collapse the Decisions
  section, drop "Downstream coordination" (overlapped with the
  migration plan), drop the "Verification plan" subheading.
- Move "publish as a shared npm package?" from a locked Decision to
  an Open Question — the reviewer asked us to make the call; making
  it visibly open instead of locked invites the reviewer to weigh
  in.
- Shrink the conformance fixture table: drop entries that document
  non-features (global-vp-on-path, user-binpath-override) now that
  the rule plainly says we don't check $PATH or user settings, and
  drop the version-related fixtures.
@fengmk2
docs(rfc): rename "workspace root" → "root workspace"
87dca61
"Workspace root" collides with the VS Code "workspace" concept, which
caused confusion in PR review (#1614). The monorepo-level concept this
RFC describes is more precisely called the "root workspace" — the
directory at the top of the monorepo containing pnpm-workspace.yaml /
package.json#workspaces / lerna.json.

Updates the prose, the Mermaid diagram labels, the pseudocode helper
name, and the reference TypeScript helper (isWorkspaceRoot →
isRootWorkspace). The literal Rust function name `find_workspace_root`
in vite-task is preserved as a code citation.

Also adds a blockquote in the "rule" section explicitly distinguishing
the monorepo concept from the editor "workspace folder" concept so
future readers don't hit the same confusion.
@fengmk2
docs(rfc): default to node_modules/.bin/vp, not the package-relative …
128cc60
…path

Reviewer correctly pointed out that node_modules/.bin/<name> is the
conventional path editor extensions already use for oxlint/oxfmt, so
the TypeScript reference should target that by default. The previous
choice was Zed-driven and shouldn't be imposed on the Node consumers.

Changes:
- Phase 2 in the algorithm: validate via node_modules/vite-plus/
  package.json, then resolve node_modules/.bin/vp (with Windows .cmd
  and .exe fallbacks).
- Reference TypeScript updated; resolveVpAt now returns the .bin shim
  rather than the package-relative path.
- Mermaid diagram: package-validation node first, then the .bin/vp
  existence check.
- Per-extension migration plan: each extension targets whatever shim
  path matches its existing oxlint/oxfmt pattern.
  - oxc-vscode, coc-oxc → node_modules/.bin/vp
  - oxc-zed → node_modules/vite-plus/bin/vp (Zed avoids .bin for WASM
    reasons; lsp.rs:47)
  - oxc-intellij-plugin → <vite-plus>/bin/vp via NodePackageDescriptor
- Conformance fixtures: vpPath values now show the .bin/vp path (the
  TypeScript reference's output); a clarifying note explains that
  ports targeting the package-relative path substitute their own
  equivalent.
@fengmk2
docs(rfc): simplify Windows bin lookup to vp.cmd only
d9390d5
Package managers create `.cmd` shims on Windows for JS-based bins.
Trying `vp.exe` and bare `vp` as fallbacks is over-engineered noise:
- `vp.exe` would only be created for native binaries; `vp` is a JS
  shim, so no package manager produces a .exe.
- Bare `vp` (no extension) on Windows isn't materialized on disk; it
  works under shell environments via PATHEXT, but existsSync checks
  filesystem entries and would miss it anyway.

Collapses the candidates loop to a single conditional path, drops the
"`.cmd`/`.exe`" mention from the prose.
@fengmk2
docs(rfc): drop tri-state restatement and fold package-name question
6e6e6e6
Three cleanups from /simplify review:

- Per-extension migration section opened with a re-statement of the
  three result outcomes already enumerated in § Result. Replaced with
  a one-line pointer.
- Open question #2 (final package name) was contingent on #1, not a
  standalone question. Folded the name into the package-publish
  question as a parenthetical.
- resolveVpAt's doc comment restated what the code already says;
  collapsed to one short JSDoc line.
@fengmk2
fengmk2 force-pushed the vp-detect branch from b3ee44a to 6e6e6e6 Compare May 19, 2026 06:49
nrayburn-tech
nrayburn-tech reviewed May 20, 2026
View reviewed changes
Comment thread rfcs/editor-extension-vite-plus-detection.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

nrayburn-tech
nrayburn-tech reviewed May 20, 2026
View reviewed changes
Comment thread rfcs/editor-extension-vite-plus-detection.md
`searchSettingsBin`, `searchGlobalNodeModulesBin`, `searchEnvPath`,
and `require.resolve` paths can escape the root workspace or
consult settings meant for oxlint/oxfmt.
- **`oxc-zed`** — keep targeting `node_modules/vite-plus/bin/vp` (the

@nrayburn-tech nrayburn-tech May 20, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Zed has a very limited extension API currently. I wouldn't expect the Zed extension to be able to implement this RFC as documented. (I'm not suggesting the RFC change because of Zed, but just something to be aware of. That extension API is very limiting today, but I believe it's on their roadmap to eventually improve.)

For example, you can't traverse the file system within a Zed extension directly. I think this alone prevents implementing this RFC.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
nrayburn-tech
nrayburn-tech reviewed May 20, 2026
View reviewed changes
Comment thread rfcs/editor-extension-vite-plus-detection.md Outdated
## The rule

A project is **Vite+** iff some `package.json` between the start
path and the root workspace declares `vite-plus` directly in

@nrayburn-tech nrayburn-tech May 20, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

start path

What exactly would be the definition of this? I think it's just the current file open in the editor UI, but I'm not entirely sure. Clarifying this may be helpful.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@fengmk2 fengmk2 May 22, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

https://github.com/voidzero-dev/vite-plus/pull/1614/changes#r3285677648

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
nrayburn-tech
nrayburn-tech reviewed May 20, 2026
View reviewed changes
Comment thread rfcs/editor-extension-vite-plus-detection.md
path and the root workspace declares `vite-plus` directly in
`dependencies` or `devDependencies`. A `node_modules/vite-plus/`
directory on its own does not qualify — that could be a transitive
install hoisted from an unrelated dependency tree.

@nrayburn-tech nrayburn-tech May 20, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

(Different thread for a different concern.)

A node_modules/vite-plus/
directory on its own does not qualify — that could be a transitive
install hoisted from an unrelated dependency tree.

This explicitly prevents somebody from wrapping vite-plus in another package. Is that going to be a problem for some subset of users? I don't have a specific use case in mind, but it feels limiting so it may be worth thinking about in case that request does come up from users.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@fengmk2
docs(rfc): define "start path" per editor extension
9b1f052
Reviewer asked what the RFC means by "start path." It's editor-specific
— each extension has a slightly different concept available:

- oxc-vscode: active document's path (with workspace folder as
  fallback); the RFC now recommends moving to document-anchored
  detection so a workspace folder rooted above a subpackage that
  declares vite-plus still finds it.
- coc-oxc: workspace.root.
- oxc-zed: worktree.root_path().
- oxc-intellij-plugin: the opened VirtualFile's path (already per-file).

Added a "Start path per extension" subsection with a mapping table
and a short explanation of why the granularity differs across
editors, plus an inline blockquote at the first mention of "start
path" pointing at the new subsection.
fengmk2
fengmk2 commented May 22, 2026
View reviewed changes
Comment thread rfcs/editor-extension-vite-plus-detection.md
parent. The walk-up bound is what prevents a nested checkout from
inheriting an unrelated parent's Vite+ install.

### Start path per extension

@fengmk2 fengmk2 May 22, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

@nrayburn-tech I will try to write POC code for each IDE extension to verify the correctness of the logic described in the documentation.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@fengmk2

fengmk2 commented May 22, 2026

Copy link
Copy Markdown
Member Author

@Sysix @nrayburn-tech I will try to write POC code for each IDE extension to verify the correctness of the logic described in the documentation.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fengmk2
docs(rfc): add Phase 3 global vp fallback and simplify Phase 2 to .bi…
1ee71c2
…n/vp existence

Addresses Sysix's review thread (#1614, line 178). Once Phase 1 has
confirmed Vite+ via a direct package.json declaration, fall back to
a global vp lookup when no project-scoped install is found:

- Phase 2: walk up the workspace checking node_modules/.bin/vp (or
  vp.cmd on Windows). No package.json parsing — trust the package
  manager's shim. A stale shim points at a removed install and the
  spawn-time error already surfaces the upgrade hint, so this is a
  safe simplification.
- Phase 3 (new): search $PATH (and per-extension global node_modules)
  for vp. Bounded by Phase 1's identity gate: a global vp on a
  workspace without a vite-plus declaration still returns null.

Updated the rule prose, pseudocode, Mermaid diagram, reference TS
(new resolveGlobalVp helper, simplified resolveVpAt), per-extension
migration plan (oxc-vscode/coc-oxc may now use their existing
searchGlobalNodeModulesBin/searchEnvPath helpers in Phase 3;
oxc-zed's WASM API can't implement Phase 3 today; oxc-intellij can
chain NodePackage.findDefaultPackage), and conformance fixtures
(dropped bin-vp-orphan since the simplified Phase 2 no longer
distinguishes that case; added root-declared-no-local-global-on-path
and renamed global-vp-on-path to global-vp-without-declaration for
clarity).

Also restructured "What we deliberately do not check" to split
Phase 1 identity exclusions from Phase 2-3 binary-resolution scope.
@Sysix Sysix mentioned this pull request May 26, 2026
vite-plus/lsp: config search behind env flag oxc-project/oxc#21654
Closed
@fengmk2 fengmk2 mentioned this pull request May 30, 2026
feat: detect Vite+ projects and launch vp lint/fmt --lsp (POC) oxc-project/oxc-zed#199
Closed
@fengmk2

fengmk2 commented May 30, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

POC'd this in oxc-zed (oxc-project/oxc-zed#199): ported Phases 1–3 to Rust, all 10 fixtures pass, verified live in Zed against a real vite-plus project (urllib → launches vp lint/fmt --lsp). Three Zed notes for the RFC:

  1. Phase 3 is implementable but low-value in Zed. The §oxc-zed note says Zed exposes no $PATH, but Worktree::which has existed since the earliest WIT, so worktree.which("vp") resolves the $PATH lookup. However, after testing it I don't think it's worth implementing for Zed: a real vite-plus project's vite.config.ts imports vite-plus, so with no local install vp, global or otherwise, dies with UNRESOLVED_IMPORT. A missing/deleted node_modules breaks vp regardless of which binary you launch, so the global fallback can't actually rescue a missing install; the local install is what matters. (Global node_modules lookup also isn't possible, no process spawn.)

  2. The real blocker: node_modules reads are unreliable (zed#10760, closed not planned), read_text_file there "mostly doesn't work" and Path::exists fails in WASM. So Phase 2's "validate against a real vite-plus package (name === "vite-plus")" isn't reliable in Zed; it'd return false "declared but not installed" for real installs. The shipping extension already sidesteps this by reading only the root package.json and trusting the constructed node_modules/vite-plus/bin/vp path; a missing install then fails at spawn time (the upgrade-hint trigger the RFC already describes).

  3. Phase 1's walk is bounded at the worktree root, read_text_file can't read above worktree.root_path(), so a monorepo root where only a subpackage declares vite-plus returns null (consistent with the RFC's "no per-file resolution" note).

Net for oxc-zed: we landed on a local-only construct-and-trust design, Phase 1 detects via the root package.json, Phase 2 trusts node_modules/vite-plus/bin/vp, and there's no Phase 3 global fallback because it can't help a missing install anyway. A missing install surfaces as a clear Cannot find module …/vite-plus/bin/vp ("run pnpm install").

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

liangmiQwQ
liangmiQwQ reviewed Sep 6, 2026
View reviewed changes

@liangmiQwQ liangmiQwQ left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The real blocker: node_modules reads are unreliable (zed-industries/zed#10760, closed not planned)

If we end up finding problem to read these files to determine if it is a Vite+ project, could we give up detection, and have an explicit setting for that?

Users can choose whether to use a different version of Oxlint in a project, the encapsulated Vite+ will not be affected.

That said, I think this is a temporary solution, there is room to improve this in the future. But considering the difficulty to detect, and users now already have some explicit settings in the editor to configure Vite+, I believe this is a feasible solution to fix this major bug before RC.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@fengmk2 fengmk2 mentioned this pull request Sep 11, 2026
feat: support Vite+ detection and per-tool source selection oxc-project/oxc-vscode#384
Open
@fengmk2
Merge branch 'main' into vp-detect
d3ef975
This was referenced Sep 12, 2026
feat: support Vite+ detection and per-tool sources oxc-project/oxc-zed#259
Open
feat: support Vite+ detection and per-tool sources oxc-project/oxc-intellij-plugin#583
Open
feat: support Vite+ detection and per-tool source selection oxc-project/coc-oxc#247
Open
@leaysgur leaysgur mentioned this pull request Sep 17, 2026
lint,fmt: Deprecate the wrapper bin for stable IDE support #1557
Closed
1 of 9 tasks
@Brooooooklyn Brooooooklyn mentioned this pull request Oct 14, 2026
test: remove tautological and duplicate Rust unit tests #3057
Merged
fengmk2 pushed a commit that referenced this pull request Oct 15, 2026
@Brooooooklyn @claude
test: remove tautological and duplicate Rust unit tests (#3057)
88b34aa
<!-- claude-projects-attribution: {"github_login":"Brooooooklyn"} -->
_Requested by **Brooklyn** · [project
thread](https://claude.ai/code/project/chan_018s9RxRdtH424j2EhXdzV3N?thread=cmsg_018s9RxRdtH424j2EhXdzV3NQxbeR8Pt7qaqSQwoq9rEFo)_

<!-- routine:prune-tests:duplicate-shell-and-helper-tests -->

Before: `vp_global_cli` and `vp_pm_cli` carried Rust unit tests that
could not fail when the product broke: an `assert!(true)` in
`create.rs`, four `env use` shell-detection tests that repeat
`commands::shell` tests for code `env use` only imports, and three tests
of test-only helpers. `upgrade_check.rs` had 20 hand-unrolled lookup
tests.

After: those 8 tests are gone and the 20 lookup tests are 2 table-driven
tests that keep every row and comment, with the failing row named in the
assertion message. Only test code changes: every hunk is inside a
`#[cfg(test)]` module or the `#[cfg(test)]`-only
`resolution::test_utils` module.

How: each candidate was defended by mutating product code with the most
realistic regression only it would catch, running the crate's tests, and
reverting. No deleted test failed alone on any mutation.

### Totals

| | Before (origin/main c04bcf6) | After |
|---|---|---|
| Files touched | – | 5 |
| `vp_global_cli` cases collected (Linux) | 502 (+2 ignored) | 479 (+2
ignored) |
| `vp_pm_cli` cases collected | 923 (+2 ignored) | 920 (+2 ignored) |

- Cases deleted: **8** of 1,425 collected in the two touched crates.
Repo-wide: about 2,432 `#[test]`/`#[tokio::test]` attributes in tracked
Rust (static count) and 1,492 static `it`/`test` calls in 101 JS spec
files (not collected; Vitest needs a full `packages/core` build).
- Cases folded: **20 into 2**, every row and comment kept.
Runner-collected total: −26.
- Net lines: **−159** (+42 / −201).
- Runtime saved: about 0.03 s (the 8 deleted cases each report 0.000 s;
the 20 folded cases summed 0.028 s against 0.011 s for the 2
replacements).
- Test-binary time on this shared machine: `vp_global_cli` 3.13 s → 3.32
s, `vp_pm_cli` 27.81 s → 29.06 s (noise).

### Per file

1. **`crates/vp_global_cli/src/commands/create.rs` ›
`test_create_command_module_exists`**
   - Class: tautology (`assert!(true)`).
- Best defense: M1 (delegate `"new"` instead of `"create"`) passes all
502 tests, so this test cannot fail. The whole `mod tests` goes.
- Coverage gap (pre-existing, unchanged by this PR): no unit test covers
`vp create` delegation. It may be covered by the PTY snapshot suite,
which was not run.
2. **`crates/vp_global_cli/src/commands/env/use.rs` ›
`test_detect_shell_vp_shell_{powershell,fish,nu}`,
`test_detect_shell_posix_default`**
- Class: duplicates of stronger tests. `detect_shell` /
`Shell::from_str` live in `commands/shell.rs`; `env use` only imports
them.
- Still covered: `fish` is byte-identical to
`commands::shell::tests::test_detect_shell_vp_shell_fish`; `nu` to
`test_detect_shell_vp_shell_explicit`; lowercase `powershell` by
`test_shell_from_str` and `test_detect_shell_vp_shell_case_insensitive`;
`posix_default` by `test_detect_shell_defaults_without_vp_shell`.
- Best defenses M2–M5: each failed the nominee together with at least
one `commands::shell` test.
- The `use vp_shared::env_vars;` import is now `#[cfg(windows)]`, since
only the three Windows-only tests in the module still use it.
3. **`crates/vp_pm_cli/src/resolution/test_utils.rs` ›
`parses_args_without_a_program_name`,
`parses_subcommands_without_a_program_name`**
   - Class: test tooling testing test tooling.
- Best defense: M7 fails 122 tests and M8 fails 17; every resolution
parser test exercises these helpers.
4. **`crates/vp_pm_cli/src/resolution/commands/list.rs` ›
`list_args_helper_keeps_pattern`** (and its test-only `list_args`
helper, which had no other caller)
- Class: test tooling testing test tooling; it only checked struct
construction.
- Best defenses: M9 fails only
`test_list_with_pattern_and_pass_through_args`; M10 fails
`test_parser_accepts_short_dev_and_global_flags` and
`cli::tests::projects_managed_global_commands`. The nominee passes both.

### Folds (`crates/vp_global_cli/src/upgrade_check.rs`)

- The 9 `is_newer_version_*` tests → `is_newer_version_compares_semver`
(12 rows, original comments kept, one comment added for the `0.0.0`
dev-build row).
- The 11 `should_run_for_*` / `should_not_run_for_*` tests →
`should_run_for_command_skips_excluded_and_machine_readable_commands`
(11 rows).
- M11, M12 and M13 still fail the folded tables.

### Kept after defense — do not re-nominate

None: no nominee survived its defense.

### Case counts

| file | before | after | delta | expected delta |
|---|---|---|---|---|
| vp_global_cli `commands/create.rs` | 1 | 0 | −1 | −1 |
| vp_global_cli `commands/env/use.rs` (Linux) | 16 | 12 | −4 | −4 |
| vp_global_cli `upgrade_check.rs` | 36 | 18 | −18 | −18 (20 folded into
2) |
| vp_pm_cli `resolution/commands/list.rs` | 45 | 44 | −1 | −1 |
| vp_pm_cli `resolution/test_utils.rs` | 2 | 0 | −2 | −2 |
| **Crates total** | 1,425 | 1,399 | −26 | −26 |

**0 new failures** (0 failed and 4 ignored, before and after).

### Mutations

Each was temporary and reverted (`git status` clean afterwards).

1. M1 `create.rs:15`: delegate `"new"` instead of `"create"`. Failed:
none.
2. M2 `shell.rs:30`: `"fish"` → `"fishshell"`. Failed: `use::…_fish`,
`shell::test_shell_from_str`, `shell::…_fish`.
3. M3 `shell.rs:31`: `"nu" | "nushell"` → `"nushell"`. Failed:
`use::…_nu`, `shell::…_explicit`, `shell::test_shell_from_str`.
4. M4 `shell.rs:32`: drop `"powershell"`. Failed: `use::…_powershell`,
`shell::…_case_insensitive`, `shell::test_shell_from_str`.
5. M5 `shell.rs:54`: default always `Cmd`. Failed:
`use::…_posix_default`, `shell::…_defaults_without_vp_shell`,
`shell::…_invalid_vp_shell_falls_back_to_default`.
6. M6 `shell.rs:49`: upper-case the value. Failed: none (equivalent
mutation; `from_str` lowercases).
7. M7 `test_utils.rs:70`: `test_argv` no longer prepends a program name.
Failed: 122 tests, including both nominees.
8. M8 `test_utils.rs:57`: `parse_subcommand` gets raw args. Failed: 17
tests (`config`, `dist_tag`, `owner`, `stage`, `token`, plus the
nominee).
9. M9 `list.rs:78-80`: pnpm drops the pattern. Failed:
`test_list_with_pattern_and_pass_through_args` only.
10. M10 `list.rs:11`: `pattern` becomes `#[arg(long)]`. Failed:
`test_parser_accepts_short_dev_and_global_flags`,
`cli::tests::projects_managed_global_commands`.
11. M11 `upgrade_check.rs:170` (after the fold): `>` → `>=`. Failed:
`is_newer_version_compares_semver`.
12. M12 `upgrade_check.rs:338` (after the fold): `Upgrade` removed from
the excluded commands. Failed:
`should_run_for_command_skips_excluded_and_machine_readable_commands`.
13. M13 `upgrade_check.rs:165` (after the fold): the `0.0.0` early
return removed. Failed: `is_newer_version_compares_semver`.

### What ran and what did not

- Ran, at origin/main and on this branch: `cargo test -p vp_global_cli`
and `cargo test -p vp_pm_cli` with `--report-time`; `cargo clippy -p
vp_global_cli -p vp_pm_cli --all-targets --all-features -- --deny
warnings` with the `just lint` allow-list; `cargo fmt --all -- --check`;
`git diff --check`. All pass.
- Not run: the full workspace `just test` / `just lint` / `just check`;
Windows targets (none installed here, so the `#[cfg(windows)]` import
gate was reviewed but not compiled; Windows CI will compile it); the
JS/Vitest suite; the PTY snapshot suite.

### Excluded pull requests

55 open PRs touch 737 files between them; none of the 5 files here is
among them. #3055 #3052 #3051 #3049 #3047 #3046 #3044 #3040 #3038 #3037
#3020 #3018 #3014 #3012 #3009 #3008 #3000 #2986 #2981 #2966 #2936 #2922
#2900 #2863 #2862 #2810 #2792 #2740 #2721 #2699 #2695 #2574 #2557 #2552
#2549 #2543 #2542 #2541 #2483 #2475 #2463 #2462 #2461 #2456 #2428 #2418
#2357 #2267 #2125 #1958 #1783 #1782 #1614 #1517 #1180.

### Age check (cutoff: 30 days, 2026-09-14)

First-added dates from `git log -S`, followed across the `vite_*` →
`vp_*` crate rename.

| Test | First added |
|---|---|
| `test_create_command_module_exists` | 2026-02-10 (a29ac83, #570) |
| `test_detect_shell_posix_default` | 2026-02-07 (194c0dc, #524) |
| `test_detect_shell_vp_shell_{powershell,fish,nu}` | 2026-05-24
(53ae721, #1658) |
| `test_utils` tests and `list_args_helper_keeps_pattern` | 2026-08-03
(c1574dd, #2140) |
| The 20 folded `upgrade_check` tests | 2026-03-30 (db75675) |

None was added for a bug or incident, and none is in a permission,
security or entitlement suite.

### Checks

| Check | Before | After |
|---|---|---|
| Tests `vp_global_cli` | 502 pass | 479 pass |
| Tests `vp_pm_cli` | 923 pass | 920 pass |
| Clippy (deny warnings) | pass | pass |
| rustfmt | – | pass |
| `git diff --check` | – | clean |

To revert: `git revert 687935d`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01PxVsmvB9xfZKfVnUonY8kf

---
_Generated by [Claude
Code](https://claude.ai/code/session_01PxVsmvB9xfZKfVnUonY8kf)_

Co-authored-by: Claude <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

3 more reviewers
@Sysix Sysix Sysix left review comments
@nrayburn-tech nrayburn-tech nrayburn-tech left review comments
@liangmiQwQ liangmiQwQ liangmiQwQ left review comments
Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@fengmk2 fengmk2

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@fengmk2 @Sysix @nrayburn-tech @liangmiQwQ
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.