jose-elias-alvarez / nvim-lsp-ts-utils

Utilities to improve the TypeScript development experience for Neovim's built-in LSP client.
The Unlicense
438 stars 18 forks source link

`update_imports_on_move ` + `require_confirmation_on_move` asks confirm on every `:w` #68

Closed marcelbeumer closed 2 years ago

marcelbeumer commented 2 years ago

FAQ

Issues

Neovim Version

NVIM v0.6.0-dev+371-ga940952fe

Steps to reproduce

I was having this issue for a while (weeks) already, and just turned the feature off to try to turn on later. Now still an issue on HEAD.

      lsp_ts_utils.setup({
        eslint_enable_code_actions = false,
        update_imports_on_move = true,
        require_confirmation_on_move = true,
      })

Saving any .ts(x) file (tested in differently set-up typescript projects) will trigger the import confirmation. When I confirm, nothing changes on the FS. Tried to turn off formatting on save, still same problem.

Expected behavior

Only show confirmation when files moved

Actual behavior

Shows confirm when saved file did not move

Debug log

successfully registered null-ls integrations
attempting to watch root dir /Users/robotx/dev/clone/jtd-codegen-setup
git root found; scanning
watching dir /Users/robotx/dev/clone/jtd-codegen-setup/bin
watching dir /Users/robotx/dev/clone/jtd-codegen-setup/src
"src/example.ts" 44L, 903C written
attempting to update imports
source: /Users/robotx/dev/clone/jtd-codegen-setup/src/4913
target: /Users/robotx/dev/clone/jtd-codegen-setup/src/example.ts

Help

No

Implementation help

No response

jose-elias-alvarez commented 2 years ago

I did a quick bisect and I can see that this has been broken since 78870a25fb08af154f50b83fee3b62d24aae26e7, but without the confirmation option enabled (and without debug mode), it's pretty much invisible. I think 0911e8c5e554a07cdb36b68d83cb8cddb42aa0d7 will fix it, so can you try updating the plugin and let me know?

marcelbeumer commented 2 years ago

Yes, 0911e8c fixes it! Thanks!