oil.nvim icon indicating copy to clipboard operation
oil.nvim copied to clipboard

bug: Renaming files on typescript stopped working

Open simonlearnscoding opened this issue 1 year ago • 5 comments

Did you check the docs and existing issues?

  • [X] I have read the docs
  • [X] I have searched the existing issues

Neovim version (nvim -v)

0.10.0-dev

Operating system/version

linux

Describe the bug

I am on typescript using typescript-language-server, renaming files with oil worked fine until about three days ago until it stopped working, I tried using different ts lsp's but to no success so far

What is the severity of this bug?

breaking (some functionality is broken)

Steps To Reproduce

nvim 0.10.0 with typescript-language-server on linux ubuntu

Expected Behavior

When I rename a file it should adapt the imports

Directory structure

No response

Repro

-- Sorry I tried to do this repro thing but I couldn't make it work due to lazy.nvim (?)
-- run with nvim -u repro.lua
-- DO NOT change the paths
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "runtime", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  {
        "stevearc/oil.nvim",
        config = function()
            require("oil").setup({
              -- add any needed settings here
            })
        end,
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Did you check the bug with a clean config?

  • [X] I have confirmed that the bug reproduces with nvim -u repro.lua using the repro.lua file above.

simonlearnscoding avatar Jul 17 '24 19:07 simonlearnscoding

I'm having the same issue. I created a .tsx, imported it to another document, renamed it, and it won't update the import

AlejandroSanchez90 avatar Feb 07 '25 14:02 AlejandroSanchez90

I'm experiencing the same problem

itsfabijano avatar Feb 12 '25 07:02 itsfabijano

I'm experiencing the same problem

For me, it fails only on big codebase projects. Otherwise, it works. I'm getting an LSP timeout error on large codebases

AlejandroSanchez90 avatar Feb 13 '25 16:02 AlejandroSanchez90

You could try bumping up the value of lsp_file_methods.timeout_ms.

If you create a toy environment (the ideal would be a public git repo) that reproduces the issue I can look into it.

stevearc avatar Feb 14 '25 01:02 stevearc

I think we need a callback that gives us the list of operations, so we can apply additional ones ourselves - like replacing imports. Make sense?

michaelwoelk avatar Mar 27 '25 12:03 michaelwoelk