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