replace basedpyright instead by pyrefly and checking syntax by pyright
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"AstroNvim": { "branch": "main", "commit": "55a2b084eabe880c4ffa377f82bb972caec57e09" },
|
||||
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
|
||||
"LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" },
|
||||
"aerial.nvim": { "branch": "master", "commit": "6ab1a0ce4874d21610fc5a67a6c82c7b943c635b" },
|
||||
"astrocore": { "branch": "main", "commit": "c797dd5a592e2bd154f2503e231b8a4083659534" },
|
||||
"astrolsp": { "branch": "main", "commit": "0befe28a4ea96e46b7f7c01e4a634c04225ba55a" },
|
||||
@@ -11,22 +11,22 @@
|
||||
"better-escape.nvim": { "branch": "master", "commit": "199dcc2643dec5d8dbdab4ec672cf405224dcb3b" },
|
||||
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
|
||||
"copilot.vim": { "branch": "release", "commit": "da369d90cfd6c396b1d0ec259836a1c7222fb2ea" },
|
||||
"flash.nvim": { "branch": "main", "commit": "3be9bf7e85550045ec576379a0c45aac144d0438" },
|
||||
"flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "7010000889bfb6c26065e0b0f7f1e6aa9163edd9" },
|
||||
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
|
||||
"heirline.nvim": { "branch": "master", "commit": "fae936abb5e0345b85c3a03ecf38525b0828b992" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "db067881fff0fd4be8c00e5bde7492e0e1c77a2f" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "e6a8824858757ca9cd4f5ae1a72d845fa5c46a39" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "01bc2aacd51cf9021eb19d048e70ce3dd09f7f93" },
|
||||
"lsp_signature.nvim": { "branch": "master", "commit": "62cadce83aaceed677ffe7a2d6a57141af7131ea" },
|
||||
"markview.nvim": { "branch": "main", "commit": "c93ea99d96b4bfda5b7c7d0dfca9c26edf6e78f0" },
|
||||
"markview.nvim": { "branch": "main", "commit": "b41c643a8b99ea556e4dcefb60dbc043f75eb20d" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
|
||||
"mason-null-ls.nvim": { "branch": "main", "commit": "2b8433f76598397fcc97318d410e0c4f7a4bea6a" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
|
||||
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
||||
"mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" },
|
||||
"mini.move": { "branch": "main", "commit": "f33406ae7d95b931c6a0d3ba11e50983fe800afb" },
|
||||
"mini.move": { "branch": "main", "commit": "4d214202d71e0a4066b6288176bbe88f268f9777" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "8cdd6b1940f333c1dd085526a9c45b30fb2dbf50" },
|
||||
"neoconf.nvim": { "branch": "main", "commit": "7a8d7fd36f95f5cbbf57d4a5c463f6c54ad54cd3" },
|
||||
"none-ls-extras.nvim": { "branch": "main", "commit": "402c6b5c29f0ab57fac924b863709f37f55dc298" },
|
||||
@@ -49,7 +49,7 @@
|
||||
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
|
||||
"resession.nvim": { "branch": "master", "commit": "cc819b0489938d03e4f3532a583354f0287c015b" },
|
||||
"smart-splits.nvim": { "branch": "master", "commit": "ddb23c1a1cf1507bda487cda7f6e4690965ef9f5" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "fc84ed42a44247a99846f6e8d87f0482f15c1787" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "eadb0ca316ee9af078a181ff9517ce54cb048769" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
|
||||
"ultimate-autopair.nvim": { "branch": "v0.6", "commit": "6a51446c2c8f09a7c207d2dc2aaa5bbbda36e093" },
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
-- Some commands that I want to execute in specific timing
|
||||
vim.api.nvim_create_augroup("disable_comment_newline", { clear = true })
|
||||
vim.api.nvim_create_augroup("auto_wrap", { clear = true })
|
||||
@@ -35,3 +34,37 @@ vim.api.nvim_create_autocmd("BufWinEnter", {
|
||||
pattern = "*",
|
||||
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.lsp.enable "pyrefly"
|
||||
vim.lsp.config("pyrefly", {
|
||||
cmd = {
|
||||
"uvx",
|
||||
"pyrefly",
|
||||
"lsp",
|
||||
},
|
||||
capabilities = {
|
||||
textDocument = {
|
||||
completion = {
|
||||
completionItem = {
|
||||
snippetSupport = false,
|
||||
preselectSupport = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -10,23 +10,26 @@ return {
|
||||
features = {
|
||||
autoformat = false, -- enable or disable auto formatting on start
|
||||
codelens = true, -- enable/disable codelens refresh on start
|
||||
inlay_hints = false, -- enable/disable inlay hints on start
|
||||
semantic_tokens = true, -- enable/disable semantic token highlighting
|
||||
inlay_hints = true, -- enable/disable inlay hints on start
|
||||
semantic_tokens = false, -- enable/disable semantic token highlighting
|
||||
},
|
||||
-- customize lsp formatting options
|
||||
formatting = require "plugins.configs.lsp.formatting",
|
||||
-- enable servers that you already have installed without mason
|
||||
|
||||
servers = {},
|
||||
-- customize language server configuration options passed to `lspconfig`
|
||||
servers = {}, -- customize language server configuration options passed to `lspconfig`
|
||||
|
||||
---@diagnostic disable: missing-fields
|
||||
config = {
|
||||
-- clangd = require "plugins.configs.lsp.config.clangd",
|
||||
basedpyright = require "plugins.configs.lsp.config.basedpyright",
|
||||
jedi_language_server = require "plugins.configs.lsp.config.jedi_language",
|
||||
pyright = require "plugins.configs.lsp.config.pyright",
|
||||
ruff = require "plugins.configs.lsp.config.ruff",
|
||||
pylsp = require "plugins.configs.lsp.config.pylsp",
|
||||
-- basedpyright = require "plugins.configs.lsp.config.basedpyright",
|
||||
-- clangd = require "plugins.configs.lsp.config.clangd",
|
||||
-- jedi_language_server = require "plugins.configs.lsp.config.jedi_language",
|
||||
-- ruff = require "plugins.configs.lsp.config.ruff",
|
||||
-- pylsp = require "plugins.configs.lsp.config.pylsp",
|
||||
pyrefly = {
|
||||
|
||||
}
|
||||
},
|
||||
-- customize how language servers are attached
|
||||
handlers = {
|
||||
@@ -37,11 +40,11 @@ return {
|
||||
-- the key is the server that is being setup with `lspconfig`
|
||||
-- rust_analyzer = false, -- setting a handler to false will disable the set up of that language server
|
||||
-- pyright = function(_, opts) require("lspconfig").pyright.setup(opts) end -- or a custom handler function can be passed
|
||||
|
||||
},
|
||||
-- Configure buffer local auto commands to add when attaching a language server
|
||||
autocmds = {
|
||||
-- first key is the `augroup` to add the auto commands to (:h augroup)
|
||||
|
||||
lsp_document_highlight = {
|
||||
-- Optional condition to create/delete auto command group
|
||||
-- can either be a string of a client capability or a function of `fun(client, bufnr): boolean`
|
||||
@@ -63,6 +66,8 @@ return {
|
||||
callback = function() vim.lsp.buf.clear_references() end,
|
||||
},
|
||||
},
|
||||
|
||||
-- NOTE: start
|
||||
-- disable inlay hints in insert mode
|
||||
disable_inlay_hints_on_insert = {
|
||||
-- only create for language servers that support inlay hints
|
||||
@@ -89,6 +94,7 @@ return {
|
||||
end,
|
||||
},
|
||||
},
|
||||
-- ----------------------------------------------------------------------------------
|
||||
},
|
||||
-- mappings to be set up on attaching of a language server
|
||||
mappings = {
|
||||
@@ -99,55 +105,84 @@ return {
|
||||
on_attach = function(client, bufnr)
|
||||
-- this would disable semanticTokensProvider for all clients
|
||||
-- client.server_capabilities.semanticTokensProvider = nil
|
||||
|
||||
-- Disable ruff_lsp hover in favor of pyright
|
||||
if client.name == "ruff" then
|
||||
client.server_capabilities.hoverProvider = false
|
||||
client.server_capabilities.completionProvider = false
|
||||
end
|
||||
|
||||
-- if client.name == "pyright" then
|
||||
-- -- disable pyright analysis features
|
||||
-- client.server_capabilities.documentFormattingProvider = false
|
||||
-- if client.name == "ruff" then
|
||||
-- client.server_capabilities.hoverProvider = false
|
||||
|
||||
-- client.server_capabilities.completionProvider = false
|
||||
-- end
|
||||
|
||||
if client.name == "jedi_language_server" then client.server_capabilities.renameProvider = false end
|
||||
-- if client.name == "jedi_language_server" then client.server_capabilities.renameProvider = false end
|
||||
|
||||
if client.name == "basedpyright" then
|
||||
-- client.server_capabilities.completionProvider = false
|
||||
-- client.server_capabilities.hoverProvider = false
|
||||
-- client.server_capabilities.renameProvider = false
|
||||
-- client.server_capabilities.definitionProvider = false
|
||||
-- client.server_capabilities.signatureHelpProvider = false
|
||||
|
||||
client.server_capabilities.codeLensProvider = false
|
||||
if client.name == "pyright" then
|
||||
client.server_capabilities.hoverProvider = false
|
||||
client.server_capabilities.renameProvider = false
|
||||
client.server_capabilities.signatureHelpProvider = nil
|
||||
client.server_capabilities.completionProvider = nil
|
||||
client.server_capabilities.definitionProvider = false
|
||||
client.server_capabilities.codeLensProvider = nil
|
||||
client.server_capabilities.colorProvider = false
|
||||
client.server_capabilities.callHierarchyProvider = false
|
||||
client.server_capabilities.documentFormattingProvider = false
|
||||
client.server_capabilities.documentRangeFormattingProvider = false
|
||||
client.server_capabilities.declarationProvider = false
|
||||
client.server_capabilities.documentLinkProvider = false
|
||||
client.server_capabilities.documentOnTypeFormattingProvider = false
|
||||
client.server_capabilities.documentLinkProvider = nil
|
||||
client.server_capabilities.documentOnTypeFormattingProvider = nil
|
||||
client.server_capabilities.documentSymbolProvider = false
|
||||
client.server_capabilities.inlineCompletionProvider = false
|
||||
client.server_capabilities.inlineValueProvider = false
|
||||
client.server_capabilities.notebookDocumentSync = false
|
||||
client.server_capabilities.notebookDocumentSync = nil
|
||||
client.server_capabilities.typeDefinitionProvider = false
|
||||
client.server_capabilities.workspaceSymbolProvider = false
|
||||
client.server_capabilities.monikerProvider = false
|
||||
client.server_capabilities.semanticTokensProvider = false
|
||||
client.server_capabilities.semanticTokensProvider = nil
|
||||
client.server_capabilities.referencesProvider = false
|
||||
client.server_capabilities.implementationProvider = false
|
||||
client.server_capabilities.foldingRangeProvider = false
|
||||
client.server_capabilities.selectionRangeProvider = false
|
||||
client.server_capabilities.linkedEditingRangeProvider = false
|
||||
client.server_capabilities.executeCommandProvider = false
|
||||
client.server_capabilities.executeCommandProvider = nil
|
||||
client.server_capabilities.workspace = {
|
||||
workspaceFolders = { supported = false },
|
||||
fileOperations = { supported = false },
|
||||
}
|
||||
end
|
||||
|
||||
-- if client.name == "basedpyright" then
|
||||
-- -- client.server_capabilities.definitionProvider = false # turn on inlay hints
|
||||
-- client.server_capabilities.renameProvider = false
|
||||
-- client.server_capabilities.completionProvider = nil
|
||||
-- client.server_capabilities.hoverProvider = false
|
||||
-- client.server_capabilities.signatureHelpProvider = nil
|
||||
--
|
||||
-- client.server_capabilities.codeLensProvider = nil
|
||||
-- client.server_capabilities.colorProvider = false
|
||||
-- client.server_capabilities.callHierarchyProvider = false
|
||||
-- client.server_capabilities.documentFormattingProvider = false
|
||||
-- client.server_capabilities.documentRangeFormattingProvider = false
|
||||
-- client.server_capabilities.declarationProvider = false
|
||||
-- client.server_capabilities.documentLinkProvider = nil
|
||||
-- client.server_capabilities.documentOnTypeFormattingProvider = nil
|
||||
-- client.server_capabilities.documentSymbolProvider = false
|
||||
-- client.server_capabilities.inlineCompletionProvider = false
|
||||
-- client.server_capabilities.inlineValueProvider = false
|
||||
-- client.server_capabilities.notebookDocumentSync = nil
|
||||
-- client.server_capabilities.typeDefinitionProvider = false
|
||||
-- client.server_capabilities.workspaceSymbolProvider = false
|
||||
-- client.server_capabilities.monikerProvider = false
|
||||
-- client.server_capabilities.semanticTokensProvider = nil
|
||||
-- client.server_capabilities.referencesProvider = false
|
||||
-- client.server_capabilities.implementationProvider = false
|
||||
-- client.server_capabilities.foldingRangeProvider = false
|
||||
-- client.server_capabilities.selectionRangeProvider = false
|
||||
-- client.server_capabilities.linkedEditingRangeProvider = false
|
||||
-- client.server_capabilities.executeCommandProvider = nil
|
||||
-- client.server_capabilities.workspace = {
|
||||
-- workspaceFolders = { supported = false },
|
||||
-- fileOperations = { supported = false },
|
||||
-- }
|
||||
-- end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ return {
|
||||
completion = {
|
||||
list = {
|
||||
selection = {
|
||||
preselect = true,
|
||||
-- preselect = true,
|
||||
-- auto_insert = true,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -5,33 +5,42 @@ return {
|
||||
c.settings.python.pythonPath = vim.fn.exepath "python3"
|
||||
end,
|
||||
settings = {
|
||||
|
||||
python = false,
|
||||
basedpyright = {
|
||||
disableLanguageServices = false,
|
||||
disableOrganizeImports = true,
|
||||
disableTaggedHints = true,
|
||||
|
||||
useLibraryCodeForTypes = false,
|
||||
useLibraryCodeForTypes = true,
|
||||
openFilesOnly = true,
|
||||
|
||||
analysis = {
|
||||
autoSearchPath = false,
|
||||
useLibraryCodeForTypes = false,
|
||||
logLevel = "Trace",
|
||||
|
||||
typeCheckingMode = "basic",
|
||||
verboseOutput = false,
|
||||
autoImportCompletions = false,
|
||||
pythonPlatform = "Linux",
|
||||
autoSearchPaths = true,
|
||||
deprecateTypingAliases = false,
|
||||
diagnosticMode = "openFilesOnly",
|
||||
logLevel = "Error",
|
||||
typeCheckingMode = "off",
|
||||
inlayHints = {
|
||||
variableTypes = true,
|
||||
variableTypes = false,
|
||||
genericTypes = true,
|
||||
callArgumentNames = false,
|
||||
callArgumentNames = true,
|
||||
},
|
||||
exclude = {
|
||||
"**/unsloth_compiled_cache/**",
|
||||
"**/__pycache__/**",
|
||||
"**/.venv/**",
|
||||
"__index__",
|
||||
"**/.*",
|
||||
},
|
||||
ignore = {
|
||||
"**/unsloth_compiled_cache/**",
|
||||
"**/__pycache__/**",
|
||||
"__index__",
|
||||
"**/.venv/**",
|
||||
"**/*.ipynb",
|
||||
},
|
||||
autoImportCompletions = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -5,15 +5,36 @@ return {
|
||||
c.settings.python.pythonPath = vim.fn.exepath "python3"
|
||||
end,
|
||||
settings = {
|
||||
pyright = {
|
||||
disableLanguageServices = false,
|
||||
python = {
|
||||
disableLanguageServices = true,
|
||||
disableOrganizeImports = true,
|
||||
disableTaggedHints = true,
|
||||
openFilesOnly = true,
|
||||
useLibraryCodeForTypes = false,
|
||||
|
||||
analysis = {
|
||||
useLibraryCodeForTypes = false,
|
||||
autoImportCompletions = false,
|
||||
diagnosticMode = "openFilesOnly",
|
||||
typeCheckingMode = "basic",
|
||||
autoSearchPath = true,
|
||||
-- diagnosticSeverityOverrides = false,
|
||||
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",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -9,7 +9,7 @@ return {
|
||||
type = " ",
|
||||
parameter = " ",
|
||||
offspec = " ", -- hint kind not defined in official LSP spec
|
||||
unknown = " ", -- hint kind is nil
|
||||
unknown = " ", -- hint kind is nil
|
||||
},
|
||||
label = {
|
||||
truncateAtChars = 100,
|
||||
|
||||
@@ -2,5 +2,4 @@
|
||||
-- This is just pure lua so anything that doesn't
|
||||
-- fit in the normal config locations above can go here
|
||||
|
||||
require"core.autocmds"
|
||||
|
||||
require "core.autocmds"
|
||||
|
||||
Reference in New Issue
Block a user