Oxlint LSP with type-aware enabled is incredibly slow (neovim) #21317
Replies: 3 comments 7 replies
-
|
Can you include some additional information?
|
Beta Was this translation helpful? Give feedback.
-
|
I actually have Screen.Recording.2026-06-06.at.14.11.57.movThe project is quite large. I've also encountered cases where the lsp is stuck in a loop - highlighting the same error again and again. Trying to run @camc314 let me know if I can help further. |
Beta Was this translation helpful? Give feedback.
-
|
I'm struggling with the same thing. I worked out a horrible solution with Claude, but it works better than what I had. Now oxlint runs only on "InsertLeave", "BufReadPost" and "TextChanged" I'm sharing here in case anyone is interested. Problem: oxlint's pull diagnostics (textDocument/diagnostic) trigger on every
Solution: Disable automatic pull diagnostics and manually request them only How it works:
Our workaround:
vim.lsp.config("oxlint", {
-- Disable pull diagnostics capability so Neovim won't auto-request on every edit.
-- This makes oxlint's `run` setting take effect (it only works when the editor
-- "does not support textDocument/diagnostic").
-- https://oxc.rs/docs/guide/usage/linter/lsp-config-reference.html#run
capabilities = { textDocument = { diagnostic = vim.NIL } },
-- With pull diagnostics disabled, this controls when push diagnostics are sent.
-- We set "onSave" to prevent diagnostics while typing, then manually trigger
-- pull diagnostics on our preferred events below.
settings = { run = "onSave" },
})
-- When oxlint attaches, create buffer-local autocmds to manually request diagnostics.
-- We bypass Neovim's automatic pull diagnostic system entirely.
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if not client or client.name ~= "oxlint" then
return
end
local function request_diagnostics()
local params = {
textDocument = vim.lsp.util.make_text_document_params(args.buf),
}
-- Manually send a textDocument/diagnostic request
-- (even though we told Neovim the server doesn't support it, the server still does)
client:request("textDocument/diagnostic", params, function(err, result)
if err or not result then
return
end
local items = result.items or {}
-- Use the same namespace Neovim's LSP diagnostic system would use
local ns = vim.lsp.diagnostic.get_namespace(client.id)
-- Convert LSP Diagnostic objects to vim.Diagnostic format
-- (Neovim's internal handler does this automatically, but since we're
-- bypassing it, we need to do the conversion ourselves)
local diagnostics = vim.tbl_map(function(item)
return {
lnum = item.range.start.line,
col = item.range.start.character,
end_lnum = item.range["end"].line,
end_col = item.range["end"].character,
severity = item.severity,
message = item.message,
source = item.source or "oxlint",
code = item.code,
}
end, items)
-- Set diagnostics for this buffer in the LSP namespace
vim.diagnostic.set(ns, args.buf, diagnostics)
end, args.buf)
end
-- Request diagnostics immediately on attach
request_diagnostics()
-- Create buffer-local autocmds for this buffer only
local augroup = vim.api.nvim_create_augroup("OxlintDiagnostics" .. args.buf, { clear = true })
vim.api.nvim_create_autocmd({ "InsertLeave", "TextChanged" }, {
group = augroup,
buffer = args.buf,
callback = request_diagnostics,
})
end,
}) |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
neovim 0.12
oxlint 1.59.0
lazyvim 15.15.0
The oxlint LSP is normally very fast. However, when I enable
typeAwareas part of the lsp config it becomes extremely slow. After making an edit I can see it slowly responding to older text. It's so slow its making my editor chug along and I have to disable it.I'll try and get a video and make a minimal config but has anyone else experienced this?
Beta Was this translation helpful? Give feedback.
All reactions