astyle-extension icon indicating copy to clipboard operation
astyle-extension copied to clipboard

Support VS 2022

Open Waxime64 opened this issue 3 years ago • 7 comments

Visual studio 2022 is out soon. Please rebuild for this version

Waxime64 avatar Oct 15 '21 13:10 Waxime64

It is out now. Can we get support for vs2022? please please please please?

thHube avatar Nov 23 '22 13:11 thHube

I switch directly in VS2022 to code style tools-> options -> text editor -> "language" -> code style and you can set "Format on save"

Waxime64 avatar Nov 23 '22 13:11 Waxime64

maybe you guys can try my fork: https://github.com/nneesshh/astyle-extension, fo vs2022 only.

nneesshh avatar Mar 31 '23 02:03 nneesshh

@nneesshh, thank you very much!

It works when "Format on save" is checked. However, I would prefer to use keyboard mappings like before. Do you know how to make this work?

When I look in an old VS2017 setup, I see there were two options available in Options->Environment->Keyboard: Edit.FormatDocumentAStyle Edit.FormatSelectionAStyle

But these were not added in VS2022.

Amaroker avatar Mar 31 '23 10:03 Amaroker

It also used to be possible to select these options in the menu.

astyle

Any ideas how to get them back? Or would it be possible to add them manually somehow? External tools can be added from the menu "Tools->External Tools" but I don't know how to configure it for AStyle.

There are some issues when using "Format on save". For example, when a file with unsaved changes is closed, Visual Studio pops up a "Save changes" message. If you select "Don't Save", it will still trigger AStyle format and then the file is not restored to its previous state.

Amaroker avatar Apr 03 '23 07:04 Amaroker

https://github.com/nneesshh/astyle-extension/commit/bfad5e3113d3c24ca6026dbf7595898f867c8be4

@Amaroker You can try again. I don't know vsct well,I just search the text from your pic and fixed the vsct and guid, haha...

nneesshh avatar Apr 13 '23 07:04 nneesshh

@nneesshh Perfect, it works! Thank you once again!

Amaroker avatar Apr 13 '23 09:04 Amaroker