Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: silence luals warnings #3578

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lua/lspconfig/configs.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-- This entire module will only be usfeul for Nvim older than 0.11, since vim.lsp.config makes this module obsolete. So
-- it's easier to just disable all warnings for now and remove this file when it's no longer relevant.
--- @diagnostic disable: assign-type-mismatch
--- @diagnostic disable: param-type-mismatch

local util = require 'lspconfig.util'
local async = require 'lspconfig.async'
local api, validate, lsp, fn = vim.api, vim.validate, vim.lsp, vim.fn
Expand Down
4 changes: 4 additions & 0 deletions plugin/lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ end, {
api.nvim_create_user_command('LspRestart', function(info)
local detach_clients = {}
for _, client in ipairs(get_clients_from_cmd_args(info.args)) do
-- Can remove diagnostic disabling when changing to client:stop() in nvim 0.11+
--- @diagnostic disable: missing-parameter
client.stop()
if vim.tbl_count(client.attached_buffers) > 0 then
detach_clients[client.name] = { client, lsp.get_buffers_by_client_id(client.id) }
Expand Down Expand Up @@ -142,6 +144,8 @@ api.nvim_create_user_command('LspStop', function(info)
end

for _, client in ipairs(clients) do
-- Can remove diagnostic disabling when changing to client:stop(force) in nvim 0.11+
--- @diagnostic disable: param-type-mismatch
client.stop(force)
end
end, {
Expand Down
Loading