Conversation
andrewbranch
left a comment
There was a problem hiding this comment.
Do JavaScript requires and export { foo } from "./bar" need to be considered?
| ancestorNode => rangeContainsRange(ancestorNode, range), | ||
| ); | ||
| if (!enclosingNode) return; | ||
| if ( |
There was a problem hiding this comment.
Do all these conditions work if only a an identifier is selected? What about part of the module specifier? The test only shows the case where an entire import declaration is selected.
There was a problem hiding this comment.
Yes, if only an identifier is selected, it works too because it doesn't enter this if block, instead tries to enter the forEachChild but since it doesn't have any children it just returns and moves to the next iteration. Same for moduleSpecifier. If this is selected { foo }, then it will enter the if block.
There was a problem hiding this comment.
Can you add tests to show that it works?
|
@typescript-bot pack this |
|
Hey @DanielRosenwasser, I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
This pr fixes #60485 by making
preparePasteEditsreturn false if an import statement is selected. This is a fix for now that will stop the spinner, but I will be working on #59841 that would enablepasteEditsto fix import specifiers and will also take care of this delay.