Skip to content

Commit 894e3bf

Browse files
authored
Adding keyboard shortcuts back to result grid. (#20418)
1 parent 0932470 commit 894e3bf

34 files changed

+1925
-181
lines changed

README.md

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,36 @@ The following Visual Studio Code settings are available for the mssql extension.
192192
// Shortcuts
193193
{
194194
"mssql.shortcuts": {
195-
"event.toggleResultPane": "ctrl+alt+r",
196-
"event.toggleMessagePane": "ctrl+alt+y",
197-
"event.prevGrid": "ctrl+up",
198-
"event.nextGrid": "ctrl+down",
199-
"event.copySelection": "ctrl+c",
200-
"event.maximizeGrid": "",
201-
"event.selectAll": "",
202-
"event.saveAsJSON": "",
203-
"event.saveAsCSV": "",
204-
"event.saveAsExcel": ""
195+
"event.queryResults.switchToResultsTab": "ctrl+alt+R",
196+
"event.queryResults.switchToMessagesTab": "ctrl+alt+Y",
197+
"event.queryResults.switchToQueryPlanTab": "ctrl+alt+E",
198+
"event.queryResults.prevGrid": "ctrlcmd+up",
199+
"event.queryResults.nextGrid": "ctrlcmd+down",
200+
"event.queryResults.switchToTextView": "",
201+
"event.queryResults.maximizeGrid": "",
202+
"event.queryResults.saveAsJSON": "",
203+
"event.queryResults.saveAsCSV": "",
204+
"event.queryResults.saveAsExcel": "",
205+
"event.queryResults.saveAsInsert": "",
206+
"event.resultGrid.copySelection": "ctrlcmd+c",
207+
"event.resultGrid.copyWithHeaders": "",
208+
"event.resultGrid.copyAllHeaders": "",
209+
"event.resultGrid.selectAll": "ctrlcmd+a",
210+
"event.resultGrid.copyAsCSV": "",
211+
"event.resultGrid.copyAsJSON": "",
212+
"event.resultGrid.copyAsInsert": "",
213+
"event.resultGrid.copyAsInClause": "",
214+
"event.resultGrid.changeColumnWidth": "alt+shift+s",
215+
"event.resultGrid.expandSelectionLeft": "shift+left",
216+
"event.resultGrid.expandSelectionRight": "shift+right",
217+
"event.resultGrid.expandSelectionUp": "shift+up",
218+
"event.resultGrid.expandSelectionDown": "shift+down",
219+
"event.resultGrid.openColumnMenu": "f3",
220+
"event.resultGrid.moveToRowStart": "ctrlcmd+left",
221+
"event.resultGrid.moveToRowEnd": "ctrlcmd+right",
222+
"event.resultGrid.selectColumn": "ctrl+space",
223+
"event.resultGrid.selectRow": "shift+space",
224+
"event.resultGrid.toggleSort": "alt+shift+o"
205225
}
206226
}
207227

localization/l10n/bundle.l10n.json

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -351,27 +351,62 @@
351351
"Privacy Statement": "Privacy Statement",
352352
"Microsoft will process the feedback you submit pursuant to your organization’s instructions in order to improve your and your organization’s experience with this product. If you have any questions...": "Microsoft will process the feedback you submit pursuant to your organization’s instructions in order to improve your and your organization’s experience with this product. If you have any questions...",
353353
"Microsoft will process the feedback you submit pursuant to your organization’s instructions in order to improve your and your organization’s experience with this product. If you have any questions about the use of feedback data, please contact your tenant administrator. Processing of feedback data is governed by the Microsoft Products and Services Data Protection Addendum between your organization and Microsoft, and the feedback you submit is considered Personal Data under that addendum.": "Microsoft will process the feedback you submit pursuant to your organization’s instructions in order to improve your and your organization’s experience with this product. If you have any questions about the use of feedback data, please contact your tenant administrator. Processing of feedback data is governed by the Microsoft Products and Services Data Protection Addendum between your organization and Microsoft, and the feedback you submit is considered Personal Data under that addendum.",
354+
"Results ({0})/{0} is the keyboard shortcut for the results tab": {
355+
"message": "Results ({0})",
356+
"comment": ["{0} is the keyboard shortcut for the results tab"]
357+
},
358+
"Results": "Results",
354359
"Results ({0})/{0} is the number of results": {
355360
"message": "Results ({0})",
356361
"comment": ["{0} is the number of results"]
357362
},
363+
"Messages ({0})/{0} is the keyboard shortcut for the messages tab": {
364+
"message": "Messages ({0})",
365+
"comment": ["{0} is the keyboard shortcut for the messages tab"]
366+
},
358367
"Messages": "Messages",
359368
"Timestamp": "Timestamp",
360369
"Message": "Message",
361370
"Open in New Tab": "Open in New Tab",
362371
"Showplan XML": "Showplan XML",
363-
"Show Menu (F3)": "Show Menu (F3)",
372+
"Show Menu ({0})/{0} is the keyboard shortcut for showing the menu": {
373+
"message": "Show Menu ({0})",
374+
"comment": ["{0} is the keyboard shortcut for showing the menu"]
375+
},
376+
"Show Menu": "Show Menu",
364377
"Sort Ascending": "Sort Ascending",
365378
"Sort Descending": "Sort Descending",
366379
"Clear Sort": "Clear Sort",
380+
"Save as CSV ({0})/{0} is the keyboard shortcut for saving as CSV": {
381+
"message": "Save as CSV ({0})",
382+
"comment": ["{0} is the keyboard shortcut for saving as CSV"]
383+
},
367384
"Save as CSV": "Save as CSV",
385+
"Save as Excel ({0})/{0} is the keyboard shortcut for saving as Excel": {
386+
"message": "Save as Excel ({0})",
387+
"comment": ["{0} is the keyboard shortcut for saving as Excel"]
388+
},
368389
"Save as Excel": "Save as Excel",
390+
"Save as JSON ({0})/{0} is the keyboard shortcut for saving as JSON": {
391+
"message": "Save as JSON ({0})",
392+
"comment": ["{0} is the keyboard shortcut for saving as JSON"]
393+
},
369394
"Save as JSON": "Save as JSON",
395+
"Save as INSERT INTO ({0})/{0} is the keyboard shortcut for saving as INSERT INTO": {
396+
"message": "Save as INSERT INTO ({0})",
397+
"comment": ["{0} is the keyboard shortcut for saving as INSERT INTO"]
398+
},
399+
"Save as INSERT INTO": "Save as INSERT INTO",
370400
"Hide this panel": "Hide this panel",
371401
"Query Plan ({0})/{0} is the number of query plans": {
372402
"message": "Query Plan ({0})",
373403
"comment": ["{0} is the number of query plans"]
374404
},
405+
"Query Plan ({0})/{0} is the keyboard shortcut for the query plan tab": {
406+
"message": "Query Plan ({0})",
407+
"comment": ["{0} is the keyboard shortcut for the query plan tab"]
408+
},
409+
"Query Plan": "Query Plan",
375410
"Select All": "Select All",
376411
"Copy with Headers": "Copy with Headers",
377412
"Copy Headers": "Copy Headers",
@@ -380,16 +415,31 @@
380415
"Copy as JSON": "Copy as JSON",
381416
"Copy as IN clause": "Copy as IN clause",
382417
"Copy as INSERT INTO": "Copy as INSERT INTO",
383-
"Save as INSERT": "Save as INSERT",
384418
"NULL": "NULL",
385419
"Blanks": "Blanks",
386420
"Search...": "Search...",
421+
"Maximize ({0})/{0} is the keyboard shortcut for maximizing the grid": {
422+
"message": "Maximize ({0})",
423+
"comment": ["{0} is the keyboard shortcut for maximizing the grid"]
424+
},
387425
"Maximize": "Maximize",
426+
"Restore ({0})/{0} is the keyboard shortcut for restoring the grid": {
427+
"message": "Restore ({0})",
428+
"comment": ["{0} is the keyboard shortcut for restoring the grid"]
429+
},
388430
"Restore": "Restore",
389-
"Grid View": "Grid View",
390-
"Text View": "Text View",
431+
"Switch to Grid View ({0})/{0} is the keyboard shortcut for switching to grid view": {
432+
"message": "Switch to Grid View ({0})",
433+
"comment": ["{0} is the keyboard shortcut for switching to grid view"]
434+
},
391435
"Switch to Grid View": "Switch to Grid View",
436+
"Switch to Text View ({0})/{0} is the keyboard shortcut for switching to text view": {
437+
"message": "Switch to Text View ({0})",
438+
"comment": ["{0} is the keyboard shortcut for switching to text view"]
439+
},
392440
"Switch to Text View": "Switch to Text View",
441+
"Grid View": "Grid View",
442+
"Text View": "Text View",
393443
"No results to display": "No results to display",
394444
"Error generating text view. Please try switching back to grid view.": "Error generating text view. Please try switching back to grid view.",
395445
"(0 rows affected)": "(0 rows affected)",
@@ -1046,7 +1096,6 @@
10461096
"CSV": "CSV",
10471097
"JSON": "JSON",
10481098
"Excel": "Excel",
1049-
"Results": "Results",
10501099
"Select all": "Select all",
10511100
"Executing query...": "Executing query...",
10521101
"Query executed": "Query executed",

localization/xliff/vscode-mssql.xlf

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2187,6 +2187,10 @@
21872187
<trans-unit id="++CODE++fba6c2c5d9468e741725c7dfa1ac14fb59523c74fa86744027ec0a175e6cae3f">
21882188
<source xml:lang="en">Maximize</source>
21892189
</trans-unit>
2190+
<trans-unit id="++CODE++413bb729f02d5d830364779a608ec96486cdbac9d8f519d246b280ee3fd3027d">
2191+
<source xml:lang="en">Maximize ({0})</source>
2192+
<note>{0} is the keyboard shortcut for maximizing the grid</note>
2193+
</trans-unit>
21902194
<trans-unit id="++CODE++bfb44e231009293c2b2333bb7d0e9e5c0c79294bbb1c6a42c3471892ef016229">
21912195
<source xml:lang="en">Maximize Panel Size</source>
21922196
</trans-unit>
@@ -2199,6 +2203,10 @@
21992203
<trans-unit id="++CODE++04d7b48339271ea67d3c8493e07e90bc68dc565485eebe5e0b67c21c1586e3c0">
22002204
<source xml:lang="en">Messages</source>
22012205
</trans-unit>
2206+
<trans-unit id="++CODE++d383f047a2ab3c6127191873e02bfe1e822d683f30c084fb0a6f54bad4716328">
2207+
<source xml:lang="en">Messages ({0})</source>
2208+
<note>{0} is the keyboard shortcut for the messages tab</note>
2209+
</trans-unit>
22022210
<trans-unit id="++CODE++2d275a74912cca2e02e6d41f9cae3a75ceef3ed0ef734eff3710e10eb7112228">
22032211
<source xml:lang="en">Metric</source>
22042212
</trans-unit>
@@ -2722,6 +2730,13 @@
27222730
<trans-unit id="++CODE++0e1d9858f1e51bd313981a0d8da504fb12e0405fc869634ad52babe02eff9e3d">
27232731
<source xml:lang="en">Pulling the SQL Server container image. This might take a few minutes depending on your internet connection.</source>
27242732
</trans-unit>
2733+
<trans-unit id="++CODE++f44ad102b5dd5df1b5691408d19d39ee92cc1c9ad20f7125845df3d961a805d3">
2734+
<source xml:lang="en">Query Plan</source>
2735+
</trans-unit>
2736+
<trans-unit id="++CODE++849546c6df0763a6f8aa890e76dff62d494b20db8125f937e529ad74e52c34f1">
2737+
<source xml:lang="en">Query Plan ({0})</source>
2738+
<note>{0} is the keyboard shortcut for the query plan tab</note>
2739+
</trans-unit>
27252740
<trans-unit id="++CODE++bebc9b760db9e5ba55f2632c57871653521c9094223eeb46476e3d7d49218b89">
27262741
<source xml:lang="en">Query Plan ({0})</source>
27272742
<note>{0} is the number of query plans</note>
@@ -2819,6 +2834,10 @@
28192834
<trans-unit id="++CODE++a76e13b9839270eb73ed11417f7d8acca55df0ad52065799361631d0fff74f27">
28202835
<source xml:lang="en">Restore</source>
28212836
</trans-unit>
2837+
<trans-unit id="++CODE++aa23cbfa14a31ad474e4c88dbaf83494d1f988d659568633b40d2e93cc39b61d">
2838+
<source xml:lang="en">Restore ({0})</source>
2839+
<note>{0} is the keyboard shortcut for restoring the grid</note>
2840+
</trans-unit>
28222841
<trans-unit id="++CODE++08a1e27d6e3c46f5a5b553a82a39ac2d0e89f6b37a9f57269532ed172d6d2de8">
28232842
<source xml:lang="en">Restore Panel Size</source>
28242843
</trans-unit>
@@ -2839,6 +2858,10 @@
28392858
<source xml:lang="en">Results ({0})</source>
28402859
<note>{0} is the number of results</note>
28412860
</trans-unit>
2861+
<trans-unit id="++CODE++82d510eecb9f37659e99b55edff96e66aced3765063d0981d26bb433381f1945">
2862+
<source xml:lang="en">Results ({0})</source>
2863+
<note>{0} is the keyboard shortcut for the results tab</note>
2864+
</trans-unit>
28422865
<trans-unit id="++CODE++a71f9e2908cf7df2e5ce9dafa67f3f4949fc4c74f525b9f4a6229ff6a7f93c86">
28432866
<source xml:lang="en">Results copied to clipboard</source>
28442867
</trans-unit>
@@ -2981,15 +3004,31 @@
29813004
<trans-unit id="++CODE++e50761ebedbdddb4dd4afb99a7c0964cf8bfed33ec03cb39f5a08e65812c795a">
29823005
<source xml:lang="en">Save as CSV</source>
29833006
</trans-unit>
3007+
<trans-unit id="++CODE++f16fdea0ffe7c1d1a7e39080f54fcf518de82268186b3a569d4132cda24f138f">
3008+
<source xml:lang="en">Save as CSV ({0})</source>
3009+
<note>{0} is the keyboard shortcut for saving as CSV</note>
3010+
</trans-unit>
29843011
<trans-unit id="++CODE++40838c73e26d7ae3162bb4250c2c1e261a33fec5478432e6e47ba9ab6649c1ef">
29853012
<source xml:lang="en">Save as Excel</source>
29863013
</trans-unit>
2987-
<trans-unit id="++CODE++49e889d19cb98b87430fab55b6c5203e191463e874e2d94eb44d43f38395e226">
2988-
<source xml:lang="en">Save as INSERT</source>
3014+
<trans-unit id="++CODE++c6d0c9d65b752916c8f5647d310c760cc1f9e2aa20e9994942fe8a8219f5e043">
3015+
<source xml:lang="en">Save as Excel ({0})</source>
3016+
<note>{0} is the keyboard shortcut for saving as Excel</note>
3017+
</trans-unit>
3018+
<trans-unit id="++CODE++b99387bd84bcf310d6fb1c7e860b919e4f57e8d6d1fdac34cc2e624cbf0b5496">
3019+
<source xml:lang="en">Save as INSERT INTO</source>
3020+
</trans-unit>
3021+
<trans-unit id="++CODE++d4c4a2d704829f0ab4b2a416311ebfab2b516e06fb2fe3eb0673fe5c2f65104c">
3022+
<source xml:lang="en">Save as INSERT INTO ({0})</source>
3023+
<note>{0} is the keyboard shortcut for saving as INSERT INTO</note>
29893024
</trans-unit>
29903025
<trans-unit id="++CODE++910ed5e0c43df2bc1a2c71f1d5ecd2168b919fd4dc9f6d4b1f13f660cba9c524">
29913026
<source xml:lang="en">Save as JSON</source>
29923027
</trans-unit>
3028+
<trans-unit id="++CODE++0572989f274f777f1664fd8629f853c8dd7c0ec75f8d64332f4501b5d45c40d5">
3029+
<source xml:lang="en">Save as JSON ({0})</source>
3030+
<note>{0} is the keyboard shortcut for saving as JSON</note>
3031+
</trans-unit>
29933032
<trans-unit id="++CODE++bae1da28225af71a125385224716f5ff7870573e6c01494c597e8ed4168b12e3">
29943033
<source xml:lang="en">Save results command cannot be used with multiple selections.</source>
29953034
</trans-unit>
@@ -3218,8 +3257,12 @@
32183257
<trans-unit id="++CODE++8c6f0777a59f6d55efb68be5323e48061f19e0b2c036c9f34f3ea7655eeaead2">
32193258
<source xml:lang="en">Show MSSQL output</source>
32203259
</trans-unit>
3221-
<trans-unit id="++CODE++1615831401345ad7af7c55f1b68f51dd051827cf4ab1e7f3864619ce377d6ef1">
3222-
<source xml:lang="en">Show Menu (F3)</source>
3260+
<trans-unit id="++CODE++a16e132b133cc57c4d467bde193d78fe48f170a197d0581c2e6578162824902f">
3261+
<source xml:lang="en">Show Menu</source>
3262+
</trans-unit>
3263+
<trans-unit id="++CODE++d014d52362848d2e01dc78db0a3788e52c984baecefb3c94fd4539d03e331e78">
3264+
<source xml:lang="en">Show Menu ({0})</source>
3265+
<note>{0} is the keyboard shortcut for showing the menu</note>
32233266
</trans-unit>
32243267
<trans-unit id="++CODE++169b9d739add25522ff9a236b54583826c27bd79c2dcb1a4efcc50143164f78c">
32253268
<source xml:lang="en">Show New Password</source>
@@ -3404,12 +3447,20 @@
34043447
<trans-unit id="++CODE++a8e5ca29d45327e2790dbaef626ac6f467741af4efddd4d0aede688f4612677e">
34053448
<source xml:lang="en">Switch to Grid View</source>
34063449
</trans-unit>
3450+
<trans-unit id="++CODE++8882381c4129993cbaf9650deef13f6320270deb238c6d124489eb7ecfab1c29">
3451+
<source xml:lang="en">Switch to Grid View ({0})</source>
3452+
<note>{0} is the keyboard shortcut for switching to grid view</note>
3453+
</trans-unit>
34073454
<trans-unit id="++CODE++5b483648ad7b3afcd20f3ccef6fdc7471e39d5a8c9bb30697cba5f82c4ff8dc1">
34083455
<source xml:lang="en">Switch to MSAL</source>
34093456
</trans-unit>
34103457
<trans-unit id="++CODE++fe49fbfd86c4792c2bd6cf8b59085cc2d787fa377a2af3ebdcbd88104e556d8c">
34113458
<source xml:lang="en">Switch to Text View</source>
34123459
</trans-unit>
3460+
<trans-unit id="++CODE++1cd65c404018fe0b10838ebb1d185bc820d942c2bab789cf9e0ed90db9bb6451">
3461+
<source xml:lang="en">Switch to Text View ({0})</source>
3462+
<note>{0} is the keyboard shortcut for switching to text view</note>
3463+
</trans-unit>
34133464
<trans-unit id="++CODE++494731de200692139842ce40b55ca4e15ccb299d4d82b803ed1f0bd25ce82efd">
34143465
<source xml:lang="en">Switching to Linux containers was canceled. SQL Server only supports Linux containers.</source>
34153466
</trans-unit>

package.json

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,21 +1594,37 @@
15941594
"type": "object",
15951595
"description": "%mssql.shortcuts%",
15961596
"default": {
1597-
"_comment": "Short cuts must follow the format (ctrl)+(shift)+(alt)+[key]",
1598-
"event.toggleResultPane": "ctrl+alt+R",
1599-
"event.focusResultsGrid": "ctrl+alt+G",
1600-
"event.toggleMessagePane": "ctrl+alt+Y",
1601-
"event.prevGrid": "ctrl+up",
1602-
"event.nextGrid": "ctrl+down",
1603-
"event.copySelection": "ctrl+C",
1604-
"event.copyWithHeaders": "",
1605-
"event.copyAllHeaders": "",
1606-
"event.maximizeGrid": "",
1607-
"event.selectAll": "ctrl+A",
1608-
"event.saveAsJSON": "",
1609-
"event.saveAsCSV": "",
1610-
"event.saveAsExcel": "",
1611-
"event.changeColumnWidth": "ctrl+alt+S"
1597+
"_comment": "Use 'ctrlcmd' to represent 'ctrl' on Windows/Linux and 'cmd' on macOS.",
1598+
"event.queryResults.switchToResultsTab": "ctrl+alt+R",
1599+
"event.queryResults.switchToMessagesTab": "ctrl+alt+Y",
1600+
"event.queryResults.switchToQueryPlanTab": "ctrl+alt+E",
1601+
"event.queryResults.prevGrid": "ctrlcmd+up",
1602+
"event.queryResults.nextGrid": "ctrlcmd+down",
1603+
"event.queryResults.switchToTextView": "",
1604+
"event.queryResults.maximizeGrid": "",
1605+
"event.queryResults.saveAsJSON": "",
1606+
"event.queryResults.saveAsCSV": "",
1607+
"event.queryResults.saveAsExcel": "",
1608+
"event.queryResults.saveAsInsert": "",
1609+
"event.resultGrid.copySelection": "ctrlcmd+c",
1610+
"event.resultGrid.copyWithHeaders": "",
1611+
"event.resultGrid.copyAllHeaders": "",
1612+
"event.resultGrid.selectAll": "ctrlcmd+a",
1613+
"event.resultGrid.copyAsCSV": "",
1614+
"event.resultGrid.copyAsJSON": "",
1615+
"event.resultGrid.copyAsInsert": "",
1616+
"event.resultGrid.copyAsInClause": "",
1617+
"event.resultGrid.changeColumnWidth": "alt+shift+s",
1618+
"event.resultGrid.expandSelectionLeft": "shift+left",
1619+
"event.resultGrid.expandSelectionRight": "shift+right",
1620+
"event.resultGrid.expandSelectionUp": "shift+up",
1621+
"event.resultGrid.expandSelectionDown": "shift+down",
1622+
"event.resultGrid.openColumnMenu": "f3",
1623+
"event.resultGrid.moveToRowStart": "ctrlcmd+left",
1624+
"event.resultGrid.moveToRowEnd": "ctrlcmd+right",
1625+
"event.resultGrid.selectColumn": "ctrl+space",
1626+
"event.resultGrid.selectRow": "shift+space",
1627+
"event.resultGrid.toggleSort": "alt+shift+o"
16121628
},
16131629
"scope": "resource"
16141630
},

src/constants/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ export const configSavePasswordsUntilRestart =
252252
"mssql.connectionManagement.rememberPasswordsUntilRestart";
253253
export const configAutoRevealResultsPanel = "mssql.autoRevealResultsPanel";
254254
export const configCustomEnvironment = "mssql.customEnvironment";
255+
export const configShortcuts = "mssql.shortcuts";
255256

256257
// Built into VS Code
257258
export const sovereignCloudSectionName = "microsoft-sovereign-cloud";

0 commit comments

Comments
 (0)