mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
nvim: disable inlay hint request for cabal
This commit is contained in:
parent
21ed72823f
commit
927f6bc4ef
1 changed files with 24 additions and 17 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
local map = vim.keymap.set
|
local map = vim.keymap.set
|
||||||
|
local methods = vim.lsp.protocol.Methods
|
||||||
|
|
||||||
----------------------
|
----------------------
|
||||||
-- Language servers --
|
-- Language servers --
|
||||||
|
|
@ -75,22 +76,31 @@ local servers = {
|
||||||
-------------
|
-------------
|
||||||
-- Helpers --
|
-- Helpers --
|
||||||
-------------
|
-------------
|
||||||
local on_attach = function(client, bufno)
|
local on_attach = function(client, bufnr)
|
||||||
vim.api.nvim_set_option_value("omnifunc", "v:lua.vim.lsp.omnifunc", { buf = bufno })
|
vim.api.nvim_set_option_value("omnifunc", "v:lua.vim.lsp.omnifunc", { buf = bufnr })
|
||||||
local ts = require("telescope.builtin")
|
local telescope = require("telescope.builtin")
|
||||||
local opts = { buffer = bufno }
|
|
||||||
|
|
||||||
map("n", "K", vim.lsp.buf.hover, opts)
|
map("n", "K", vim.lsp.buf.hover, { buffer = bufnr })
|
||||||
map("n", "<C-k>", vim.lsp.buf.signature_help, opts)
|
map("n", "<C-k>", vim.lsp.buf.signature_help, { buffer = bufnr })
|
||||||
map("n", "gd", vim.lsp.buf.definition, opts)
|
map("n", "gd", vim.lsp.buf.definition, { buffer = bufnr })
|
||||||
-- conflicts with tabs
|
-- conflicts with tabs
|
||||||
-- map("n", "gtd", vim.lsp.buf.type_definition, opts)
|
-- map("n", "gtd", vim.lsp.buf.type_definition, { buffer = bufnr })
|
||||||
map("n", "gi", vim.lsp.buf.implementation, opts)
|
map("n", "gi", vim.lsp.buf.implementation, { buffer = bufnr })
|
||||||
map("n", "gu", ts.lsp_references, opts)
|
map("n", "gu", telescope.lsp_references, { buffer = bufnr })
|
||||||
map("n", "<leader>ca", vim.lsp.buf.code_action, opts)
|
map("n", "<leader>ca", vim.lsp.buf.code_action, { buffer = bufnr })
|
||||||
map("n", "<leader>cl", vim.lsp.codelens.run, opts)
|
map("n", "<leader>cl", vim.lsp.codelens.run, { buffer = bufnr })
|
||||||
map("n", "<leader>r", vim.lsp.buf.rename, opts)
|
map("n", "<leader>r", vim.lsp.buf.rename, { buffer = bufnr })
|
||||||
map("n", "<leader>f", function() vim.lsp.buf.format { async = true } end, opts)
|
map("n", "<leader>f", function() vim.lsp.buf.format { async = true } end, { buffer = bufnr })
|
||||||
|
|
||||||
|
local filetype = vim.api.nvim_get_option_value("filetype", { buf = bufnr })
|
||||||
|
if
|
||||||
|
client:supports_method(methods.textDocument_inlayHint)
|
||||||
|
-- Never start cabal with inlay hint request
|
||||||
|
-- Related: https://github.com/mrcjkb/haskell-tools.nvim/discussions/485
|
||||||
|
and filetype ~= "cabal"
|
||||||
|
then
|
||||||
|
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Helix style border
|
-- Helix style border
|
||||||
|
|
@ -117,9 +127,6 @@ vim.diagnostic.config { virtual_text = false, severity_sort = true }
|
||||||
-- Set log level
|
-- Set log level
|
||||||
vim.lsp.set_log_level("off")
|
vim.lsp.set_log_level("off")
|
||||||
|
|
||||||
-- Enable inlay hints
|
|
||||||
vim.lsp.inlay_hint.enable()
|
|
||||||
|
|
||||||
-- Gutter symbols setup
|
-- Gutter symbols setup
|
||||||
vim.fn.sign_define("DiagnosticSignError", { text = "E", texthl = "DiagnosticSignError", numhl = "DiagnosticSignError" })
|
vim.fn.sign_define("DiagnosticSignError", { text = "E", texthl = "DiagnosticSignError", numhl = "DiagnosticSignError" })
|
||||||
vim.fn.sign_define("DiagnosticSignWarn", { text = "W", texthl = "DiagnosticSignWarn", numhl = "DiagnosticSignWarn" })
|
vim.fn.sign_define("DiagnosticSignWarn", { text = "W", texthl = "DiagnosticSignWarn", numhl = "DiagnosticSignWarn" })
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue