configurating pyrefly

This commit is contained in:
huyjaky
2026-01-04 10:30:04 +07:00
parent 70f0c7fe5d
commit d409682cc6
7 changed files with 92 additions and 108 deletions

View File

@@ -35,36 +35,31 @@ vim.api.nvim_create_autocmd("BufWinEnter", {
command = "let @/ = ''",
})
-- vim.lsp.config("pyrefly", {
-- -- example of how to run `uv` installed Pyrefly without adding to your path
-- cmd = { "uvx", "pyrefly", "-c", "~/.config/nvim/pyrefly_config.yaml", "lsp" },
-- capabilities = {
-- textDocument = {
-- completion = {
-- completionItem = {
-- snippetSupport = false,
-- preselectSupport = false,
-- },
-- },
-- },
-- },
-- })
vim.api.nvim_create_autocmd("FileType", {
pattern = "markdown",
callback = function() vim.opt_local.spell = false end,
})
vim.lsp.enable "pyrefly"
vim.lsp.config("pyrefly", {
cmd = {
"uvx",
"pyrefly",
"lsp",
},
capabilities = {
textDocument = {
completion = {
completionItem = {
snippetSupport = false,
preselectSupport = false,
},
},
},
-- example of how to run `uv` installed Pyrefly without adding to your path
cmd = { "uvx", "pyrefly", "lsp" },
filetypes = { 'python' },
root_markers = {
'pyrefly.toml',
'pyproject.toml',
'setup.py',
'setup.cfg',
'requirements.txt',
'Pipfile',
'.git',
'.venv',
'.env',
},
on_init = function(client)
client.server_capabilities.definitionProvider = false
client.server_capabilities.renameProvider = false
client.server_capabilities.diagnosticProvider = false
-- client.server_capabilities.inlayHintProvider = false
end,
})