Skip to content

docs: document the transport JSON (socket, transports) of a template - #1934

Merged
lagergren merged 4 commits into
redhat-developer:mainfrom
muescha:docs/template-transport-json
Nov 11, 2026
Merged

lagergren merged 4 commits into
redhat-developer:mainfrom
muescha:docs/template-transport-json

Conversation

@muescha

@muescha muescha commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Since redhat-developer/lsp4ij#1870, a template can set a socket transport (socket) and list the transports its language server supports (transports), both experimental. The docs described the dialog, but the JSON side was thin. Came up while reviewing redhat-developer/lsp4ij#1926.

Changes

docs/UserDefinedLanguageServerTemplate.md

  • Say that socket and transports are optional, in the list of the descriptor and in their sections.
  • The example template.json (typescript-language-server) now has its transports, as the bundled template does, and a sentence below it says why it has no socket.
  • #### Socket: a field table (mode, host, port, with defaults). Adds that stdio is the same as no socket, that host is used by attach only, that attach needs a port, and that a missing mode is also a warning.
  • #### Transports: a field table (mode required, argument optional). Adds that an entry with a missing or unknown mode is skipped with a warning, that without argument the hint names only the mode, and that the hint uses the first socket mode of the list.
  • New #### Socket and transports: socket is what the dialog preselects and what export keeps; transports only changes what the dialog offers and hints; LSP4IJ doesn't check one against the other.

docs/UserDefinedLanguageServer.md

  • #### Transport: one sentence that a template sets this with socket and lists the supported ones with transports, linking to the template sections.
  • ### Exporting templates: export writes socket (mode, port, and host when set) and never transports.

Every statement was checked against main: LanguageServerTemplateDeserializer (deserializeTransport, port, deserializeSupportedTransports), LanguageServerDefinitionSerializer, UserDefinedTransport, UserDefinedLanguageServerDefinition.createConnectionProvider, TransportFields (getTransport, update, validate), NewLanguageServerDialog.loadFromTemplate and LanguageServerBundle.properties. No code changes.

Question for the review

Minimal or full example? The first example template.json (typescript-language-server) keeps its transports with only stdio, as the bundled template has, and no socket; a sentence below it says why. Would a minimal example (no transports, no socket), with each optional property explained in its own section, read better? Or a full example that shows socket and transports together, for a language server which supports a socket?

🤖 Generated with Claude Code

muescha and others added 3 commits November 10, 2026 22:42
Add field tables for socket and transports, say how the two relate,
show transports in the example template.json, link the Transport
section to the template, and say what export writes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Documentation
    • Clarified that socket and transports are optional, experimental template settings.
    • Documented standard-I/O defaults, socket modes and fields, port selection, and warnings for unusable settings.
    • Explained transport entry requirements, skipped entries, warnings, and how transport choices appear in the dialog.
    • Distinguished the preselected and exported transport from the supported choices, noting they are not validated against each other.
    • Clarified which socket details appear in exports and that transports is omitted.

The documentation describes template transport declarations, socket settings, supported transport choices, dialog hints and warnings, and socket fields written during export.

Changes: Transport documentation

Layer / File(s) Summary
Template transport settings
docs/UserDefinedLanguageServerTemplate.md, docs/UserDefinedLanguageServer.md
The template guide describes optional experimental socket and transports entries, socket defaults and validation, transport hints, and the relationship between the preselected transport and supported choices.
Exported socket settings
docs/UserDefinedLanguageServer.md
The export guide documents the serialized socket mode, port, and optional host. It states that export omits transports.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: lagergren

Merge Risk: Minimal · up to 80ba9

This change only updates documentation for the experimental socket and transports properties. It does not alter runtime behavior, so merge risk is minimal.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly and concisely describes the documentation changes for the template transport JSON properties socket and transports.
Description check Passed The description directly explains the documentation changes, their scope, and the behavior of socket and transports.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

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: c25fe01a-7dfe-4a41-8b1e-b48177dbc3fd
Commits

Reviewing files that changed from the base of the PR and between b78c2ba and 80ba959.

Files selected for processing: 1

  • docs/UserDefinedLanguageServerTemplate.md
Files skipped from review as they are similar to previous changes: 1

  • docs/UserDefinedLanguageServerTemplate.md

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

@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.20%. Comparing base (754254a) to head (80ba959).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1934      +/-   ##
==========================================
+ Coverage   48.17%   48.20%   +0.02%     
==========================================
  Files         809      809              
  Lines       32435    32449      +14     
  Branches     6600     5000    -1600     
==========================================
+ Hits        15626    15641      +15     
+ Misses      14314    14313       -1     
  Partials     2495     2495              

☔ 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 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you, @muescha! I checked the new text against the code, and it holds. Approved.

Two small things, neither of them blocking:

  • The port row says that 0 lets LSP4IJ choose a free port, which isn't so with attach. The paragraph below says it, but "(not with attach)" in the row would keep the table right on its own.
  • The programArgs of the TypeScript example aren't those of the bundled template, which has sh -c typescript-language-server --stdio and cmd /C typescript-language-server.cmd --stdio. That text was there before, but the new sentence below it now presents the example as the template of that server.

…ript template's command

The `port` row of the socket table now says that 0 doesn't choose a free
port with `attach`, as the paragraph below it says. The `programArgs` of
the example are now those of the bundled typescript-language-server
template, which the sentence below the example presents it as.
@lagergren lagergren added this to the 0.30.0 milestone Nov 11, 2026
@lagergren

Copy link
Copy Markdown
Collaborator

@muescha, I pushed 80ba959 to your branch with the two small things from my review: the port row now says "(not with attach)", and the TypeScript example has the programArgs of the bundled template. I will merge it once CI is green.

@lagergren
lagergren merged commit fd12b0d into redhat-developer:main Nov 11, 2026
9 checks passed
@muescha

muescha commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @lagergren for making both changes right away, they're fine with me.

One note on the TypeScript command, for the record: sh -c typescript-language-server --stdio in the bundled template is a bug. sh -c takes only the next word as the command, and --stdio becomes $0 of that shell, so the server starts without --stdio. That's why the docs example had the quotes. An issue for this (and the other templates with sh -c) is in preparation and will follow.

For now, keeping the example the same as the bundled template is the right call; the fix can change both together.

@lagergren

Copy link
Copy Markdown
Collaborator

Thanks, @muescha, good catch. sh -c takes only the next word as the command, so the server starts without --stdio, and my change copied that into the docs example. #1954 tracks the fix for the templates, and the example should change together with it, as you say.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants