Massive Updates

This commit is contained in:
sankalp committed 2024-01-07 22:32:54 +05:45
1 parent 007c2f8edb
commit 5f37d6c0ec
109 files changed
+7670 -3972

No files matched your search

@@ -1,6 +1,65 @@
local inlayHints = {
includeInlayParameterNameHints = "all",
includeInlayParameterNameHintsWhenArgumentMatchesName = true,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
includeInlayVariableTypeHintsWhenTypeMatchesName = true,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
includeInlayEnumMemberValueHints = true,
}
local function denoConfigExists()
local root = require("lazyvim.util.root").get() .. "/deno.json"
if vim.fn.filereadable(root) == 1 then
return true
end
return false
end
return {
{ import = "lazyvim.plugins.extras.lang.typescript" },
{ import = "lazyvim.plugins.extras.lang.json" },
{
"williamboman/mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "deno" })
end,
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
tsserver = {
init_options = {
preferences = {
disableSuggestions = true,
},
},
settings = {
typescript = {
inlayHints = inlayHints,
},
javascript = {
inlayHints = inlayHints,
},
},
},
denols = {
root_dir = require("lspconfig").util.root_pattern("deno.json", "deno.jsonc", "deno.lock"),
},
},
setup = {
tsserver = function(_, opts)
-- Disable tsserver if denols is present
return denoConfigExists()
end,
},
},
},
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
@@ -25,64 +84,6 @@ return {
"typescriptreact",
},
},
{
-- TODO: Need to look more into this plugin
"pmizio/typescript-tools.nvim",
enabled = false,
event = {
"BufRead *.js,*.jsx,*.mjs,*.cjs,*ts,*tsx",
"BufNewFile *.js,*.jsx,*.mjs,*.cjs,*ts,*tsx",
},
dependencies = {
"nvim-lua/plenary.nvim",
"neovim/nvim-lspconfig",
},
opts = {
on_attach = function(client, bufnr)
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
vim.keymap.set(
"n",
"gD",
"<Cmd>TSToolsGoToSourceDefinition<CR>",
{ buffer = bufnr, desc = "Source Definition" }
)
vim.keymap.set(
"n",
"<localleader>i",
"<Cmd>TSToolsAddMissingImports<CR>",
{ buffer = bufnr, desc = "Add missing imports" }
)
vim.keymap.set(
"n",
"<localleader>o",
"<Cmd>TSToolsOrganizeImports<CR>",
{ buffer = bufnr, desc = "Organize imports" }
)
vim.keymap.set(
"n",
"<localleader>r",
"<Cmd>TSToolsRemoveUnused<CR>",
{ buffer = bufnr, desc = "Remove unused variables" }
)
vim.keymap.set("n", "<localleader>f", "<Cmd>TSToolsFixAll<CR>", { buffer = bufnr, desc = "Fix all" })
end,
settings = {
tsserver_file_preferences = {
includeInlayParameterNameHints = "all",
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
includeInlayEnumMemberValueHints = true,
},
},
code_lens = "all",
},
},
{
"nvim-neotest/neotest",
optional = true,