feat: complete LSP and formatter configuration
- Add missing LSPs: lua_ls, bashls, yamlls, jsonls, marksman, taplo, sqls - Add missing formatters: prettier, shfmt, sqlfluff, cmake_format - Configure ruff with import organization and auto-fixes - Tune basedpyright to reduce diagnostic noise (basic mode) All LSPs verified attaching and formatters working correctly.
This commit is contained in:
parent
611ed89f33
commit
647b352970
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"session_name": "nvim",
|
||||||
|
"tmux_options": "-f /Users/dlond/.config/tmux/tmux.conf",
|
||||||
|
"windows": [
|
||||||
|
{
|
||||||
|
"window_name": "editor",
|
||||||
|
"layout": "even-vertical",
|
||||||
|
"panes": [
|
||||||
|
{ "shell_command": ["nvim ."] },
|
||||||
|
{ "shell_command": [] }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -67,16 +67,21 @@ function M.get_servers()
|
||||||
analysis = {
|
analysis = {
|
||||||
autoSearchPaths = true,
|
autoSearchPaths = true,
|
||||||
diagnosticMode = 'openFilesOnly',
|
diagnosticMode = 'openFilesOnly',
|
||||||
typeCheckingMode = 'standard',
|
typeCheckingMode = 'basic',
|
||||||
useLibraryCodeForTypes = true,
|
useLibraryCodeForTypes = true,
|
||||||
|
|
||||||
diagnosticSeverityOverrides = {
|
diagnosticSeverityOverrides = {
|
||||||
reportOptionalCall = 'none',
|
reportOptionalCall = 'none',
|
||||||
reportOptionalSubscript = 'none',
|
reportOptionalSubscript = 'none',
|
||||||
|
reportOptionalMemberAccess = 'none',
|
||||||
|
reportOptionalIterable = 'none',
|
||||||
reportAttributeAccessIssue = 'none',
|
reportAttributeAccessIssue = 'none',
|
||||||
reportUnknownMemberType = 'warning',
|
reportUnknownMemberType = 'none',
|
||||||
reportUnknownVariableType = 'warning',
|
reportUnknownVariableType = 'none',
|
||||||
reportUnknownAssignmentType = 'warning',
|
reportUnknownArgumentType = 'none',
|
||||||
|
reportUnknownParameterType = 'none',
|
||||||
|
reportUnknownAssignmentType = 'none',
|
||||||
|
reportMissingTypeStubs = 'none',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -99,6 +104,41 @@ function M.get_servers()
|
||||||
root_dir = util.root_pattern('CMakeLists.txt', '.git'),
|
root_dir = util.root_pattern('CMakeLists.txt', '.git'),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Lua Language Server
|
||||||
|
lua_ls = {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = { version = 'LuaJIT' },
|
||||||
|
diagnostics = {
|
||||||
|
globals = { 'vim' },
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
library = vim.api.nvim_get_runtime_file('', true),
|
||||||
|
checkThirdParty = false,
|
||||||
|
},
|
||||||
|
telemetry = { enable = false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Bash Language Server
|
||||||
|
bashls = {},
|
||||||
|
|
||||||
|
-- YAML Language Server
|
||||||
|
yamlls = {},
|
||||||
|
|
||||||
|
-- JSON Language Server
|
||||||
|
jsonls = {},
|
||||||
|
|
||||||
|
-- Markdown Language Server
|
||||||
|
marksman = {},
|
||||||
|
|
||||||
|
-- TOML Language Server
|
||||||
|
taplo = {},
|
||||||
|
|
||||||
|
-- SQL Language Server
|
||||||
|
sqls = {},
|
||||||
|
|
||||||
-- Add more servers here as needed
|
-- Add more servers here as needed
|
||||||
-- Example:
|
-- Example:
|
||||||
-- rust_analyzer = {
|
-- rust_analyzer = {
|
||||||
|
|
|
@ -1,40 +1,40 @@
|
||||||
-- Formatter configuration
|
-- Formatter configuration
|
||||||
|
|
||||||
return {
|
return {
|
||||||
-- ========================================
|
-- ========================================
|
||||||
-- Formatter Configuration (conform.nvim)
|
-- Formatter Configuration (conform.nvim)
|
||||||
-- ========================================
|
-- ========================================
|
||||||
{
|
{
|
||||||
'stevearc/conform.nvim',
|
'stevearc/conform.nvim',
|
||||||
event = 'BufWritePre', -- Format on save
|
event = 'BufWritePre', -- Format on save
|
||||||
-- cmd = { 'ConformInfo' }, -- Optional: If you want the command available
|
-- cmd = { 'ConformInfo' }, -- Optional: If you want the command available
|
||||||
-- keys = { ... } -- Optional: Define keys if needed
|
-- keys = { ... } -- Optional: Define keys if needed
|
||||||
opts = {
|
opts = {
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { 'stylua' },
|
lua = { 'stylua' },
|
||||||
c = { 'clang_format' },
|
c = { 'clang_format' },
|
||||||
cpp = { 'clang_format' },
|
cpp = { 'clang_format' },
|
||||||
-- Use ruff for Python formatting (includes isort and is faster than black
|
python = { 'ruff_organize_imports', 'ruff_format', 'ruff_fix' },
|
||||||
-- Ensure 'ruff' is installed via Home Manager (pkgs.ruff)
|
nix = { 'alejandra' }, -- Add nix formatter
|
||||||
python = { 'ruff_format', 'ruff_fix' },
|
-- Add other filetypes and formatters, e.g.:
|
||||||
-- python = { 'isort', 'black' },
|
javascript = { 'prettier' },
|
||||||
nix = { 'alejandra' }, -- Add nix formatter
|
typescript = { 'prettier' },
|
||||||
-- Add other filetypes and formatters, e.g.:
|
css = { 'prettier' },
|
||||||
-- javascript = { "prettier" },
|
html = { 'prettier' },
|
||||||
-- typescript = { "prettier" },
|
json = { 'prettier' },
|
||||||
-- css = { "prettier" },
|
yaml = { 'prettier' },
|
||||||
-- html = { "prettier" },
|
markdown = { 'prettier' },
|
||||||
-- json = { "prettier" },
|
bash = { 'shfmt' },
|
||||||
-- yaml = { "prettier" },
|
sh = { 'shfmt' },
|
||||||
-- markdown = { "prettier" },
|
cmake = { 'cmake_format' },
|
||||||
-- bash = { "shfmt" },
|
sql = { 'sqlfluff' },
|
||||||
},
|
},
|
||||||
-- Configure format_on_save behavior
|
-- Configure format_on_save behavior
|
||||||
format_on_save = {
|
format_on_save = {
|
||||||
-- I recommend these options, but adjust to your liking
|
-- I recommend these options, but adjust to your liking
|
||||||
timeout_ms = 500, -- Stop formatting if it takes too long
|
timeout_ms = 500, -- Stop formatting if it takes too long
|
||||||
lsp_fallback = true, -- Fallback to LSP formatting if conform fails
|
lsp_fallback = true, -- Fallback to LSP formatting if conform fails
|
||||||
},
|
},
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue