Files
dotfiles/.config/nvim.bak/lua/plugins/lsp.lua

192 lines
4.7 KiB
Lua

return {
-- LSP-Konfiguration
{
"neovim/nvim-lspconfig",
opts = {
servers = {
-- Python
pyright = {},
ruff_lsp = {},
-- TypeScript/JavaScript
tsserver = {
settings = {
typescript = {
inlayHints = {
includeInlayParameterNameHints = "all",
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
},
},
javascript = {
inlayHints = {
includeInlayParameterNameHints = "all",
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
},
},
},
},
-- PHP
intelephense = {
settings = {
intelephense = {
stubs = {
"bcmath",
"bz2",
"Core",
"curl",
"date",
"dom",
"fileinfo",
"filter",
"gd",
"gettext",
"hash",
"iconv",
"imap",
"intl",
"json",
"libxml",
"mbstring",
"mysqli",
"oci8",
"openssl",
"pcntl",
"pcre",
"PDO",
"pdo_mysql",
"Phar",
"readline",
"redis",
"Reflection",
"session",
"SimpleXML",
"SPL",
"standard",
"tokenizer",
"xml",
"xmlreader",
"xmlwriter",
"zip",
"zlib",
"wordpress",
"woocommerce",
"wordpress-globals",
"wp-cli",
},
environment = {
includePaths = {},
},
files = {
maxSize = 5000000,
},
},
},
},
-- Docker
dockerls = {},
docker_compose_language_service = {},
-- YAML
yamlls = {
settings = {
yaml = {
schemaStore = {
enable = true,
url = "https://www.schemastore.org/api/json/catalog.json",
},
format = { enable = true },
validate = true,
},
},
},
},
},
},
-- Mason für einfache Tool-Installation
{
"williamboman/mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, {
-- Python
"pyright",
"ruff-lsp",
"black",
"mypy",
-- TypeScript/JavaScript
"typescript-language-server",
"eslint-lsp",
"prettier",
-- PHP
"intelephense",
"php-cs-fixer",
-- Docker
"dockerfile-language-server",
-- YAML
"yaml-language-server",
"yamllint",
"yamlfix",
-- Neue Tools für alle Frameworks
"css-lsp",
"tailwindcss-language-server",
"vue-language-server",
"typescript-language-server",
"eslint-lsp",
"prettier",
"stylelint-lsp",
"phpactor",
})
end,
},
-- Formatierung
{
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
lua = { "stylua" },
python = { "black" },
typescript = { "prettier" },
javascript = { "prettier" },
typescriptreact = { "prettier" },
javascriptreact = { "prettier" },
php = { "php_cs_fixer" },
yaml = { "yamlfix" },
json = { "prettier" },
markdown = { "prettier" },
},
},
},
-- Linting
{
"mfussenegger/nvim-lint",
opts = {
linters_by_ft = {
python = { "mypy", "ruff" },
typescript = { "eslint" },
javascript = { "eslint" },
typescriptreact = { "eslint" },
javascriptreact = { "eslint" },
yaml = { "yamllint" },
},
},
},
}