Repository navigation
Conversation
Part of redhat-developer#1947. A language server keeps only its own transport, not the transports which its template lists, so its export wrote no `transports`. A language server created from the export allowed every transport again, without the hint or the warning of the template: the TypeScript template's "talks LSP only over its standard input and output", or the argument which a change of the transport swaps in the command. The export now writes the `transports` of the template the language server was created from, found as its settings find it: by its id among the bundled templates. They're written as the template has them, with each `mode` and `argument`, so "Import template..." reads them as it reads those of a bundled template. A language server without a template, created from a custom template, or whose template LSP4IJ no longer bundles, exports no `transports`, as before. A language server over a socket from a template which lists only stdio exports both its `socket` and the template's `transports`, so an import of it also reports "The socket mode ... of the template isn't one of its transports". Nothing is added to the settings: an older LSP4IJ ignores `transports` (before 0.30.0), or reads it as it reads a bundled template's (0.30.0 and 0.30.1, which lock Socket for a template which lists only stdio).
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2131 +/- ##
==========================================
+ Coverage 52.90% 53.09% +0.19%
==========================================
Files 826 826
Lines 34600 34616 +16
Branches 7111 7116 +5
==========================================
+ Hits 18305 18381 +76
+ Misses 13536 13473 -63
- Partials 2759 2762 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
@coderabbitai review |
Action performed
|
lagergren
added a commit
that referenced
this pull request
Nov 23, 2026
…nd in installers (#2136) Follow-up to #2102 and #2094. #2094 documented three things as they were before #2102, which changed them: | Docs said | Since #2102 | Where | |---|---|---| | The New Language Server dialog "doesn't apply" a template's `workingDir` or its `workspaceFolderSettings.json` yet | It gives the language server that it creates the working directory and the workspace folders of the template, also of an imported one (b0206f2) | `UserDefinedLanguageServerTemplate.md`: the `workingDir` field and the template's files; `UserDefinedLanguageServer.md`: export; `DeveloperGuide.md`: workspace folders of a user-defined language server | | LSP4IJ keeps the first check as done "also when it failed" | An installation which failed, or whose `run` failed, isn't kept: the first start in the next IDE session checks again, and installs the server if the check fails. One that the user cancelled is kept (d245403) | `UserDefinedLanguageServerTemplate.md`: when the installer runs | | A `showMessage` task with actions waits until the user clicks one | It also ends when its notification is closed, and then fails (d4d9fd6) | `UserDefinedLanguageServerTemplate.md`: Task showMessage | Each was checked against `main`'s code: `NewLanguageServerDialog.loadFromTemplate`, `UserDefinedLanguageServerInstaller.initialize` and `ShowMessageTask`. Docs only, one commit on today's `main`. #2131, now merged, rewrote the same export paragraph of `UserDefinedLanguageServer.md`; this keeps its text and changes only the sentence about the `workingDir`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of #1947.
What
A language server keeps only its own transport, not the
transportsthat its template lists. Its export wrotesocketbut nevertransports, so a language server created from the export allowed every transport again. The template's hint and warning were gone: since #2087, the TypeScript template gives "The template says this language server talks LSP only over its standard input and output" when Socket is chosen. So was the argument that a change of the transport swaps in the command (#1969).Change
transportsof the template that the language server was created from (LanguageServerDefinitionSerializer). The template is found as the settings page finds it since feat: Improve LemMinX template with installer and auto-update command on #1962: by the server's template id, among the bundled templates. Each entry has itsmode, and itsargumentwhen the template has one, as the template has them; an empty one is kept, as in cpp_ls's stdio.transports, as before, for a language server without a template, one created from a custom template (an imported template has noid), or one whose template LSP4IJ no longer bundles.transportsas it does for a bundled template, so the New Language Server dialog gives the import the template's hint, warning and argument swap.transportslist onlystdio, exports both. Its import also lists fix: small template and installer bugs from #1959, #1960, #1961 and #1947 #1981's "The socket mode startAndAccept of the template isn't one of its transports" next to the Socket warning. Both are warnings, so OK stays enabled.transports, as for any custom template. That would needtransportsin the settings, which this leaves out.UserDefinedLanguageServer.md; theidfield, and the Transports and Socket and transports sections ofUserDefinedLanguageServerTemplate.md.Behaviour change
An exported language server created from a bundled template now includes that template's
transports, so a language server created from the export gets the same transport hint, warning and command-argument swap as the template.transports: the import allows every transport, without a hint[stdio --stdio]: the stdio-only hint, and the warning when Socket is chosentransports: no socket hint, no argument swap--socket=${port}, and Socket swaps--stdiofor itsocketonlysocketandtransports: Socket stays chosen, with the Socket warning and "The socket mode … isn't one of its transports"transportstransportsBackward compatibility
transportshas the shape that bundled templates have used since 0.30.0 (mode, optionalargument).transportsis ignored, assocketis (checked on 0.21.0);transportsas they do for a bundled template, so the import behaves as the template does in that version: for a stdio-only template, Socket is locked with the hint, the lock that fix: warn, instead of locking Socket, for a language server whose template lists only stdio #2087 replaces.transports, as before.Test
NewLanguageServerDialogTransportTestexports a language server withexportLsTemplates, unzips it, imports it withimportServerTemplate, and loads it in the New Language Server dialog:[stdio --stdio], no template problem, the stdio-only hint, Socket enabled, and choosing it gives the warning on the Socket button and below the fields, with OK enabled;--socket=${port}, and Socket swaps--stdiofor it;transportsare kept, the socket mode that isn't listed is reported, and the dialog shows the Socket warning; every warning keeps OK enabled;transportsintemplate.json, and no hint or warning.LanguageServerSocketTemplateTest: for every bundled template withtransports, the exportedtransportsequal the template's JSON, and read back to the same list.