configurating pyrefly 2

This commit is contained in:
huyjaky
2026-01-04 18:25:52 +07:00
parent d409682cc6
commit 2cbd3d8d24
3 changed files with 35 additions and 64 deletions

View File

@@ -43,23 +43,43 @@ vim.api.nvim_create_autocmd("FileType", {
vim.lsp.enable "pyrefly"
vim.lsp.config("pyrefly", {
-- example of how to run `uv` installed Pyrefly without adding to your path
cmd = { "uvx", "pyrefly", "lsp" },
filetypes = { 'python' },
cmd = { "pyrefly", "lsp" },
filetypes = { "python" },
root_markers = {
'pyrefly.toml',
'pyproject.toml',
'setup.py',
'setup.cfg',
'requirements.txt',
'Pipfile',
'.git',
'.venv',
'.env',
"pyrefly.toml",
"pyproject.toml",
"setup.py",
"setup.cfg",
"requirements.txt",
"Pipfile",
".git",
".venv",
".env",
},
settings = {
python = {
pyrefly = {
-- reportMissingTypeStubs = false,
-- reportUnusedImport = false,
-- reportUnusedVariable = false,
-- strict = false,
-- displayTypeErrors = false,
-- analyzeUnannotatedFunctions = false,
displayTypeErrors = "error-missing-imports",
analysis = {
diagnosticMode = "off",
showHoverGoToLinks = false,
},
},
},
},
handlers = {
["textDocument/publishDiagnostics"] = function() end,
},
on_init = function(client)
client.server_capabilities.definitionProvider = false
client.server_capabilities.renameProvider = false
client.server_capabilities.diagnosticProvider = false
-- client.server_capabilities.inlayHintProvider = false
client.server_capabilities.diagnosticProvider = nil
-- client.server_capabilities.inlayHintProvider = nil
end,
})