inlay hitns!
This commit is contained in:
parent
2cd8efc1df
commit
394348e8a9
4 changed files with 24 additions and 41 deletions
|
@ -1,3 +1,4 @@
|
||||||
return { -- this table overrides highlights in all themes
|
return { -- this table overrides highlights in all themes
|
||||||
-- Normal = { bg = "#000000" },
|
-- Normal = { bg = "#000000" },
|
||||||
|
inlays = { fg = "#a86280" }
|
||||||
}
|
}
|
||||||
|
|
23
init.lua
23
init.lua
|
@ -1,11 +1,32 @@
|
||||||
return {
|
return {
|
||||||
colorscheme = "material",
|
colorscheme = "material",
|
||||||
lsp = {
|
lsp = {
|
||||||
|
-- server_registration = function(server, opts)
|
||||||
|
-- if server == 'rust_analyzer' then
|
||||||
|
-- require('rust-tools').setup({ server = opts })
|
||||||
|
-- return
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- require('lspconfig')[server].setup(opts)
|
||||||
|
-- end,
|
||||||
formatting = { format_on_save = false },
|
formatting = { format_on_save = false },
|
||||||
-- skip_setup = { "rust_analyzer" },
|
-- skip_setup = { "rust_analyzer" },
|
||||||
setup_handlers = {
|
setup_handlers = {
|
||||||
-- add custom handler
|
-- add custom handler
|
||||||
rust_analyzer = function(_, opts) require("rust-tools").setup { server = opts } end,
|
rust_analyzer = function(_, opts)
|
||||||
|
local rt = require "rust-tools"
|
||||||
|
rt.setup {
|
||||||
|
server = opts,
|
||||||
|
tools = {
|
||||||
|
inlay_hints = {
|
||||||
|
parameter_hints_prefix = "< ",
|
||||||
|
other_hints_prefix = ": ",
|
||||||
|
highlight = "inlays",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
rt.inlay_hints.enable()
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
-- server_registration = function(server, opts)
|
-- server_registration = function(server, opts)
|
||||||
-- if server == "rust_analyzer" then
|
-- if server == "rust_analyzer" then
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
return {
|
|
||||||
-- "simrat39/inlay-hints.nvim",
|
|
||||||
}
|
|
|
@ -1,40 +1,4 @@
|
||||||
return {
|
return {
|
||||||
"simrat39/rust-tools.nvim",
|
"simrat39/rust-tools.nvim",
|
||||||
after = { "mason-lspconfig.nvim" },
|
after = { "mason-lspconfig.nvim", "inlay-hints." },
|
||||||
config = function()
|
|
||||||
local rt = require "rust-tools"
|
|
||||||
rt.setup {
|
|
||||||
tools = {
|
|
||||||
runnables = {
|
|
||||||
use_telescope = true,
|
|
||||||
},
|
|
||||||
inlay_hints = {
|
|
||||||
auto = true,
|
|
||||||
show_parameter_hints = true,
|
|
||||||
parameter_hints_prefix = "asdasd ",
|
|
||||||
other_hints_prefix = "dddd ",
|
|
||||||
only_current_line = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- all the opts to send to nvim-lspconfig
|
|
||||||
-- these override the defaults set by rust-tools.nvim
|
|
||||||
-- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer
|
|
||||||
-- server = {
|
|
||||||
-- -- on_attach is a callback called when the language server attachs to the buffer
|
|
||||||
-- on_attach = on_attach,
|
|
||||||
-- settings = {
|
|
||||||
-- -- to enable rust-analyzer settings visit:
|
|
||||||
-- -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc
|
|
||||||
-- ["rust-analyzer"] = {
|
|
||||||
-- -- enable clippy on save
|
|
||||||
-- checkOnSave = {
|
|
||||||
-- command = "clippy",
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
}
|
|
||||||
rt.inlay_hints.enable()
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue