Plugin isn't setting up custom server settings anymore.
jipgg opened this issue · 6 comments
Currently my LSP options seemingly aren't getting initialized correctly anymore since syncing the plugin to the latest commits. In my case imports and strict datamodel types aren't being set to their respective state that i specified; Being import disabled and server diagnostics being non-strict while having both configured to be the opposite.
In case it could be an error on my part, below is my current config for the plugin that is passed to the mason handlers setup:
require("luau-lsp").setup({
platform = {
type = "roblox",
},
plugin = {
enabled = true,
port = 3667,
},
types = {
roblox_security_level = "PluginSecurity"
},
server = {
settings = {
["luau-lsp"] = {
completion = {
diagnostics = {
strictDatamodelTypes = true,
},
imports = {
suggestServices = true,
suggestRequires = false,
enabled = true,
},
},
},
},
},
})
My settings still are being respected, can you run :LspInfo
and :checkhealth luau-lsp
when luau-lsp is attached and send the output?
The outputs:
I've made a public repo of my nvim config (its not a sizable one) in case that would help resolving the issue. I've tried loading it from an exrc file with no luck. The other options seem to be working correctly, just the server configurations.
Edit: @jipgg btw I just realized you put diagnostics
settings under completion
, so thats probably why strictDatamodelTypes doesn't work, it should be under luau-lsp
. I replicated the settings for auto imports and it works only for services and not for requires as expected.
- I've updated the plugin (unrelated changes tbh but who knows), so download the latest version
- Try visualizing the settings, open a luau file and run
:lua vim.print(require("luau-lsp.util").get_client().settings)
or:LazyDev lsp
- If it shows as expected, try
:LuauLsp restart
- If still does not work, try pinning luau-lsp.nvim commits in this specific order:
131d385
ae76ec9
3ad89b5
(run:Lazy sync
) - Try loading luau-lsp.nvim at startup and leave the mason handler empty (
function() end
) Actually I think this shouldn't change anything because you seem to already load luau-lsp at startup
I'm using the latest commit right now and the settings are all respected
Pinning to 3ad89b5
resolves the issue. Looking at the output of :LspInfo
it seems to be rawdogging the executable on the other versions (image on my previous comment), and only invoking the mason CMD file on the older commit.
I do have a separate luau-lsp.exe
added to my PATH which seems to be the one that is getting invoked instead of the mason copy thats in nvim-data. Removing said executable from my path breaks functionality entirely and gives an error message on the later commits while silently breaking functionality on the commit that works.
This is however speculation based on a severe lack of knowledge about LSPs, but hopefully this extra information might make it easier for you to diagnose what the problem might be. Regardless, thank you for your help. it's working as expected now.
Ok, I see the problem: mason-lspconfig.nvim
will modify the cmd on Windows. mason.nvim
creates a luau-lsp.CMD
file under the binaries directory. vim.lsp.start_client
uses uv.spawn
under the hood, which doesn't execute batch scripts (.CMD files). It wasn't a problem before the commit you are using because I was depending on lspconfig, and mason-lspconfig would "fix" that. I'll add tests for Windows and fix that. Thanks!