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:
Paul B. Kim 2026-03-03 07:39:44 +09:00
parent cfa2d19f59
commit 953e5b7d5c
No known key found for this signature in database
4 changed files with 29 additions and 6 deletions

View File

@ -749,13 +749,12 @@ require('lazy').setup({
},
},
},
pyright = {
basedpyright = {
settings = {
python = {
basedpyright = {
analysis = {
typeCheckingMode = 'basic',
autoSearchPaths = true,
useLibraryCodeForTypes = true,
typeCheckingMode = 'standard',
diagnosticMode = 'openFilesOnly',
},
},
},

View File

@ -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,
}

View File

@ -10,5 +10,10 @@ return {
view_options = {
show_hidden = true,
},
lsp_file_methods = {
enabled = true,
timeout_ms = 2000,
autosave_changes = 'unmodified',
},
},
}

View File

@ -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)