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.html
to include a new "Copy" button next to the "Install" button for each package listed in the GUI. - Updated
install-package.component.ts
by adding a newcopy
method that triggers the loading animation, calls thecopyPackage
service 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.ts
to include a newcopyPackage
method that creates an observable to send thenugetpackagemanagergui.copyPackage
command
along with the package name and selected version to the backend.
- Updated
-
Extension Backend Enhancements:
- Modified
extension.ts
to register a new commandnugetpackagemanagergui.copyPackage
that calls thecopy
function from the newly createdcopy.service.ts
. - Added a new file
copy.service.ts
that contains thecopy
function. This function constructs the package reference string and uses the Visual Studio
Code API to write it to the system clipboard.
- Modified