Compare commits
No commits in common. "27a982fd21081eff340efb6e4cad027ec2526ee0" and "a5394bafbdb93665bf1d001f06aa823444ca2a04" have entirely different histories.
27a982fd21
...
a5394bafbd
@ -208,9 +208,6 @@ return {
|
|||||||
else
|
else
|
||||||
---@diagnostic disable-next-line: cast-local-type
|
---@diagnostic disable-next-line: cast-local-type
|
||||||
filename = vim.fn.fnamemodify(self.filename, ":~:.")
|
filename = vim.fn.fnamemodify(self.filename, ":~:.")
|
||||||
if not conditions.width_percent_below(#filename, 0.5, true) then
|
|
||||||
filename = vim.fn.pathshorten(filename)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
if filename == "" then
|
if filename == "" then
|
||||||
filename = "[No Name]"
|
filename = "[No Name]"
|
||||||
@ -546,11 +543,6 @@ return {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
update = {
|
|
||||||
"WinResized",
|
|
||||||
"BufAdd",
|
|
||||||
"BufEnter",
|
|
||||||
},
|
|
||||||
FileNameBlock,
|
FileNameBlock,
|
||||||
static = {
|
static = {
|
||||||
bg_color_right = nil,
|
bg_color_right = nil,
|
||||||
@ -676,14 +668,10 @@ return {
|
|||||||
provider = "%=",
|
provider = "%=",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
update = {
|
|
||||||
"BufAdd",
|
|
||||||
"BufEnter",
|
|
||||||
"FileType",
|
|
||||||
},
|
|
||||||
init = function(self)
|
init = function(self)
|
||||||
self.filename = vim.api.nvim_buf_get_name(0)
|
self.filename = vim.api.nvim_buf_get_name(0)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
{
|
{
|
||||||
provider = seps.full.left,
|
provider = seps.full.left,
|
||||||
hl = function()
|
hl = function()
|
||||||
@ -759,7 +747,6 @@ return {
|
|||||||
},
|
},
|
||||||
margin(1),
|
margin(1),
|
||||||
{
|
{
|
||||||
update = "CursorMoved",
|
|
||||||
{
|
{
|
||||||
provider = seps.full.left,
|
provider = seps.full.left,
|
||||||
hl = function()
|
hl = function()
|
||||||
@ -954,11 +941,7 @@ return {
|
|||||||
{
|
{
|
||||||
provider = function()
|
provider = function()
|
||||||
local cwd = vim.uv.cwd() or ""
|
local cwd = vim.uv.cwd() or ""
|
||||||
cwd = vim.fn.fnamemodify(cwd, ":~")
|
return " " .. vim.fn.pathshorten(vim.fn.fnamemodify(cwd, ":~"))
|
||||||
if not conditions.width_percent_below(#cwd, 0.3, false) then
|
|
||||||
cwd = vim.fn.pathshorten(cwd)
|
|
||||||
end
|
|
||||||
return " " .. cwd
|
|
||||||
end,
|
end,
|
||||||
hl = {
|
hl = {
|
||||||
fg = colors.sumiInk0,
|
fg = colors.sumiInk0,
|
||||||
|
@ -1,3 +1,36 @@
|
|||||||
|
local function on_attach(client, bufnr)
|
||||||
|
-- Set autocommands conditional on server_capabilities
|
||||||
|
vim.notify("Attached server " .. client.name, vim.log.levels.INFO, {
|
||||||
|
title = "LSP",
|
||||||
|
})
|
||||||
|
|
||||||
|
local function disable_format_capability(capabilities)
|
||||||
|
capabilities.documentFormattingProvider = false
|
||||||
|
capabilities.documentRangeFormattingProvider = false
|
||||||
|
end
|
||||||
|
local ignored_fmt_lsps = {
|
||||||
|
"lua_ls",
|
||||||
|
}
|
||||||
|
local capabilities = client.server_capabilities
|
||||||
|
-- vim.notify(vim.inspect(capabilities))
|
||||||
|
for _, lsp_name in ipairs(ignored_fmt_lsps) do
|
||||||
|
if client.name == lsp_name then
|
||||||
|
disable_format_capability(capabilities)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if capabilities.semanticTokensProvider and capabilities.semanticTokensProvider.full then
|
||||||
|
require("hlargs").disable_buf(bufnr)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
|
local server_opts = {
|
||||||
|
capabilities = lsp_capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
}
|
||||||
|
|
||||||
|
local lsp_server_bin_dir = vim.fn.stdpath("data") .. "/mason/bin/"
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
url = "https://git.sr.ht/~whynothugo/lsp_lines.nvim",
|
url = "https://git.sr.ht/~whynothugo/lsp_lines.nvim",
|
||||||
@ -96,6 +129,9 @@ return {
|
|||||||
ft = { "rust" },
|
ft = { "rust" },
|
||||||
config = function()
|
config = function()
|
||||||
vim.g.rustaceanvim = {
|
vim.g.rustaceanvim = {
|
||||||
|
server = {
|
||||||
|
on_attach = on_attach,
|
||||||
|
},
|
||||||
dap = {
|
dap = {
|
||||||
adapter = {
|
adapter = {
|
||||||
type = "server",
|
type = "server",
|
||||||
@ -136,6 +172,29 @@ return {
|
|||||||
{
|
{
|
||||||
"nvim-java/nvim-java",
|
"nvim-java/nvim-java",
|
||||||
ft = { "java" },
|
ft = { "java" },
|
||||||
|
config = function()
|
||||||
|
require("lspconfig").jdtls.setup({
|
||||||
|
capabilities = lsp_capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
-- HACK: Have to define this to make jdtls show hovers, etc.
|
||||||
|
init_options = {},
|
||||||
|
settings = {
|
||||||
|
java = {
|
||||||
|
completion = {
|
||||||
|
postfix = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
inlayHints = {
|
||||||
|
parameterNames = {
|
||||||
|
enabled = "all",
|
||||||
|
exclusions = { "this" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-java/lua-async-await",
|
"nvim-java/lua-async-await",
|
||||||
"nvim-java/nvim-java-refactor",
|
"nvim-java/nvim-java-refactor",
|
||||||
@ -273,45 +332,11 @@ return {
|
|||||||
},
|
},
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
config = function()
|
config = function()
|
||||||
local lsp_capabilities =
|
|
||||||
require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
|
||||||
callback = function(args)
|
|
||||||
local bufnr = args.buf
|
|
||||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
|
||||||
if not client then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
vim.notify("Attached server " .. client.name, vim.log.levels.INFO, {
|
|
||||||
title = "LSP",
|
|
||||||
})
|
|
||||||
|
|
||||||
local function disable_format_capability(capabilities)
|
|
||||||
capabilities.documentFormattingProvider = false
|
|
||||||
capabilities.documentRangeFormattingProvider = false
|
|
||||||
end
|
|
||||||
local ignored_fmt_lsps = {
|
|
||||||
"lua_ls",
|
|
||||||
}
|
|
||||||
local capabilities = client.server_capabilities
|
|
||||||
capabilities = vim.tbl_deep_extend("force", capabilities, lsp_capabilities)
|
|
||||||
if not capabilities then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
for _, lsp_name in ipairs(ignored_fmt_lsps) do
|
|
||||||
if client.name == lsp_name then
|
|
||||||
disable_format_capability(capabilities)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if capabilities.semanticTokensProvider and capabilities.semanticTokensProvider.full then
|
|
||||||
require("hlargs").disable_buf(bufnr)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
lspconfig.jdtls.setup({
|
lspconfig.jdtls.setup({
|
||||||
|
capabilities = lsp_capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
-- HACK: Have to define this to make jdtls show hovers, etc.
|
-- HACK: Have to define this to make jdtls show hovers, etc.
|
||||||
init_options = {},
|
init_options = {},
|
||||||
settings = {
|
settings = {
|
||||||
@ -335,6 +360,8 @@ return {
|
|||||||
-- I use ansible a lot, define exceptions for servers that can use
|
-- I use ansible a lot, define exceptions for servers that can use
|
||||||
-- server:setup & vim.cmd at the bottom here
|
-- server:setup & vim.cmd at the bottom here
|
||||||
lspconfig.ansiblels.setup({
|
lspconfig.ansiblels.setup({
|
||||||
|
capabilities = lsp_capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
settings = {
|
settings = {
|
||||||
ansible = {
|
ansible = {
|
||||||
ansible = {
|
ansible = {
|
||||||
@ -397,12 +424,16 @@ return {
|
|||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
capabilities = lsp_capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.csharp_ls.setup({
|
lspconfig.csharp_ls.setup({
|
||||||
handlers = {
|
handlers = {
|
||||||
["textDocument/definition"] = require("csharpls_extended").handler,
|
["textDocument/definition"] = require("csharpls_extended").handler,
|
||||||
},
|
},
|
||||||
|
capabilities = lsp_capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.jsonls.setup({
|
lspconfig.jsonls.setup({
|
||||||
@ -410,6 +441,8 @@ return {
|
|||||||
schemas = require("schemastore").json.schemas(),
|
schemas = require("schemastore").json.schemas(),
|
||||||
validate = { enable = true },
|
validate = { enable = true },
|
||||||
},
|
},
|
||||||
|
capabilities = lsp_capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.docker_compose_language_service.setup({
|
lspconfig.docker_compose_language_service.setup({
|
||||||
@ -418,14 +451,18 @@ return {
|
|||||||
enableTelemetry = false,
|
enableTelemetry = false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
capabilities = lsp_capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.powershell_es.setup({
|
lspconfig.powershell_es.setup({
|
||||||
bundle_path = vim.fn.stdpath("data") .. "/mason/packages/powershell-editor-services/",
|
bundle_path = vim.fn.stdpath("data") .. "/mason/packages/powershell-editor-services/",
|
||||||
|
capabilities = lsp_capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.azure_pipelines_ls.setup({
|
lspconfig.azure_pipelines_ls.setup({
|
||||||
cmd = { "azure-pipelines-language-server", "--stdio" },
|
cmd = { lsp_server_bin_dir .. "azure-pipelines-language-server", "--stdio" },
|
||||||
settings = {
|
settings = {
|
||||||
redhat = {
|
redhat = {
|
||||||
telemetry = {
|
telemetry = {
|
||||||
@ -441,9 +478,13 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
filetypes = { "azure-pipelines" },
|
filetypes = { "azure-pipelines" },
|
||||||
|
capabilities = lsp_capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.texlab.setup({
|
lspconfig.texlab.setup({
|
||||||
|
capabilities = lsp_capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
settings = {
|
settings = {
|
||||||
texlab = {
|
texlab = {
|
||||||
build = {
|
build = {
|
||||||
@ -461,12 +502,16 @@ return {
|
|||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.gopls.setup({
|
lspconfig.gopls.setup({
|
||||||
|
capabilities = lsp_capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
fillstruct = "gopls",
|
fillstruct = "gopls",
|
||||||
dap_debug = true,
|
dap_debug = true,
|
||||||
dap_debug_gui = true,
|
dap_debug_gui = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.nil_ls.setup({
|
lspconfig.nil_ls.setup({
|
||||||
|
capabilities = lsp_capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
settings = {
|
settings = {
|
||||||
["nil"] = {
|
["nil"] = {
|
||||||
formatting = { command = { "nixfmt" } },
|
formatting = { command = { "nixfmt" } },
|
||||||
@ -501,7 +546,7 @@ return {
|
|||||||
"typst_lsp",
|
"typst_lsp",
|
||||||
"nginx_language_server",
|
"nginx_language_server",
|
||||||
}) do
|
}) do
|
||||||
lspconfig[server].setup({})
|
lspconfig[server].setup(server_opts)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user