microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.56k stars 901 forks source link

Add "Open With Azure Data Studio" to Explorer #22225

Open petertirrell opened 1 year ago

petertirrell commented 1 year ago

Describe the solution or feature you'd like With VS Code, it can add an open to the Windows Explorer context menu to "Open with Code" when you right-click on a file or folder. This then opens the file or folder in VS Code. I find this useful to open git reposin the editor. I think it would be useful to be able to do this with ADS as well, to be able to open my SQL repo in ADS, vs having to open ADS and then "Open Folder" from within the editor.

michelmetran commented 11 months ago

I was also looking for how to do this, since I'm facing the problems reported in issue #22022 and, every time I need to open a new Azure Data Studio window, I need to open the terminal and enter the command:

azuredatastudio .

I created an entry in the Windows registry that added the ability to open a folder from the Windows Explorer context menu.

I created a key, following instructions when in doubt How do you add an option to the right-click context menu in Windows Explorer?, published on Quora.

The contents of the .reg file I created are:

Windows Registry Editor Version 5.00

;Adiciona AzureDataStudio no menu de Contexto do Windows 11
;https://www.quora.com/How-do-you-add-an-option-to-the-right-click-context-menu-in-Windows-Explorer
;https://github.com/microsoft/azuredatastudio/issues/22022
;https://github.com/microsoft/azuredatastudio/issues/22225
;Michel Metran
;Novembro de 2023

[HKEY_CLASSES_ROOT\Directory\background\shell\AzureDataStudio]
"Icon"="\"C:\\Program Files\\Azure Data Studio\\azuredatastudio.exe\""
@="Open with Azure Data Studio"

[HKEY_CLASSES_ROOT\Directory\background\shell\AzureDataStudio\command]
@="\"C:\\Program Files\\Azure Data Studio\\azuredatastudio.exe\" \".\""

So, just create the .reg file with the above content and run.