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.54k stars 897 forks source link

Add SQL binding command should be available on file explorer context menu #17731

Open Charles-Gagnon opened 2 years ago

Charles-Gagnon commented 2 years ago

It would be handy to have it show up on right click for cs files instead of just through command palette

lucyzhang929 commented 2 years ago

@Charles-Gagnon @chlafreniere @dzsquared Thoughts on the ordering for "Add SQL Binding" in the context menu?

Screen Shot 2021-11-30 at 7 45 57 PM
dzsquared commented 2 years ago

curious: Is this visibility sensitive to whether a functions project is loaded and/or whether the functions extension is installed?

As to placement I'd want to be consistent with any other file explorer context menu items from the mssql extension - which we may be the first. In our own grouping is good, but relative high/low placement is open.

Charles-Gagnon commented 2 years ago

Something like that looks great @lucyzhang929

What @dzsquared said would be good though, if there's a way to make this only show up when we detect that it's a functions project that would be great. I think you might be able to achieve something like this using a custom context and the 'in' clause : https://code.visualstudio.com/api/references/when-clause-contexts#in-conditional-operator

(there may be a better way of doing it though, feel free to look through the options there and see if you can think of any other ways to get what we want)

This might be something we punt though - that's probably going to be a bit more work to hook it all up and while useful it isn't something we need right away.

lucyzhang929 commented 2 years ago

Yep right now the only condition we check is that the file is csharp so it can be annoying/confusing for users not in a functions project. I'll check if theres an easy way to hook up the custom context, if not we can punt this.