Delete some file imports at the top so that there are code actions available for importing them again
Do :TSLspImportAll
Error should appear
Expected behavior
nvim-lsp-ts-utils would add the missing import statements
Actual behavior
Neovim prints the following error:
Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp/util.lua:366: offset_encoding: expected string, got nil
stack traceback:
[C]: in function 'error'
vim/shared.lua: in function 'validate'
/usr/share/nvim/runtime/lua/vim/lsp/util.lua:366: in function 'apply_text_edits'
...s/nvim-lsp-ts-utils/lua/nvim-lsp-ts-utils/import-all.lua:206: in function 'apply_edits'
...s/nvim-lsp-ts-utils/lua/nvim-lsp-ts-utils/import-all.lua:279: in function <...s/nvim-lsp-ts-utils/lua/nvim-lsp-ts-utils/import-all.lua:278>
Debug log
git root found at *path/to/project/*; scanning
watching dir *path/to/project/file*
command git exited with code 0
assigning priority 0 to action Import 'Logger' from module "@azure/functions"
Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp/util.lua:366: offset_encoding: expected string, got nil
stack traceback:
[C]: in function 'error'
vim/shared.lua: in function 'validate'
/usr/share/nvim/runtime/lua/vim/lsp/util.lua:366: in function 'apply_text_edits'
...s/nvim-lsp-ts-utils/lua/nvim-lsp-ts-utils/import-all.lua:206: in function 'apply_edits'
...s/nvim-lsp-ts-utils/lua/nvim-lsp-ts-utils/import-all.lua:279: in function <...s/nvim-lsp-ts-utils/lua/nvim-lsp-ts-utils/import-all.lua:278>
FAQ
Issues
Neovim Version
NVIM v0.7.0-dev+1027-gf02a5a7bd
Steps to reproduce
Use the following
init.vim
:Open a TypeScript file
Delete some file imports at the top so that there are code actions available for importing them again
Do
:TSLspImportAll
Error should appear
Expected behavior
nvim-lsp-ts-utils would add the missing import statements
Actual behavior
Neovim prints the following error:
Debug log
Help
No
Implementation help
No response