configurating pyrefly 2
This commit is contained in:
@@ -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,
|
||||
})
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user