LuaLS / vscode-lua

Release lua-language-server for VSCode
https://github.com/LuaLS/lua-language-server
MIT License
177 stars 50 forks source link

Ubuntu nvim format 会在行尾出现^M #55

Closed fastchaser closed 2 years ago

fastchaser commented 2 years ago

感谢大佬的工作 我在Ubuntu1804上nvim0.61使用nvim-lsp-installer更新最新版sumneko_lua后,可以格式化lua代码了,耶✌️ 但是在每行末尾都会出现^M(windows的换行符),哈哈🙈

sumneko commented 2 years ago

是 WSL 吗?

fastchaser commented 2 years ago

不是,ubuntu1804系统,默认终端 nvim

sumneko commented 2 years ago

看看2.6.6修复没

fastchaser commented 2 years ago

更新后默认没开格式化功能,我刚看了Formatter preview #960,不知道怎么添加preview参数 我在配置文件里加了最下面的misc不行,想在“Lua.misc.parameters”加—preview return {
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
-- Setup your lua path
path = runtime_path,
},
diagnostics = {
-- Get the language server to recognize the vim global
globals = {'vim'},
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false
},
misc = {
parameters = 'preview',
},
}, }, }

sumneko commented 2 years ago

应该有个类似于 cmd = {'lua-language-server'} 的地方,改成 cmd = {'lua-language-server', '--preview'}

fastchaser commented 2 years ago

可以了,感谢大佬👍 👍 👍