Also autoload on SSMS 22's own UI context - #7
Merged
Merged
Conversation
The package autoloads on UIContextGuids80.NoSolution. SSMS 18/20 raise it at startup and so does a plain SSMS 22 start, but an "ssms -S <server>" launch of SSMS 22 never does: that auto-connect path skips the solution contexts. With no command table compiled in, the Ctrl+D hotkey registered during package init is the only way into the extension, so on that path it never appeared and nothing logged an error. Register a second trigger on UICONTEXT_SSMS, the context SSMS.Application.pkgdef declares for the shell itself. Established by installing a per-user probe .vsix that adds only that autoload entry for the already-registered package: the package loads with it and not with a made-up control context. The shipped pkgdef is hand-maintained, so it carries the entry directly; the attribute mirrors it. Notes cover the technique plus the two SSMS 22 command line traps that hid this: -E no longer exists (an unknown switch shows an error dialog titled like the IDE), and -log takes a filename.
|
Warning Review limit reachedNext included review available in 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On SSMS 22, launching as
ssms -S <server>gives you no SQL Pilot at all — no tool window,Ctrl+Ddoes nothing, nothing in the activity log. A plain start works fine, as do SSMS 18 and 20.Cause
The package autoloads on
UIContextGuids80.NoSolution. The VS 2017 shell in SSMS 18/20 raises it at startup, and so does a plain SSMS 22 start, but SSMS 22's-Sauto-connect path never does. WithSqlPilotCommandSet.vsctcompiled by neither csproj, theCtrl+Dhotkey registered during package init is the only way into the extension, so a package that never autoloads is unreachable.Fix
Register a second autoload trigger on
UICONTEXT_SSMS({B7B07F42-…}), the contextSSMS.Application.pkgdefdeclares for the shell itself. A package loads once regardless of how many of its contexts fire, and SSMS 18/20 simply never raise this one.Established by installing a per-user probe
.vsixwhose only content is that one extraAutoLoadPackagesentry for the already-registered package: the package loads with it, and does not load with a made-up control context. Then confirmed with the scope feature branch deployed:-Slaunch → package loads → Object Explorer connects → full index and scope behaviour.The shipped
SqlPilot.Package.pkgdefis hand-maintained (the VSSDK pkgdef target doesn't run in these SDK-style projects), so the entry is added there directly; the[ProvideAutoLoad]attribute mirrors it.Notes added
Two SSMS 22 command-line traps that hid this for a long time, now in
SSMS_INTEGRATION_NOTES.md:-Eno longer exists and an unknown switch shows a usage-error dialog titled exactly like the IDE, and-logtakes a filename. Plus the probe technique, and thatProcess.Modulesis not a valid "did it load" check.