gitextensions / gitextensions.vsix

Visual Studio extensions for Git Extensions
MIT License
16 stars 8 forks source link

Refactored shared logic to a shared project and support for VS 2022 #29

Closed prog-rajkamal closed 2 years ago

prog-rajkamal commented 2 years ago

Motivation

Visual Studio 2022 is currently in preview. It is next major version of Visual Studio, and first version built in 64 bits

GitExtension plugin has not been updated to support it, which is an issue for me as I am avid user of Gitextension and prefer it over native Visual Studio git integration.

This PR is meant to add support for VS.

Code changes

I have beginner level knowledge of Visual studio extension and no knowledge of git extension codebase or its build process. To add support for VS 2022, I have followed steps mentioned at https://docs.microsoft.com/en-us/visualstudio/extensibility/migration/update-visual-studio-extension?view=vs-2022

At high level, these steps are:

  1. Move logic from VSIX project(GitExtensionsVSIX) to a shared project (GitExtensionsShared)
  2. Create a new extension project (GitExtensions2022) for VS 2022 and remove all files except for manifest file
  3. Reference the shared project from VS 2022 project.

As Shared Project does not support linked files, I have duplicated the files for both projects.

Testing

I have manually tested the extension on my local installations:

VS 2022 (preview) image

VS 2019

image

Needs attention

  1. File versioning: I have incremented versions in multiple places
  2. Vs2022 package does not import scripts/tools files because i got some error while using them and could not fix it.
RussKie commented 2 years ago

2. Vs2022 package does not import scripts/tools files because i got some error while using them and could not fix it.

Could you please elaborate?

prog-rajkamal commented 2 years ago
  1. Vs2022 package does not import scripts/tools files because i got some error while using them and could not fix it.

Could you please elaborate?

Basically, I was trying to get existing build script to work and drop VSIX file for VS2022 project in artifacts directory. But i could not identify why build were failing, hence could not fix it.

If you take the changes locally and build it, you will see that VS2022 project generates VSIX file in bin/ directory instead of artifacts directory

RussKie commented 2 years ago

Pushed few tweaks into your branch including:

This can be built in VS and from command line using .\build.cmd

RussKie commented 2 years ago

The test artifacts are here: https://ci.appveyor.com/project/gitextensions/gitextensions-vsix/builds/41177187/artifacts

prog-rajkamal commented 2 years ago

@RussKie Looks great to me! is there anything blocking the merge?

RussKie commented 2 years ago

I just need a confirmation that everything is working :)

prog-rajkamal commented 2 years ago

I have tested Vs 2022 extension locally. I couldn't test VS2019 extension due to an issue with uninstalling existing extension.

RussKie commented 2 years ago

Published https://marketplace.visualstudio.com/items?itemName=GitExtensionsApp.VS2022

programcsharp commented 2 years ago

I'm having toolbar layout issues in VS 2022 -- it doesn't seem to actually save the layout/buttons on the GitExtensions toolbar. Sometimes it duplicates buttons, sometimes the toolbar doesn't show after restarting VS and I have to add it again. No button changes persist through a VS 2022 restart.

I've tried resetting the toolbar layout, turning on and off the "put extension menu items in separate menu" option etc. Nothing seems to work. I somehow got to a state where the toolbar is showing now without duplicate options, so leaving it at that for now. I tried making changes to the toolbar but any change is just reset when I restart VS.

I don't know if it makes a difference, but I also have VS 2019 installed.

prog-rajkamal commented 2 years ago

@programcsharp This is an issue with Gitextension. I have seen it in past for VS 2019 version as well.

I also saw it today on my machine. I am not sure where ti comes from. but i do know a workaround for it.

Issue: Duplicate icons in Git Ext toolbar in Visual studio gitext__issue

workaround:

  1. Click on Toolbar Options icon (the down arrow at end)
  2. Select "Add or Remove buttons"
  3. Uncheck extra buttons
  4. Here is a screenshot from my machine gitext__fix
RussKie commented 2 years ago

Generally if you reset the toolbar (the last option) it all should go back to normal.

On Wed, 8 Dec 2021 at 16:14, Raj @.***> wrote:

@programcsharp https://github.com/programcsharp This is an issue with Gitextension. I have seen it in past for VS 2019 version as well.

I also saw it today on my machine. I am not sure where ti comes from. but i do know a workaround for it.

Issue: Duplicate icons in Git Ext toolbar in Visual studio [image: gitext__issue] https://user-images.githubusercontent.com/11518519/145151922-996ffc6d-8a6d-4cc1-b2e4-efd4f9a0d88e.png

workaround:

  1. Click on Toolbar Options icon (the down arrow at end)
  2. Select "Add or Remove buttons"
  3. Uncheck extra buttons
  4. Here is a screenshot from my machine [image: gitext__fix] https://user-images.githubusercontent.com/11518519/145152106-42fec192-3333-4c27-a4de-0887ac805b8c.png

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/gitextensions/gitextensions.vsix/pull/29#issuecomment-988506072, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBTEXUMS2TQS6NPPOU544TUP3SR5ANCNFSM5FHZMXAQ .

programcsharp commented 2 years ago

It kept coming back each time I restarted -- I tried resetting, unchecking extra buttons, etc. Finally after maybe 5 go rounds of trying different things I was able to get it to stabilize, but I don't know what thing actually fixed it :-/