Skip to content

fix: run the npm install of the Vue.js language server in its node_modules folder - #2084

Merged
lagergren merged 1 commit into
redhat-developer:mainfrom
lagergren:fix/install-the-vue-js-language-server-into-its-node-modules
Nov 22, 2026
Merged

lagergren merged 1 commit into
redhat-developer:mainfrom
lagergren:fix/install-the-vue-js-language-server-into-its-node-modules

Conversation

@lagergren

Copy link
Copy Markdown
Collaborator

Part of #1960.

What

npm installs into the first folder, from its working directory up, that has a package.json or a node_modules folder. The Vue.js installer ran npm install in ~/.lsp4ij/lsp/vue-js-language-server, where neither is before the first install. So a package.json or a node_modules folder in the home directory, as a stray npm install there leaves, took the install. The command that the installer then gave the language server, ~/.lsp4ij/lsp/vue-js-language-server/node_modules/.bin/vue-language-server, didn't exist, and nor did the TypeScript that the template's initializationOptions.json takes from that folder.

The other eight npm installers run in the node_modules folder of their server, as ~/.lsp4ij/lsp/typescript-language-server/node_modules. Its parent, the folder of the server, has that node_modules folder, so npm always installs there.

The Vue.js installer now does the same. The packages land in the same folder as before, ~/.lsp4ij/lsp/vue-js-language-server/node_modules, so existing installs, the command that they got, and the TypeScript path of initializationOptions.json stay as they are.

Test

  • npm prefix, which prints the folder that npm installs into, with a package.json in a stand-in home directory:
    • from ~/.lsp4ij/lsp/vue-js-language-server: the home directory;
    • from ~/.lsp4ij/lsp/typescript-language-server/node_modules: ~/.lsp4ij/lsp/typescript-language-server.
  • BundledTemplateCommandsTest.anNpmInstallRunsInTheNodeModulesFolderOfItsServer (new) checks that every npm install of a bundled installer runs in a node_modules folder. Without the change, it finds the Vue.js installer.
  • The template and installer tests pass (90 tests).

…dules folder

npm installs into the first folder, from its working directory up, that has
a package.json or a node_modules folder. The Vue.js installer ran npm in
~/.lsp4ij/lsp/vue-js-language-server, so a package.json in the home
directory took the install, and the command that the installer gave the
language server didn't find it. Like the other npm installers, it now runs
in the node_modules folder of the server, whose parent npm then installs
into: the same folder as before.
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Corrected the Vue.js language server’s launch configuration to locate its executable from the installed package directory on Windows and other platforms. This helps the server start successfully when invoked through the bundled installer.
    • Improved consistency in how bundled language server installers set their working directories during package installation.

The Vue.js Language Server installer now uses its node_modules directory as its working directory and updates configure command paths. A test checks that bundled npm install commands use working directories ending in /node_modules.

Changes: Installer working directory

Layer / File(s) Summary
Installer paths and validation
src/main/resources/templates/lsp/vue-js-language-server/installer.json, src/test/java/com/redhat/devtools/lsp4ij/launching/templates/BundledTemplateCommandsTest.java
The Vue.js Language Server installer sets workingDir to the server’s node_modules directory and uses .bin/vue-language-server in the Windows and default configure commands. A test scans bundled installer JSON and checks that matching npm install commands use working directories ending in /node_modules.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to 7a29d

The Vue.js language server installer now runs npm install in its own node_modules folder, so a stray package.json or node_modules in the home directory no longer redirects the install. The executable paths are unchanged, and a new test guards all bundled installers. No merge-blocking risk is identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: the Vue.js language server's npm install now runs in its node_modules folder. The raw summary confirms that installer.json sets workingDir to node_modules and updates…
Description check Passed The description explains the cause (npm installs into the first ancestor folder with package.json or node_modules), the fix (run the install in the server's node_modules folder), the compatibility imp…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title states the main change: the Vue.js language server's npm install now runs in its node_modules folder. The raw summary confirms that installer.json sets workingDir to node_modules and updates the install commands. The title is specific and accurate.

Full details: Description check

Explanation

The description explains the cause (npm installs into the first ancestor folder with package.json or node_modules), the fix (run the install in the server's node_modules folder), the compatibility impact, and the tests added. It relates directly to the changeset.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e0334aaa-5a49-48c9-a8ad-f3ce1a79de3d
Commits

Reviewing files that changed from the base of the PR and between 8b83e2d and 7a29dcd.

Files selected for processing: 2

  • src/main/resources/templates/lsp/vue-js-language-server/installer.json
  • src/test/java/com/redhat/devtools/lsp4ij/launching/templates/BundledTemplateCommandsTest.java

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@codecov

codecov Bot commented Nov 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.26%. Comparing base (8b83e2d) to head (7a29dcd).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2084      +/-   ##
==========================================
+ Coverage   50.24%   50.26%   +0.02%     
==========================================
  Files         816      816              
  Lines       33699    33699              
  Branches     5261     5261              
==========================================
+ Hits        16931    16939       +8     
+ Misses      14127    14114      -13     
- Partials     2641     2646       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lagergren lagergren added this to the 0.30.2 milestone Nov 22, 2026
@lagergren

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lagergren

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lagergren
lagergren merged commit 610bd3f into redhat-developer:main Nov 22, 2026
9 checks passed
@lagergren lagergren added bug Something isn't working install template-ls labels Nov 22, 2026
lagergren added a commit that referenced this pull request Nov 25, 2026
…0.1 (#2255)

## What

An audit of the docs against main found wrong information, missing docs
for features merged since 0.30.1, broken links and small mistakes. This
PR fixes the text. The outdated screenshots are retaken in separate PRs.

## Change

### DAP guides
- **DAPSupport.md:**
- The `Cancel` request is supported, with `supportsCancelRequest`
(#2122). It was marked ❌.
  - `Terminate Thread` is also in the Frames view.
  - The Output line links the user guide.
- **DAP user guide:**
- New section, "Console output": ANSI colours, indented groups, hidden
`telemetry` output, and the source link or "Jump to Value Source" after
an output.
- Jump to Source on a lazy variable whose value has no declaration opens
the lazy variable's own declaration.
  - The Frames view also says "the thread has exited".
  - CodeLLDB maps Rust files only.
- **DAP developer guide:**
- The `DAPClient` requests `stepBack`, `reverseContinue`, `locations`,
`setExpression` and `terminateThreads`.
- The rule that a request naming a frame id or a `variablesReference`
goes through `sendInExecutionEpoch`.
  - The `DAP.Threads.Popup` group with `ThreadsPanel.SELECTED_THREADS`.
- Keeping `supportsANSIStyling` when overriding
`createInitializeRequestArguments`.
- **Debug adapter pages:**
- "Log pattern before proceeding", not "processing", in go-delve, julia
and vscode-js-debug.
  - ruby-rdbg: select Attach, since the dialog opens on Launch.
  - codelldb: the C++ TODO is replaced by how to map C/C++ files.

### Developer guides
- **LSPApi.md, fixes:**
- The formatting sample compiles: `isExistingFormatterOverrideable` is
`public`. The javadoc sample of `LSPFormattingFeature` is fixed too.
- The `get*Characters` and `get*Scope` methods return `String` and
`FormattingScope`, not `boolean`.
- The CodeLens sample compares the command's title, not the `Command`,
and has its imports.
- There is one Diagnostic section, with `getTooltip`; the duplicate
section named `getToolTip`, which is never called.
  - The DocumentSymbol table: `getIcon` takes the `boolean`.
- `isEnabled(VirtualFile)` is `false` until a server with an installer
is installed.
- `EditorBehaviorFeature` is named correctly, and the Breadcrumbs
default is given.
  - Two stray `=======` merge markers are gone.
- **LSPApi.md, additions:**
- Sections for the call hierarchy, type hierarchy, on-type formatting
and configuration features.
- The missing methods of CodeAction, CodeLens, Completion, Progress,
DocumentSymbol and References.
- When Find Usages merges a language server's reference with a language
plugin's.
- **DeveloperGuide.md:**
- A custom server API is exposed with `getServerInterface()`, not
`createLanguageClient`.
- The get-server sample had an inverted null check. The Lease sample
checks for a null item, casts to the server API and joins the future.
- The custom `WorkspaceFolderStrategy` sample implements
`getWorkspaceFolders`, so it compiles.
  - All attributes of the `server` extension point are listed.
- `OSProcessStreamConnectionProvider` isn't experimental, starts one
process, and logs to the `Logs` tab.
  - A document matcher that throws counts as no match.
- The missing workspace folders image is replaced by an existing
screenshot.

### User guides
- **UserGuide.md:**
- A Getting started section. The empty LSP console's `Getting Started`
link opens this page.
- The console tree: state badges, the server and instance tooltips, and
`[stdio]` or the socket.
  - Messages that LSP4J can't parse are shown in the traces.
- The warning when IntelliJ 2026.3's own LSP client also serves a file.
- Find Usages lists a declaration once, and lists once a reference that
a language plugin also finds.
- **LSPSupport.md:**
  - Snippet edits of `workspace/applyEdit`.
  - `workspace/executeCommand` traces name the command.
  - When Quick Documentation shows a late hover reply.
  - The completion prefix in a token that spans whitespace.
- `callHierarchy/incomingCalls` and `callHierarchy/outgoingCalls`, not
`textDocument/...`.
  - The `LSP Type Definition(s)` and `LSP Declaration(s)` menus.
  - A reversed link is fixed.
- **README:**
  - "As notification" is the default error reporting.
- "In log" writes a warning to `idea.log` and opens no dialog; the
screenshot of that dialog is removed.
  - LSP4IJ instead of LSP4J.
- The documentation list names the LSP API, the template page and the
DAP pages.

### User-defined language servers and templates
- **UserDefinedLanguageServerTemplate.md:**
- The npm `exec` example matches the bundled TypeScript installer: it
runs in `node_modules`, with a quoted command, and says why (#2084).
- A downloaded file is named after the last segment of the URL's path,
without its query or fragment.
  - The `template.json` example gives JavaScript its `*.js` pattern.
  - The rust-analyzer installer tab is a link, not an inline image.
- **UserDefinedLanguageServer.md:** the template list uses the names
that `Choose template...` shows (Camel, Dart, EO, Stylelint, Vue), and
the Language ID sentence is finished.
- **Server pages:**
  - Ada: the path includes the archive's `integration/` folder.
  - HTML: the template is development-only.
- LemMinX: the installer runs at the first start, not when the server is
created.

## Checks
- **Samples:** the developer-guide samples, and an override of every
method in the new API tables, compile in a throwaway test source. The
samples as they are on main fail with 3 errors.
- **Links:** all relative links and anchors of the changed pages
resolve.
- **Open PRs:** the doc changes of #2229, #2230 and #2233 still apply on
top of this PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working install template-ls

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant