mtxr / vscode-sqltools

Database management for VSCode
https://vscode-sqltools.mteixeira.dev?utm_source=github&utm_medium=homepage-link
MIT License
1.44k stars 291 forks source link

Autofill name and group when bookmarking #1137

Open djbrown opened 1 year ago

djbrown commented 1 year ago

When I edit an existing Bookmark, the metadata (group and name) is pasted into the Editor:

-- @block Bookmarked query
-- @group Some Group
-- @name My Query

delete from my_table;

Prevent duplication

When I select the block via the UI button, it also selects those metadata comments. When bookmarking that selection into a new bookmark, the previous comments will be saved too, cluttering the new bookmark and creating a separate block.

-- @block Bookmarked query
-- @group Some Group
-- @name NEW Query

-- @block Bookmarked query
-- @group Some Group
-- @name My Query

delete from my_table;

So the first improvement would be to not copy those previous comments to the new bookmark:

-- @block Bookmarked query
-- @group Some Group
-- @name NEW Query

delete from my_table;

Prefill bookmarking popups

Secondly, it would be super nice to have the popups for group and name autofilled with the values of the comments. The popup value should be selected tough, so you can easlily override the prefilled values: grafik

If no metadata comments are includet in the selection for bookmarking, then the current behaviour may be kept: Blank query name and prefilled group "Ungrouped".