Closed lo1tuma closed 3 years ago
Does code action work for you? Put your cursor on unresolved identifier and fire <Plug>(coc-codeaction-cursor)
, coc will list available imports.
You have to use codeActions
Nice, I wasn’t aware of that feature. Thank you.
Hi, I’ve switched from
nvim-typescript
tococ
recently and so far I’m quite happy but I’m missing one feature. I don’t really like auto imports, since they are quite often wrong in bigger projects.nvim-typescript
provided a command:TSImport
which suggested several possible imports for the identifier under the current cursor where you could then choose which one should be added to import statements of the current file. If there was only one suggestion, then the step of choosing something was skipped and the import statement was added directly.Currently I have disable auto imports and add a
:OR
command which just runsorganizeImports
. Unfortunately this command also tries to import things for every unresolved identifier, even for still work-in-progress code that I want to change in the next minute. Additionally it seems like it sorts my existing import statements alphabetically, which is an undesired change for me.