How to know when copy pasted document have finished processing? Follow
I often copy paste code from one JS file to another. Almost every time copy pasted code contains some modules that have to be imported. But if I press Option+Enter just after inserting new code I don't have option to import missing modules. I have to wait some time I guess while my WebStorm processing new content and find all needed dependencies.
I understand that it takes some time but I would like to have some visual confirmation when process is finished. Otherwise now I'm just sitting and pressing Opt+Enter 10-20 times every 2 seconds until import statement will be available.
Please sign in to leave a comment.
Normally, when the IDE is analyzing a newly added code, you can see "Analyzing..." in the upper right corner; once it completes, auto-imports should work. Also, the IDE has "import on paste" functionality, so most imports are added immediately once the code is pasted
I don't see any "Analyzing..." label in any of the corners.
Also I don't have "import on paste" option in my preferences
I'm using WebStorm 2022.1
there are no options for this, it should just work. If it doesn't, please create a ticket in youtrack, https://youtrack.jetbrains.com/issues/WEB, providing code snippets + steps to repeat
Sorry, I'm not sure we are talking about same thing.
Are you saying that when pasting JS code with some dependencies WebStorm will paste all `import` lines by default and there is no choice to turn it off?
yes, when pasting, the IDE adds unambiguous imports of modules used in the pasted code snippet
I'm using WebStorm, IDEA or Python for a few years and never saw this functionality. I'm sure we are talking about different things
Please see the docs
I use plain JS, not Typescript
where do you see plain JS? This functionality works for both JS and TS