Skip to content

Template transports: gaps in the settings, export and checks #1947

Closed

Description

@muescha

A follow-up of #1870, collected in #1943.

The template's transports only apply in the New Language Server dialog

loadFromTemplate is the only caller of setSupportedTransports. On the settings page of a server made from the TypeScript template, Socket can be chosen, and the hint is missing. (done in #1962: the settings page applies the template's transports too)

The settings page already looks up the template by its id for the URL, so the same lookup could pass its transports to the panel. An imported template has no id there, so it would have to store its transports in the settings; I'd leave that out for now. (done in #1962)

But I wouldn't lock Socket there, and maybe not in the dialog either. A template is also a starting point: someone with their own TypeScript language server that does talk over a socket would take the TypeScript template for its mappings and settings, change the command, and then can't choose Socket, because the template says stdio only. Today they can only switch it on the settings page afterwards, since the lock is missing there; with the lookup above, that way would close too.

Some ways to keep the help without the lock:

  • A warning instead of the lock: Socket stays enabled, the grey hint stays as it is, and once Socket is chosen it becomes a warning ("The template says this language server talks LSP only over its standard input and output"), e.g. as ValidationInfo.asWarning().withOKEnabled(), so OK and Apply still work.
  • An override link in the hint: "This language server talks LSP only over its standard input and output. Use a socket anyway", which enables Socket for this server.
  • Lock only while the command is the template's: once the command is changed, it's no longer the template's server, so the template's transports no longer apply, and Socket is enabled with the hint.
  • Let the hint say where it comes from: "The TypeScript Language Server template lists only stdio", so it reads as advice about that server, not as a limit of LSP4IJ.

I'd go for the warning, maybe together with the command check, and the same on the settings page. That also covers the next section the other way round.

A language server that talks only over a socket

The template can say that a server only supports a socket, by listing only socket modes in transports, but nothing uses that:

  • stdio is never disabled, only socket is (in update()), and there's no hint like "This language server talks LSP only over a socket";
  • without a socket object as well, the dialog selects stdio for it;
  • forInstalledCommand switches such a server to stdio when its installer's command has no ${port}, so it can't start at all afterwards.

A hint, and a warning when stdio is chosen, in the same way as in the previous section, and not falling back to stdio for such a server, would cover it. (Not tested with a real socket-only server, only read in the code.)

transports isn't exported

transports lives only in LanguageServerTemplate, not in the definition or its settings. Export writes socket, but never transports. A server created from an exported template therefore allows every transport again, and the lock or hint from the original template is gone. This is the same gap as on the settings page above: once transports is kept with the server, both the settings page and export could use it.

socket and transports aren't checked against each other (done in #1981)

loadFromTemplate calls setTransport before setSupportedTransports, and nothing compares the two. With a socket mode and transports listing only stdio, Socket is preselected but disabled. Once the user switches to stdio, they can't go back, and no warning says why. With the warning suggested above instead of the lock, this case would also read better. Otherwise the template loader could warn that the socket mode isn't in transports. (done in #1981)

The hint uses only the first socket mode of transports

The hint below the socket modes takes the first entry that isn't stdio. A server that lists both startAndConnect and startAndAccept only shows the first. Is that intended, or should the hint name every listed socket mode?

A transports entry without mode (done in #1981)

An entry without mode is reported as "The template lists the unknown transport mode null, which is ignored". For socket, a missing mode has a message of its own. The same for transports ("A transport of the template has no mode, …") would read better. (done in #1981)

How this was checked

The lock on Socket after Import template... was seen in runIde; the rest Claude Code found by reading the code, without trying it in the IDE: the first two sections at b4b23c2, the last four at 754254a.

Activity

  1. lagergren commented on Nov 13, 2026

    @lagergren
    Collaborator

    Where 0.30.0 stands on these:

  2. lagergren commented on Nov 23, 2026

    @lagergren
    Collaborator

    Progress: #2087, merged on 2026-11-23 for 0.30.2, replaces the lock with the warning suggested above. For a template whose transports lists only stdio:

    Still open here:

    • A language server that talks only over a socket: there's still no hint or warning when stdio is chosen, and forInstalledCommand still falls back to stdio.
    • transports isn't exported.
    • The hint names only the first socket mode of transports.
  3. lagergren commented on Nov 23, 2026

    @lagergren
    Collaborator

    All the sections of this issue are done now, for 0.30.2:

    Section Done in
    The template's transports only apply in the New Language Server dialog #1962 (the settings page applies them too), and #2087: Socket is no longer locked for a template that lists only stdio; choosing it gives a warning that keeps OK and Apply enabled
    A language server that talks only over a socket #2132: the dialog selects Socket, with a hint, and warns of stdio; an installer whose command has no ${port} no longer switches such a server to stdio
    transports isn't exported #2131: the export writes the transports of the bundled template that the server was created from
    socket and transports aren't checked against each other #1981
    The hint uses only the first socket mode #2132: there's a hint for every listed socket mode
    A transports entry without mode #1981

    Two things remain, outside these sections:

    Thanks for the thorough write-up. Every section of it was right.

  4. added this to the 0.30.2 milestone on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtemplate-lsuser-defined LS

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions