From 8dacb00b4d29d05b2a05b8ac43b7f782572a8a51 Mon Sep 17 00:00:00 2001 From: doryan Date: Mon, 23 Dec 2024 01:04:50 +0400 Subject: [PATCH] feat(lsp): add lsp configs for inline hints in js and lua files --- lua/config/plugins/lsp_config.lua | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 lua/config/plugins/lsp_config.lua diff --git a/lua/config/plugins/lsp_config.lua b/lua/config/plugins/lsp_config.lua new file mode 100644 index 0000000..2e026a0 --- /dev/null +++ b/lua/config/plugins/lsp_config.lua @@ -0,0 +1,50 @@ +local lspconfig = require("lspconfig") + +lspconfig.lua_ls.setup({ + settings = { + Lua = { + hint = { + enable = true, + }, + }, + } +}) + +lspconfig.eslint.setup({ + settings = { + codeActionOnSave = { + enable = true, + mode = "all", + }, + format = true, + } +}) + +lspconfig.ts_ls.setup({ + settings = { + typescript = { + inlayHints = { + includeInlayParameterNameHints = "all", -- 'none' | 'literals' | 'all' + includeInlayParameterNameHintsWhenArgumentMatchesName = false, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayVariableTypeHintsWhenTypeMatchesName = false, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + }, + }, + javascript = { + inlayHints = { + includeInlayParameterNameHints = "all", -- 'none' | 'literals' | 'all' + includeInlayParameterNameHintsWhenArgumentMatchesName = false, + includeInlayVariableTypeHints = true, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHintsWhenTypeMatchesName = false, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + }, + }, + } +})