Repository navigation
Backlog
Labels
Milestone
Description
Idea 3 of #1959, as an issue of its own: a way for a template to say that a value of its command has to come from the user or from its installer, instead of a placeholder that LSP4IJ doesn't know, such as XXX or <<insert base directory>>.
#1959's placeholders are paths that the installers already know. #2367 replaces them with the real commands, from installers that save their servers under fixed names (idea 1 of #1959). This issue is for the values that only the user knows, and for the values that an installer sets, without overwriting the whole command.
Inputs
As in VS Code's tasks.json and launch.json (input variables), the command refers to an input by its id, and the template declares its inputs once:
"programArgs": {
"default": "luau-lsp lsp --definitions=${input:definitions}"
},
"inputs": [
{ "id": "installpath", "description": "Path to the camel-lsp-server JAR", "filledBy": "installer" },
{ "id": "definitions", "description": "Path to globalTypes.d.luau", "optional": true }
]- The settings show a table of the inputs below the command, with their descriptions, as the environment variables table. The New Language Server dialog and the settings page flag an empty required input in its row, and Apply is refused while one is left, unless the installer fills it in.
- A server with an empty required input isn't started: the LSP Consoles say which input is missing, instead of a start that fails with an error that doesn't point to it.
- An installer sets an input instead of the whole command, e.g.
"setInput": {"installpath": "${output.dir}/${output.file.name}"}in place ofconfigureServer. TodayconfigureServerwith"update": trueoverwrites the command, so a change that the user made, as an extra argument, is gone after Reinstall. - An optional input that stays empty is left out, with its argument, as
--definitions=${input:definitions}. - Server definitions without inputs keep working as they do today.
To decide
- the short form
${input:id:description}without aninputslist; promptStringandpickStringas VS Code's input types, or only strings at first;- whether a value goes into the exported template of a server (Template
transports: gaps in the settings, export and checks #1947 exports the transports).
Related
- Templates: placeholders in commands aren't recognized #1959: placeholders in commands; fix: the clangd and sdl-lsp installers put their servers into ~/.lsp4ij, and each installer has the id of its template #2367 removes those of the bundled templates.
- Validation:
${port}with stdio, and errors shown differently #1950 and Settings page: show a language server's problems on its fields while typing, as the New Language Server dialog does #2009: problems shown on the settings page's fields. - Installer: ask before installing, and say what goes where #1958: ask before installing; a template whose command works without its installer can also start without asking.
Activity