microsoft / microsoft/vscode-mssql
[Bug]: Keyboard Shortcut not working for Search Database Object command
- Dominant language
- TypeScript
- Stars
- 1.9k
- Forks
- 610
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 97
Description
### Description
Expected my keyboard shortcut to open the Search database Objects for my connected DB.
It gives Cannot read properties of undefined (reading 'nodeType')
The keyboard shortcut set is:
```
{
"key": "cmd+k cmd+o",
"command": "mssql.searchDatabase",
},
```
The logs say:
```
2026-07-24 15:03:28.011 [error] TypeError: Cannot read properties of undefined (reading 'nodeType')
at r.getDatabaseName ([USER_HOME]/.vscode/extensions/ms-mssql.mssql-1.44.0/dist/extension.js:338:58806)
at new vve ([USER_HOME]/.vscode/extensions/ms-mssql.mssql-1.44.0/dist/extension.js:555:3626)
at X6.onSearchDatabase ([USER_HOME]/.vscode/extensions/ms-mssql.mssql-1.44.0/dist/extension.js:574:9351)
at [USER_HOME]/.vscode/extensions/ms-mssql.mssql-1.44.0/dist/extension.js:573:16234
at jg._executeContributedCommand (file:///VSCode.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:535:48815)
at jg.$executeContributedCommand (file:///VSCode.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:535:49786)
at i._doInvokeHandler (file:///VSCode.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:435:158411)
at i._invokeHandler (file:///VSCode.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:435:158159)
at i._receiveRequest (file:///VSCode.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:435:156941)
at i._receiveOneMessage (file:///VSCode.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:435:155779)
at Pp.value (file:///VSCode.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:435:153854)
at T._deliver (file:///VSCode.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:431:3244)
at T.fire (file:///VSCode.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:431:3562)
at fs.fire (file:///VSCode.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:433:8509)
at Pp.value (file:///VSCode.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:852:10003)
at T._deliver (file:///VSCode.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:431:3244)
at T.fire (file:///VSCode.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:431:3562)
at fs.fire (file:///VSCode.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:433:8509)
at MessagePortMain. (file:///VSCode.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:852:8171)
at MessagePortMain.emit (node:events:509:28)
at Object.emit (node:electron/js2c/utility_init:2:2934) mssql.searchDatabase {"value":"ms-mssql.mssql","_lower":"ms-mssql.mssql"}
```
### Steps to Reproduce
1. Assign command ID mssql.searchDatabase a keyboard shortcut
2. Press keyboard shortcut
3. Toast with error pops up
### Affected Area
- [ ] Connection dialog (SQL Server | Azure browse/Fabric browse)
- [ ] Query editor
- [ ] Query results panel
- [x] Object Explorer
- [ ] GitHub Copilot integration
- [ ] Preview/Edit data
- [ ] Table Designer
- [ ] Schema Designer
- [ ] Schema Compare
- [ ] Local SQL Server Container provisioning
- [ ] SQL database in Fabric provisioning
- [ ] DACPAC/BACPAC export/import
- [ ] SQL Database projects
- [ ] Query Plan Visualizer
- [ ] Other (please describe below)
### If you selected "Other", please describe the affected area
_No response_
### Environment Information
VS Code v1.130.0
Commit: 1b6a188127eeaf9194f945eb6eb89a657e93c54c
Arch: arm64
MSSQL v1.44.0
OS: macOS 26.5.2 (25F84)
Connection: Azure SQL
### Confirmation
- [x] I have searched existing issues and couldn't find a match
- [ ] I want to work on this issue
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the mssql.searchDatabase command and its onSearchDatabase path in the Object Explorer, using the reported keyboard shortcut and Azure SQL connection to reproduce the error. Trace how the command obtains the database context, then verify that invoking the shortcut opens Search Database Objects without the nodeType error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, typescript, vscode
- Domain
- databases, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100