vscode-npm-gui
vscode-npm-gui copied to clipboard
Implement Copy Installation Package Command for Script & Interactive
Summary:
This pull request introduces a new feature to the NuGet Package Manager GUI that allows users to copy a NuGet package installation command for script directly to the clipboard.
This is achieved by adding a new "Copy" button in the package installation interface and implementing the corresponding backend service to handle the copy
action. The feature enhances the user experience by providing a quick and easy way to copy package references for use in other applications or documents.
Changes:
-
Front-end Changes:
- Modified
install-package.component.htmlto include a new "Copy" button next to the "Install" button for each package listed in the GUI. - Updated
install-package.component.tsby adding a newcopymethod that triggers the loading animation, calls thecopyPackageservice with the
selected package name and version, and then stops the loading animation once the operation is complete.
- Modified
-
Service Layer Updates:
- Updated
command.service.tsto include a newcopyPackagemethod that creates an observable to send thenugetpackagemanagergui.copyPackagecommand
along with the package name and selected version to the backend.
- Updated
-
Extension Backend Enhancements:
- Modified
extension.tsto register a new commandnugetpackagemanagergui.copyPackagethat calls thecopyfunction from the newly createdcopy.service.ts. - Added a new file
copy.service.tsthat contains thecopyfunction. This function constructs the package reference string and uses the Visual Studio
Code API to write it to the system clipboard.
- Modified