feat(lsp): add file rename → import update support
- Switch pyright to basedpyright (willRenameFiles capability) - Add nvim-lsp-file-operations for neo-tree rename → LSP updates - Add Snacks.rename with <leader>cR for current-buffer file renames - Harden oil.nvim with lsp_file_methods (2s timeout, autosave unmodified)
This commit is contained in:
parent
cfa2d19f59
commit
953e5b7d5c
9
init.lua
9
init.lua
|
|
@ -749,13 +749,12 @@ require('lazy').setup({
|
|||
},
|
||||
},
|
||||
},
|
||||
pyright = {
|
||||
basedpyright = {
|
||||
settings = {
|
||||
python = {
|
||||
basedpyright = {
|
||||
analysis = {
|
||||
typeCheckingMode = 'basic',
|
||||
autoSearchPaths = true,
|
||||
useLibraryCodeForTypes = true,
|
||||
typeCheckingMode = 'standard',
|
||||
diagnosticMode = 'openFilesOnly',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
return {
|
||||
'antosha417/nvim-lsp-file-operations',
|
||||
dependencies = { 'nvim-neo-tree/neo-tree.nvim' },
|
||||
config = function()
|
||||
require('lsp-file-operations').setup()
|
||||
|
||||
-- Advertise file operation capabilities to all LSP servers
|
||||
local file_ops_caps = require('lsp-file-operations').default_capabilities()
|
||||
vim.lsp.config('*', {
|
||||
capabilities = file_ops_caps,
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -10,5 +10,10 @@ return {
|
|||
view_options = {
|
||||
show_hidden = true,
|
||||
},
|
||||
lsp_file_methods = {
|
||||
enabled = true,
|
||||
timeout_ms = 2000,
|
||||
autosave_changes = 'unmodified',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,13 @@ return {
|
|||
-- Recommended for `ask()` and `select()`.
|
||||
-- Required for `snacks` provider.
|
||||
---@module 'snacks' <- Loads `snacks.nvim` types for configuration intellisense.
|
||||
{ 'folke/snacks.nvim', opts = { input = {}, picker = {}, terminal = {} } },
|
||||
{
|
||||
'folke/snacks.nvim',
|
||||
opts = { input = {}, picker = {}, terminal = {}, rename = {} },
|
||||
keys = {
|
||||
{ '<leader>cR', function() Snacks.rename.rename_file() end, desc = 'Rename File (LSP)' },
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local function redact_sensitive(value)
|
||||
|
|
|
|||
Loading…
Reference in New Issue