TaoK / PoorMansTSqlFormatter

A small free .Net and JS library (with demo UI, command-line bulk formatter, SSMS/VS add-in, notepad++ plugin, winmerge plugin, and demo webpage) for reformatting and coloring T-SQL code to the user's preferences.
http://www.architectshack.com/PoorMansTSqlFormatter.ashx
GNU Affero General Public License v3.0
969 stars 268 forks source link

How to use it in VS 2019? #228

Closed spottedmahn closed 5 years ago

spottedmahn commented 5 years ago

How do I use the extension in Visual Studio? I don't see anything in the right-click context menu. I don't see anything in the extensions menu.

And I don't see anything in the marketplace showing how to invoke it.

Is there a documentation on this somewhere that I can't find? I happy to help improve the docs 😊

tspannagel commented 5 years ago

Can be installed, can't be used, even if you enable the synchronous load.

I get the following messages after successful installation:

image image

image

m1hammer commented 5 years ago

SSMS 18.1 shows the same error on startup. Poor SQL shows in the Tools menu, but is not selectable.

TaoK commented 5 years ago

How do I use the extension in Visual Studio? I don't see anything in the right-click context menu. I don't see anything in the extensions menu.

For historical reasons (the tool has existed for much longer than extensions have), it appears under the "Tools" menu.

That said, due to a bug in the latest installer, which manifested with the startup-time error @tspannagel showed a screenshot of, the menu items remained disabled and unusable in in the VS extension version 1.6.13. The newly published 1.6.14 fixes this. That said, there is another issue @tspannagel alluded to, that you get a message at the top of the UI, warning you the extension has been disabled due to deprecated APIs. That will hopefully be fixed in a new version soon.

When the extension is enabled and working, you can invoke it from the menu, and/or assign a key combination to it in VS settings/configuration.

even if you enable the synchronous load

Right, as noted in #229, there are new requirements in VS2019 that I missed. Working on that next.

Can be installed, can't be used (pic: The 'FormatterPackage' package did not load successfully)

Sorry about that - I clearly messed something up in the build process, and ended up with bad builds. Discussed in #227, #226, and https://twitter.com/PoorSQL/status/1156137341087571968 for SSMS, looks like the same thing happened for theVS extension on the marketplace.

I just published a new version on the marketplace, which is working right for me (within limits - see the comment above and #229) - please let me know whether upgrading fixes things.

SSMS 18.1 shows the same error on startup

This should be fixed with the new 1.6.13b installer as of a few hours ago, sorry about the messup. If you're still having issues with the new installer please let me know.

m1hammer commented 5 years ago

Thanks Tao -- works great now.

spottedmahn commented 5 years ago

For historical reasons (the tool has existed for much longer than extensions have), it appears under the "Tools" menu.

I'd be happy to submit a PR to the docs but I wanted to check that you would be opening to accepting it before I did the work

TaoK commented 5 years ago

I'd be happy to submit a PR to the docs but I wanted to check that you would be opening to accepting it before I did the work

I'm definitely interested, but I haven't sorted out a contributor agreement yet.

So, 2 things:

  1. If you'd like some sort of confidence that I'll actually accept a pull request, please push me on getting a contributor agreement together. The gist of the thing would be "Tao gets to use your contributions if he chooses to do something with the project, eg redistribute under a commercial license". Not that I expect that to ever happen (nor that the project is "good"/valuable enough to warrant this), but as a general matter of principle I'd like this project that I've spent so much time on to be something I can keep using even under a different license. (note: I could never rescind the existing license for the existing codebase; the AGPL intentionally ensures this; any more-restrictive license could only ever apply to new code, and/or to a separate packaging/release of the code).

  2. I'm curious as to where you propose to put the tool's menu items. I just split the extension into two versions (2013-2015 vs 2017-2019) to handle async loading which seems to be a backwards-incompatible concept, but the "Extensions" menu seems to be even more recent, 2019 only?

spottedmahn commented 5 years ago

I'm curious as to where you propose to put the tool's menu items.

I'm not purposing changing that, I just want to add something here:

image

Showing this:

image

TaoK commented 5 years ago

I just want to add something [here] showing [this]

Unfortunately, that stuff is (as far as I can tell) managed purely offline in the VS Marketplace management UI. That said, I could add a markdown file or something for that, and add that to the litany of manual release steps; let me take a stab at what that might look like: #233.