Repository navigation
Description
Found while going through all templates for #1954; collected in #1943.
Summary
Some templates have placeholders in their command that the user has to replace. LSP4IJ doesn't know they're placeholders: the server definition can be saved with them, and starting it fails with an error that doesn't point to the placeholder.
| Template | Placeholder | Filled in by the installer? |
|---|---|---|
camel-lsp-server |
java -jar camel-lsp-server-XXX.jar |
yes |
sdl-lsp |
java -jar XXX-jar-with-dependencies.jar |
yes |
luau-lsp |
path/to/your/luau-lsp lsp --definitions=path/to/your/globalTypes.d.luau --docs=path/to/your/rb-docs.json |
--definitions=path/to/your/… and --docs=path/to/your/… |
codelldb (debug adapter) |
<<insert base directory>>/extension/adapter/codelldb |
yes |
perl-dap (debug adapter) |
<<insert base directory>>/perl-dap |
yes |
vscode-js-debug (debug adapter) |
node <<insert base directory>>/js-debug/src/dapDebugServer.js ${port} 127.0.0.1 |
yes |
So it's not only the version that has to be guessed: before the installer has run, or without it, the command can't work, and for luau-lsp it doesn't work after installing either (done in #1981). Three kinds of placeholder (XXX, path/to/your/…, <<insert base directory>>) are in use.
Placeholders also show up in settings sent to the server: the Dart template's (done in #1981) the settings.json has "dart.customDevTools" with /path/to/devtools and /path/to/dart-sdk, andperl-dap launch configuration launch.env.json has "API_KEY": "your-api-key-here" as an example.
Finding out the version
For the templates with an installer, nobody has to guess the version:
camel-lsp-serverdownloads with"maven": {"groupId": …, "artifactId": …};MavenArtifactFetcherasks Maven Central for thelatestVersionand builds the URL from it (with a fixedurlto 1.31.0 next to it);luau-lsp,codelldbandperl-dapdownload the latest GitHub release,sdl-lspthereleases/latestURL;- the installer then writes the command with the real file name,
java -jar ${output.dir}/${output.file.name}.
So the version is known after installing. It's only the template's command, before or without the installer, that has the placeholder.
Ideas
-
No version in the command at all. Let the installer save the download under a fixed name, with
"output": {"file": {"name": "camel-lsp-server.jar"}}, asluau-lspandcodelldbalready do. Then the template can have the real command, e.g.java -jar $USER_HOME$/.lsp4ij/lsp/camel-lsp-server/camel-lsp-server.jar, with no placeholder, and the installer only has to download. The same works forsdl-lsp(it already savessdl-lsp.jar) and for the<<insert base directory>>of the debug adapters, which could be theirserverDist, e.g.$USER_HOME$/.lsp4ij/dap/codelldb/extension/adapter/codelldb. -
One placeholder syntax that LSP4IJ knows, for what really has to come from the user, such as luau-lsp's type definitions, e.g.
${input:Path to globalTypes.d.luau}or, more telling,${change-placeholder:Path to globalTypes.d.luau}:- the New Language Server dialog and the settings page flag a command that still has one, with a red outline and a message such as "Fill in: Path to globalTypes.d.luau" (see Validation:
${port}with stdio, and errors shown differently #1950 about showing such errors); - Apply is refused while one is left, unless the installer will fill it in on the first start;
- a server whose command still has one isn't started, but shows "Fill in … in the settings" in the LSP Consoles, instead of failing up to 20 times (see Socket transport: "Connection refused" without host and port, and fast restarts #1944).
- the New Language Server dialog and the settings page flag a command that still has one, with a red outline and a message such as "Fill in: Path to globalTypes.d.luau" (see Validation:
-
Input values in a table of their own, filled by the user or by the installer. The command keeps markers such as
${input:installpath:Path to the camel-lsp-server JAR}:inputmarks a value to fill in,installpathis its key, and the rest is the description shown to the user. Below the command, the settings show a table of these values, with the description as a tooltip or in a dialog. A key the installer knows, such asinstallpath, is filled in by the installer after installing; the others by the user.- The installer no longer has to replace the whole command. Today
configureServerwith"update": trueoverwrites it, so a change the user made, e.g. an extra argument, is gone after Reinstall. With the table, the command stays as it is, and the installer only sets its value. - Validation gets simple: an empty value is flagged in its row, with its description, and a server with an empty required value isn't started, but says which value is missing.
- The user sees which values the installer sets, so nobody has to guess a version.
- VS Code does much the same in
tasks.jsonandlaunch.json:${input:id}in the command, and an"inputs"list withid,typeanddescription(docs). - The table is optional: server definitions without inputs keep working as they do today.
Two ways to shape it:
-
Declare the inputs once, as VS Code does, and only use the key in the command,
${input:installpath}, so a value used twice doesn't repeat its description:"inputs": [ { "id": "installpath", "description": "Path to the camel-lsp-server JAR", "filledBy": "installer" }, { "id": "definitions", "description": "Path to globalTypes.d.luau", "optional": true } ]
The short form
${input:installpath:description}could still be allowed when there's noinputslist. -
Let the installer set a value instead of a command, e.g.
"setInput": {"installpath": "${output.dir}/${output.file.name}"}in place ofconfigureServer. Values the user fills in have nofilledBy; optional ones that stay empty are left out, together with their argument, e.g. luau-lsp's--definitions=${input:definitions}.
This adds another kind of variable next to
${BASE_DIR},$USER_HOME$,${port}and${output.dir}, but the only one that says "something has to go here". - The installer no longer has to replace the whole command. Today
-
Optional arguments out of the command. ForDone in fix: small template and installer bugs from #1959, #1960, #1961 and #1947 #1981.luau-lsp lsp,--definitionsand--docsdefault to an empty list, so it starts without them; the types can also be set with the settingsluau-lsp.types.definitionFilesandluau-lsp.types.documentationFiles(see its README). The template's command could leave them out, and the settings could hold them, instead of a command that fails until they're replaced. -
Examples as examples.
The Dart(done in fix: small template and installer bugs from #1959, #1960, #1961 and #1947 #1981)dart.customDevToolswith/path/to/…could be left out ofsettings.json(it's an override only some need), and"your-api-key-here"marked as an example in the launch configuration's name.
1 removes most placeholders without any new mechanism; 2 or 3 is for the few that remain, and 3 also keeps the user's own changes to the command when the installer runs again. It goes well with #1958, since a template whose command works without the installer can also start without asking first.
How this was checked
Claude Code found this by reading all template files and MavenArtifactFetcher at 42b4e25; nothing of it was run. That luau-lsp starts without --definitions and --docs comes from its source (src/main.cpp) and README, not from running it.
Activity
fix: small template and installer bugs from #1959, #1960, #1961 and #…
lagergren commentedon Nov 13, 2026
0.30.0 fixes two of these, in #1981:
--definitionsor--docswithpath/to/your/…files any more: both are optional.settings.jsonno longer sendsdart.customDevToolswith/path/to/…folders.The other placeholders stay:
XXXincamel-lsp-serverandsdl-lsp, and<<insert base directory>>in thecodelldb,perl-dapandvscode-js-debugdebug adapters. Their installers fill them in, so they only matter before installing, or without the installer. The ideas above, a placeholder syntax that LSP4IJ knows or a table of inputs, are still open.fix: the sdl-lsp template starts sdl-lsp from where its installer put…
lagergren commentedon Nov 30, 2026
This is on 0.30.3 now. A first part is in #2367: the sdl-lsp installer saves the download as
sdl-lsp.jarin~/.lsp4ij/lsp/sdl-lsp, so the sdl-lsp template has the real command,java -jar "$USER_HOME$/.lsp4ij/lsp/sdl-lsp/sdl-lsp.jar", instead ofXXX(idea 1 above). The others follow:XXXin camel-lsp-server, and<<insert base directory>>in the CodeLLDB, Perl and VSCode JS Debug debug adapters, and the inputs of idea 3 for what only the user knows.fix: the VSCode JS Debug template starts its debug adapter from where…
fix: the Camel, CodeLLDB and Perl debugging templates start their ser…
lagergren commentedon Nov 30, 2026
All the placeholders in the commands of the bundled templates are gone once #2367 and #2336 are merged. The templates get the commands that their installers give, from installers that save their servers under fixed names (idea 1 above):
camel-lsp-server.jar; a jar that an earlier LSP4IJ saved with its version is still found), CodeLLDB and Perl debugging;Ideas 2 and 3, for values that only the user knows, are in #2368. This issue can be closed once both PRs are merged.
fix: the VSCode JS Debug template starts its debug adapter from where…
fix: the VSCode JS Debug template starts its debug adapter from where…
fix: the sdl-lsp template starts sdl-lsp from where its installer put…
fix: the Camel, CodeLLDB and Perl debugging templates start their ser…
lagergren commentedon Nov 30, 2026
Closing as done for 0.30.3: no template on
mainhas a placeholder in its command any more.camel-lsp-servercamel-lsp-server.jar, a fixed namesdl-lspsdl-lsp.jarin~/.lsp4ij/lsp/sdl-lspcodelldb~/.lsp4ij/dapperl-dapperl-dapin~/.lsp4ij/dap/perl-dapvscode-js-debugdapDebugServer.jsin~/.lsp4ij/dapluau-lspEach command is where the template's installer puts the server, so it works once the installer has run. Without the installer, the user edits it as any command. The idea of telling LSP4IJ what a user has to fill in, so that it can ask for it, is #2368.