Skip to content

[audit] Normalize vim.lsp.config call style for luals and sourcekit - #166

Merged
stanfish06 merged 1 commit into
masterfrom
audit/lsp-config-style
Jun 9, 2026
Merged

stanfish06 merged 1 commit into
masterfrom
audit/lsp-config-style

Conversation

@stanfish06

Copy link
Copy Markdown
Owner

What

Normalize vim.lsp.config call style: replace bracket-index assignment with the documented function-call form for luals and sourcekit.

Where

lua/config/plugin_config.lua

  • Lines 64–75: vim.lsp.config["luals"] = {…} → vim.lsp.config("luals", {…})
  • Lines 101–105: vim.lsp.config["sourcekit"] = {…} → vim.lsp.config("sourcekit", {…})

pyright on line 79 already used the function-call form — this makes all three consistent.

Why

vim.lsp.config has a metatable that accepts both table-index and function-call assignment, so there is no current runtime difference. But the documented API since Neovim 0.11 is vim.lsp.config("name", spec). The mixed style is confusing when reading the file and increases the risk that a future Neovim cleanup removes the table-assignment alias.

Test plan

  • :lua vim.lsp.get_clients() shows luals after opening a .lua file
  • :lua vim.lsp.get_clients() shows sourcekit after opening a .swift file (macOS only)

Generated by Claude Code

luals and sourcekit were configured via table-index assignment
(vim.lsp.config["name"] = {...}) while pyright used the documented
function-call form (vim.lsp.config("name", {...})). Normalize both to
the function-call API so all custom server specs read consistently.

https://claude.ai/code/session_01G8jrJVQBJmgdbZnCY86mXc
@stanfish06
stanfish06 merged commit 8434a6e into master Jun 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants