aliasadidev / vscode-npm-gui

vscode nuget package manager gui https://marketplace.visualstudio.com/items?itemName=aliasadidev.nugetpackagemanagergui
MIT License
48 stars 16 forks source link

Implement Copy Installation Package Command for Script & Interactive #72

Closed xbotter closed 1 month ago

xbotter commented 4 months ago

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:

  1. 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.
  2. 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.
  3. 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.
aliasadidev commented 1 month ago

It was fine, I have merged Thanks