[LSP] Fix eslint formatting being overridden by vuels or tsls
This commit is contained in:
parent
408f84bb8f
commit
6e53296a0b
@ -53,6 +53,13 @@ M.on_attach = function(client, bufnr)
|
||||
vim.opt.signcolumn = "yes" -- reserve space for diagnostics
|
||||
end
|
||||
|
||||
M.on_attach_no_formatting = function(client, bufnr)
|
||||
M.on_attach(client, bufnr)
|
||||
|
||||
client.server_capabilities.documentFormattingProvider = false
|
||||
client.server_capabilities.documentRangeFormattingProvider = false
|
||||
end
|
||||
|
||||
-- used to enable autocompletion (assign to every lsp server config)
|
||||
-- local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
M.capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
|
@ -5,6 +5,7 @@ local lsp = vim.lsp
|
||||
|
||||
local capabilities = require("lsp-options").capabilities
|
||||
local on_attach = require("lsp-options").on_attach
|
||||
local on_attach_no_formatting = require("lsp-options").on_attach_no_formatting
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ HTML, CSS, JSON │
|
||||
@ -29,7 +30,7 @@ lsp.config("jsonls", {
|
||||
-- └ ┘
|
||||
lsp.config("vue_ls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
on_attach = on_attach_no_formatting,
|
||||
filetypes = {
|
||||
"vue",
|
||||
},
|
||||
@ -40,7 +41,7 @@ lsp.config("vue_ls", {
|
||||
-- └ ┘
|
||||
lsp.config("ts_ls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
on_attach = on_attach_no_formatting,
|
||||
init_options = {
|
||||
plugins = {
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user