Skip to content

Commit 647b352

Browse files
committed
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.
1 parent 611ed89 commit 647b352

File tree

3 files changed

+93
-39
lines changed

3 files changed

+93
-39
lines changed

.tmuxp.nvim.half.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"session_name": "nvim",
3+
"tmux_options": "-f /Users/dlond/.config/tmux/tmux.conf",
4+
"windows": [
5+
{
6+
"window_name": "editor",
7+
"layout": "even-vertical",
8+
"panes": [
9+
{ "shell_command": ["nvim ."] },
10+
{ "shell_command": [] }
11+
]
12+
}
13+
]
14+
}

lua/plugins/config/lsp/servers.lua

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,21 @@ function M.get_servers()
6767
analysis = {
6868
autoSearchPaths = true,
6969
diagnosticMode = 'openFilesOnly',
70-
typeCheckingMode = 'standard',
70+
typeCheckingMode = 'basic',
7171
useLibraryCodeForTypes = true,
7272

7373
diagnosticSeverityOverrides = {
7474
reportOptionalCall = 'none',
7575
reportOptionalSubscript = 'none',
76+
reportOptionalMemberAccess = 'none',
77+
reportOptionalIterable = 'none',
7678
reportAttributeAccessIssue = 'none',
77-
reportUnknownMemberType = 'warning',
78-
reportUnknownVariableType = 'warning',
79-
reportUnknownAssignmentType = 'warning',
79+
reportUnknownMemberType = 'none',
80+
reportUnknownVariableType = 'none',
81+
reportUnknownArgumentType = 'none',
82+
reportUnknownParameterType = 'none',
83+
reportUnknownAssignmentType = 'none',
84+
reportMissingTypeStubs = 'none',
8085
},
8186
},
8287
},
@@ -99,6 +104,41 @@ function M.get_servers()
99104
root_dir = util.root_pattern('CMakeLists.txt', '.git'),
100105
},
101106

107+
-- Lua Language Server
108+
lua_ls = {
109+
settings = {
110+
Lua = {
111+
runtime = { version = 'LuaJIT' },
112+
diagnostics = {
113+
globals = { 'vim' },
114+
},
115+
workspace = {
116+
library = vim.api.nvim_get_runtime_file('', true),
117+
checkThirdParty = false,
118+
},
119+
telemetry = { enable = false },
120+
},
121+
},
122+
},
123+
124+
-- Bash Language Server
125+
bashls = {},
126+
127+
-- YAML Language Server
128+
yamlls = {},
129+
130+
-- JSON Language Server
131+
jsonls = {},
132+
133+
-- Markdown Language Server
134+
marksman = {},
135+
136+
-- TOML Language Server
137+
taplo = {},
138+
139+
-- SQL Language Server
140+
sqls = {},
141+
102142
-- Add more servers here as needed
103143
-- Example:
104144
-- rust_analyzer = {

lua/plugins/spec/formatting.lua

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
-- Formatter configuration
22

33
return {
4-
-- ========================================
5-
-- Formatter Configuration (conform.nvim)
6-
-- ========================================
7-
{
8-
'stevearc/conform.nvim',
9-
event = 'BufWritePre', -- Format on save
10-
-- cmd = { 'ConformInfo' }, -- Optional: If you want the command available
11-
-- keys = { ... } -- Optional: Define keys if needed
12-
opts = {
13-
formatters_by_ft = {
14-
lua = { 'stylua' },
15-
c = { 'clang_format' },
16-
cpp = { 'clang_format' },
17-
-- Use ruff for Python formatting (includes isort and is faster than black
18-
-- Ensure 'ruff' is installed via Home Manager (pkgs.ruff)
19-
python = { 'ruff_format', 'ruff_fix' },
20-
-- python = { 'isort', 'black' },
21-
nix = { 'alejandra' }, -- Add nix formatter
22-
-- Add other filetypes and formatters, e.g.:
23-
-- javascript = { "prettier" },
24-
-- typescript = { "prettier" },
25-
-- css = { "prettier" },
26-
-- html = { "prettier" },
27-
-- json = { "prettier" },
28-
-- yaml = { "prettier" },
29-
-- markdown = { "prettier" },
30-
-- bash = { "shfmt" },
31-
},
32-
-- Configure format_on_save behavior
33-
format_on_save = {
34-
-- I recommend these options, but adjust to your liking
35-
timeout_ms = 500, -- Stop formatting if it takes too long
36-
lsp_fallback = true, -- Fallback to LSP formatting if conform fails
37-
},
38-
},
4+
-- ========================================
5+
-- Formatter Configuration (conform.nvim)
6+
-- ========================================
7+
{
8+
'stevearc/conform.nvim',
9+
event = 'BufWritePre', -- Format on save
10+
-- cmd = { 'ConformInfo' }, -- Optional: If you want the command available
11+
-- keys = { ... } -- Optional: Define keys if needed
12+
opts = {
13+
formatters_by_ft = {
14+
lua = { 'stylua' },
15+
c = { 'clang_format' },
16+
cpp = { 'clang_format' },
17+
python = { 'ruff_organize_imports', 'ruff_format', 'ruff_fix' },
18+
nix = { 'alejandra' }, -- Add nix formatter
19+
-- Add other filetypes and formatters, e.g.:
20+
javascript = { 'prettier' },
21+
typescript = { 'prettier' },
22+
css = { 'prettier' },
23+
html = { 'prettier' },
24+
json = { 'prettier' },
25+
yaml = { 'prettier' },
26+
markdown = { 'prettier' },
27+
bash = { 'shfmt' },
28+
sh = { 'shfmt' },
29+
cmake = { 'cmake_format' },
30+
sql = { 'sqlfluff' },
31+
},
32+
-- Configure format_on_save behavior
33+
format_on_save = {
34+
-- I recommend these options, but adjust to your liking
35+
timeout_ms = 500, -- Stop formatting if it takes too long
36+
lsp_fallback = true, -- Fallback to LSP formatting if conform fails
37+
},
3938
},
39+
},
4040
}

0 commit comments

Comments
 (0)