| Summary: | RootUri for LSP, Lua LSP and HOME directory | ||
|---|---|---|---|
| Product: | [Applications] kate | Reporter: | Daniele Scasciafratte <mte90net> |
| Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | normal | CC: | waqar.17a |
| Priority: | NOR | ||
| Version First Reported In: | 24.12.1 | ||
| Target Milestone: | --- | ||
| Platform: | Debian unstable | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Daniele Scasciafratte
2025-01-27 10:16:24 UTC
If I create a .luarc.json file and I put it on /home/mte90 it is used but there is still the error because Kate is sending that parameter anyway. Does it work better if you add
"root": ""
to the lua server settings? (See bash server for example)
Nope:
```
"lua": {
"command": ["lua-language-server"],
"url": "https://github.com/sumneko/lua-language-server",
"highlightingModeRegex": "^Lua$",
"root":""
}
```
The log output:
```
[12:14:37.959][info] [#0:script/client.lua:657]: Client init {
capabilities = {
textDocument = {
codeAction = {
codeActionLiteralSupport = {
codeActionKind = {
valueSet = { "quickfix", "refactor", "source" }
}
}
},
completion = {
completionItem = {
resolveSupport = {
properties = { "additionalTextEdits", "documentation" }
},
snippetSupport = true
}
},
documentSymbol = {
hierarchicalDocumentSymbolSupport = true
},
hover = {
contentFormat = { "markdown", "plaintext" }
},
inlayHint = {
dynamicRegistration = false
},
publishDiagnostics = {
relatedInformation = true
},
selectionRange = {
dynamicRegistration = false
},
semanticTokens = {
formats = { "relative" },
requests = {
full = {
delta = true
},
range = true
},
tokenModifiers = {},
tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator" }
},
synchronization = {
didSave = true
}
},
window = {
showMessage = {
messageActionItem = {
additionalPropertiesSupport = true
}
},
workDoneProgress = true
}
},
processId = 101697,
rootPath = "/home/mte90",
rootUri = "file:///home/mte90"
}
```
As you can see don't affect the LSP server.
Do you have project plugin enabled?
You can also try to use:
"rootIndicationFileNames": [".luarc.json"]
where .luarc.json lives at the root of your project. That should work
I have the project plugin enabled and also with that parameter I still have the issue. Ok, then you can have a `.kateproject` file in /home/mte90/.config/nvim/
In that file (/home/mte90/.config/nvim/.kateproject), you can specify the exact root. Contents of the file below
{
"name": "Neovim_Config",
"files": [
{
"directory": ".",
"recursive": 1,
"hidden": 1
}
],
"exclude_patterns" : [],
"lspclient": {
"servers": {
"lua": {
"command": ["lua-language-server"],
"root": "/home/mte90/.config/nvim/",
"highlightingModeRegex": "^Lua$"
}
}
}
}
Kate will treat /home/mte90/.config/nvim/ as a project folder if this file is present. The folder should appear in the project sidebar with the name Neovim_Config at the top. LSP plugin will then use the absolute path specified in the "root" key.
That solution worked. 🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME. For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging. Thank you for helping us make KDE software even better for everyone! |