You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This iteration we enabled smart copy/pasting that also updates js/ts imports on paste. This was previously gated behind an experimental setting For this test plan item, test the edits this feature generates along with the UX for how this feature is presented to users
Testing
Basic flow
Try copy and pasting between two TS or JS files that are in the same project
When you copy code that contains imported symbols, confirm that pasting it shows a paste widget. Selecting paste with imports in the paste widget should add the import
Try copying and pasting different types of code across different files. Confirm that reasonable edits are generated when using paste with imports
Configuration
Confirm you can use typescript.updateImportsOnPaste.enabled / javascript.updateImportsOnPaste.enabled to fully disable the feature
With the feature disabled you should not see the paste widget when pasting
You can use settings to make paste with imports the default:
Edit the editor.pasteAs.preferences setting
Confirm you get intellisense for the various paste types. Specifically you should see text.updateImports.jsts listed
Add either text.updateImports.jsts or just text.updateImports to the preferences list
Now when pasting, paste with imports should be the default but you can use the paste widget to switch back to normal pasting
Known limitations
Smart copy paste currently only works within text editors in the same editor window
The text was updated successfully, but these errors were encountered:
@mjbvz I tested on windows and the only feedback that I have is that I wonder if we should detect if the import already exists and prevent a duplicated import, but not sure if that is out of scope.
Also, looks like the import got inserted in between a comment.
Test for #30066
Complexity: 3
Create Issue
Overview
This iteration we enabled smart copy/pasting that also updates js/ts imports on paste. This was previously gated behind an experimental setting For this test plan item, test the edits this feature generates along with the UX for how this feature is presented to users
Testing
Basic flow
Try copy and pasting between two TS or JS files that are in the same project
When you copy code that contains imported symbols, confirm that pasting it shows a paste widget. Selecting
paste with imports
in the paste widget should add the importTry copying and pasting different types of code across different files. Confirm that reasonable edits are generated when using
paste with imports
Configuration
Confirm you can use
typescript.updateImportsOnPaste.enabled
/javascript.updateImportsOnPaste.enabled
to fully disable the featureWith the feature disabled you should not see the paste widget when pasting
You can use settings to make
paste with imports
the default:editor.pasteAs.preferences
settingtext.updateImports.jsts
listedtext.updateImports.jsts
or justtext.updateImports
to the preferences listKnown limitations
The text was updated successfully, but these errors were encountered: