Repository navigation
Conversation
lsp-cli-plus sent an empty InitializeParams, so a language server got no rootUri, no workspaceFolders and no initializationOptions. Send the current working directory as the workspace folder, as rootUri and as the only entry of workspaceFolders, and declare the workspace.workspaceFolders client capability. The new option --workspace-folder overrides the directory, and the new option --initialization-options names a JSON file whose value is sent as initializationOptions. In .lsp-cli-plus.json, relative defaults of both are resolved against the directory of that file. Fixes ltex-plus#67. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mv4cZ3LFVAJ9aG5SntwnAr
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.
Fixes #67.
Problem
lsp-cli-plus sent an empty
InitializeParams, so a language server got norootUri, noworkspaceFoldersand noinitializationOptions. A server that relies on them can't work from the command line as it does in an editor. ltex-ls-plus, for example, reads external setting files itself only when the client sendsltex.externalFiles.managedByEditorasfalseininitializationOptions(ltex-plus/ltex-ls-plus#192), and ltex-plus/ltex-ls-plus#234 resolves relative ones against the workspace folder.Fix
rootUriand as the only entry ofworkspaceFolders, declares theworkspace.workspaceFoldersclient capability, and answers the server'sworkspace/workspaceFoldersrequest. The new option--workspace-folder=<directory>sends another directory instead.--initialization-options=<file>sends the JSON value stored in<file>asinitializationOptions, unchanged. Without it, none are sent, as before. If the file doesn't exist, the client exits with 1 before it starts the server..lsp-cli-plus.json. A relative path given there as the default of either option is resolved against the directory of that file, the directory that--server-working-directorydefaults to, so a program can ship an initialization-options file next to its.lsp-cli-plus.json. On the command line, a relative path is resolved against the current working directory.changelog.xmlhas an entry.Not changed
workspace/configurationas before, and still doesn't declare it as a capability.--client-configurationin.lsp-cli-plus.jsonis still resolved against the current working directory.Testing
LspCliLanguageClientTestchecks theInitializeParamssent: the workspace folder, a relative one, and the initialization options.LspCliSettingsTestchecks how paths in.lsp-cli-plus.jsonare resolved, with and without the file.LspCliLauncherTestadds a check with both options, one with a missing initialization-options file, and the defaults of both options from.lsp-cli-plus.json.mvn verifypasses on JDK 21: 23 tests,ktlint,detektand JaCoCo.ltex-cli-pluslauncher of ltex-ls-plus 19.0.0, one file per run, with a word that only an external dictionary file lists:--initialization-optionsmanagedByEditorset tofalse:.ltex/dict.txt--workspace-folder=..:.ltex/dict.txtOnce this is released, ltex-ls-plus can list both options in the
visibleArgumentsthat itstools/addLtexCli.pywrites, so thatltex-cli-plus --helpshows them.Drafted by Claude Opus 5.5 (
claude-opus-5-5); reviewed by @regulad.https://claude.ai/code/session_01Mv4cZ3LFVAJ9aG5SntwnAr