Repository navigation
docs: say that the CSS language server template installs the server, instead of asking for VS Code - #2051
Conversation
…instead of asking for VS Code Since d5942bf, the command of the CSS language server template starts the server where its installer puts it, in $USER_HOME$/.lsp4ij/lsp/vscode-css-language-server, but its README and its docs page still asked to install Visual Studio Code and to use its copy.
|
@muescha could you review this one too? It updates the README and the docs page of the CSS language server template, which still asked to install VS Code, while the template's command starts the copy its installer puts in |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2051 +/- ##
=========================================
Coverage 49.47% 49.48%
=========================================
Files 813 813
Lines 33343 33350 +7
Branches 6854 5195 -1659
=========================================
+ Hits 16498 16503 +5
- Misses 14267 14270 +3
+ Partials 2578 2577 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Checked the path against
Claude Code compared the PR with the template, the installer and the npm package; nothing was installed. |
…ay the installer runs at the first start The screenshot showed the old command, VS Code's copy of the server, in a red box, which the text below it now contradicts: it shows the template selection only. The installer runs at the first start of the language server only, as its executeOnStartServer is false, and then on Reinstall; the npm command it runs has --force.
|
Thanks, all three are in f67748f:
#2052, which builds on this and moves the CSS and ESLint language servers to one shared folder, has the same wording, with its path. |
|
LGTM 👍 |
|
@coderabbitai review |
Action performed
|
…ir npm package (#2052) Part of #1960. Builds on #2051, which should merge first: this branch contains its commit, and changes the paths that #2051 puts into the README and the docs page of the CSS language server. The CSS and ESLint language server templates both start a language server of the `vscode-langservers-extracted` npm package, and their installers each installed the whole package into a folder of their own, `~/.lsp4ij/lsp/vscode-css-language-server` and `~/.lsp4ij/lsp/vscode-eslint-language-server`. A copy is about 70 MB, most of it TypeScript 4.9, which the package depends on. Both templates and installers now use one folder, `$USER_HOME$/.lsp4ij/lsp/vscode-langservers-extracted`, so the package is installed once. Each language server runs its installer in a task of its own, so the installers of two language servers can run at the same time: with a CSS file and a JavaScript file opened together, two `npm install` would run in the shared folder at once and break each other's install. An exec task which declares its working directory now runs its command there only while no other exec task runs its command in the same directory (`ExecTask`, a lock per directory). The wait ends with the cancellation of the installation. An exec task without a working directory, as the check `Trying current command` of most installers, which runs in the project, doesn't wait. The lock also keeps out the exec tasks of the other IDEs with LSP4IJ, as IntelliJ IDEA and WebStorm, which share `~/.lsp4ij`: an exec task also locks a file for its working directory, in `$USER_HOME$/.lsp4ij/locks` (`ExecTask.getLockFile`). If the file can't be opened or locked, as on a file system without file locks, the task goes on as before, kept out only by the other tasks of its IDE. An installation which runs because the check found the server not installed, and which waited for another one to leave its working directory, runs the check again once it runs, and doesn't run its command if the check then passes (`InstallerContext.isCheckAgainAfterWaiting`, set by the declarative language server and debug adapter installers from `ServerInstallerBase.isInstallingAfterFailedCheck`). So with a CSS file and a JavaScript file opened together, the package is installed once, not twice in a row. A forced installation, as by *Reinstall*, still runs its command. A language server already created from one of these templates keeps the command and the installer it was created with, so it keeps starting from its own folder, and nothing is installed again. Only a language server created from the template afterwards uses the shared folder. Not here: the other install folders of #1960, and the folders that the old installs leave behind. Test: `ExecTaskTest` runs two exec tasks in the same working directory at the same time, each with a command that holds the same file for two seconds and fails if the other holds it: both succeed. Without the lock, one fails. It also runs an installation while another one, which installs the server, runs in the same directory: the one that waited runs the check again, which passes, and not its command, which would fail; when the installation is forced, it runs its command. And it runs an exec task while another JVM, as another IDE, holds the lock file of its directory and the same file: it waits, and succeeds. The test that runs the check again and the one with another JVM fail without the change. `BundledTemplateCommandsTest.aTemplateStartsItsLanguageServerWhereItsInstallerPutsIt` now also checks that the CSS and ESLint templates start the language server where their installers put it, the command of an `npm install` included. It fails with the CSS template on its old folder. With #2054 merged, its `BundledTemplateCommandsTest.anInstallerPutsItsServerInTheFolderOfItsTemplate` lets the CSS and ESLint templates share the folder of their npm package (e6580ed). It and the installer, template, DAP, server and console tests pass (560 tests, 4 Windows-only tests skipped).
Found while going through #1960.
Since d5942bf, the command of the CSS language server template starts the server where its installer puts it,
$USER_HOME$/.lsp4ij/lsp/vscode-css-language-server/node_modules/vscode-langservers-extracted/lib/css-language-server/node/cssServerMain.js. Its README, which the help button of the New Language Server dialog shows, and its docs page still asked to install Visual Studio Code, and said that the command starts Visual Studio Code's copy of the language server.They now say that the installer installs
vscode-langservers-extractedwith npm when the language server starts and its command doesn't start it, and where the command starts it. The path is the one of the template and of the installer, andlib/css-language-server/node/cssServerMain.jsis in vscode-langservers-extracted 4.10.0, its latest version. The docs page also gets the newline it lacked at its end.Docs only.