diff --git a/lua/core/autocmds.lua b/lua/core/autocmds.lua index 6f4fe4a..c2f5ecf 100644 --- a/lua/core/autocmds.lua +++ b/lua/core/autocmds.lua @@ -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, }) diff --git a/lua/plugins/astrolsp.lua b/lua/plugins/astrolsp.lua index e1e908e..a046ea2 100644 --- a/lua/plugins/astrolsp.lua +++ b/lua/plugins/astrolsp.lua @@ -111,18 +111,11 @@ return { -- if client.name == "jedi_language_server" then client.server_capabilities.renameProvider = false end - if client.name == "pyrefly" then - -- client.server_capabilities.hoverProvider = false - -- client.server_capabilities.signatureHelpProvider = nil - client.server_capabilities.definitionProvider = false - -- client.server_capabilities.referencesProvider = false - -- client.server_capabilities.implementationProvider = false - end - if client.name == "pyright" then -- client.server_capabilities.renameProvider = false -- client.server_capabilities.definitionProvider = false - client.server_capabilities.inlayHintProvider = false + -- client.server_capabilities.diagnosticProvider = nil + -- client.server_capabilities.inlayHintProvider = nil client.server_capabilities.hoverProvider = false client.server_capabilities.signatureHelpProvider = nil client.server_capabilities.completionProvider = nil diff --git a/lua/plugins/configs/lsp/config/pyrefly.lua b/lua/plugins/configs/lsp/config/pyrefly.lua deleted file mode 100644 index cbfe0f5..0000000 --- a/lua/plugins/configs/lsp/config/pyrefly.lua +++ /dev/null @@ -1,42 +0,0 @@ - -return { - before_init = function(_, c) - if not c.settings then c.settings = {} end - if not c.settings.python then c.settings.python = {} end - c.settings.python.pythonPath = vim.fn.exepath "python3" - end, - settings = { - python = { - disableLanguageServices = true, - disableOrganizeImports = true, - disableTaggedHints = true, - openFilesOnly = true, - useLibraryCodeForTypes = false, - - analysis = { - useLibraryCodeForTypes = false, - autoImportCompletions = false, - diagnosticMode = "openFilesOnly", - typeCheckingMode = "off", - autoSearchPath = false, - logLevel = "Error", - verboseOutput = false, - pythonPlatform = "Linux", - exclude = { - "**/unsloth_compiled_cache/**", - "**/__pycache__/**", - "**/.venv/**", - "__index__", - "**/.*", - }, - ignore = { - "**/unsloth_compiled_cache/**", - "**/__pycache__/**", - "__index__", - "**/.venv/**", - "**/*.ipynb", - }, - }, - }, - }, -}