Tabs Studio Blog (organizing Visual Studio document tabs)

March 11, 2014

Add an SQL query description to the SSMS tab name with the SQLComment add-in

Filed under: Uncategorized — Tags: , — Sergey Vlasov @ 9:35 pm

Many automatically opened SQL tabs in SQL Server Management Studio have names like SQLQuery1.sql, SQLQuery2.sql etc:

SQLQuery tabs in SSMS 2012

SQLQuery tabs in SSMS 2012

To better distinguish such tabs I’ve created the SQLComment add-in that can add a comment from the query body to the tab name:

Tabs with comments in SSMS 2012

Tabs with comments in SSMS 2012

You can chose any comment format and configure SQLComment to extract it using a .NET regular expression. For example, the default regex
StoredProcedure \[dbo\]\.\[(?<M>\w+)\] extracts the procedure name (AddEvent) to the M named group from the following code:

USE [ReportServer]
GO
/****** Object:  StoredProcedure [dbo].[AddEvent]    Script Date: 3/11/2014 8:29:10 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SQLComment options

SQLComment options

To extract description from a comment like ––– provides details on investors you can use the regex ^––– (?<M>.+)$. To support several formats you can combine regexes with ‘|’ like ^––– (?<M>.+)$|StoredProcedure \[dbo\]\.\[(?<M>\w+)\]. You can use several separate M groups (line Name and Ext in standard tab grouping), the resulting string will be concatenated from all captures. Only tabs starting with SQLQueryNN.sql are considered for commenting.

Download link: SQLComment v1.0.0.

Update (March 20): Added commenting support for grouped tabs SQLComment v1.0.1.

Update (October 23): Added the “Set SQL comment…” tab context menu command for temporary comments. Added more customization for displaying comments. SQLComment v1.0.4.

October 29, 2013

Multipart names in the title grouping regex

Filed under: Uncategorized — Sergey Vlasov @ 7:54 pm

I’ve added support for multiple captures of the Name and Ext groups in the Title grouping regex. For example,
(?<Name>.+?)-(?<Name>.+?)(?<Ext>\..+) will create the MainWindow name from the Main-Window.xaml tab. (?<Ext>Test)(?<Name>.+?)(?<Ext>\..+) will create the Test.xaml extension from the TestWindow.xaml. You can use as many separate Name and Ext groups as you need, the resulting string will be concatenated from all captures. It allows you to capture multiple parts of the original tab title as the name or extension. Technically I just switched to the built-in Group.Captures .NET regex feature.

Download link: Tabs Studio v3.1.5.

Update: Connell Watkins shared his use of multiple captures to group lots of similar files.

August 27, 2013

Solution settings directory

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 11:02 am

Saver and Marker add-ins need to save tabs order and highlighted tabs when you exit Visual Studio to restore them when you open the solution next time. This per-solution information is stored in .tss and .marker.tss files in directories along with your solution .sln files:

Marker and Saver per-solution files

Marker and Saver per-solution files

I’ve added an option to store all per-solution files in the one common directory. You need to create this directory and create the HKEY_CURRENT_USER\Software\Sergey Vlasov\Tabs Studio\SolutionSettingsDir registry value defining the directory for Tabs Studio add-ins:

SolutionSettingsDir registry setting

SolutionSettingsDir registry setting

New per-solution settings will be stored in this directory with different file names for different solutions:

Saver and Marker files in the common solution settings directory

Saver and Marker files in the common solution settings directory

June 27, 2013

Visual Studio 2013 Preview

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 3:13 pm

Visual Studio 2013 Preview was released yesterday (see also a video):

Visual Studio 2013 Preview splash

Visual Studio 2013 Preview splash

The only new documents navigation related feature I can see is Peek Definition:

Peek Definition in Visual Studio 2013 Preview

Peek Definition in Visual Studio 2013 Preview

It is similar to the older Code Definition tool window, but opens inside the code editor. Only one Peek Definition sub-window can be opened at once and it is read-only.

Sorting rules

Filed under: Uncategorized — Sergey Vlasov @ 8:05 am

The new version of the Sorter add-in lets you create multiple sorting rules:

Sorter Options

Sorter Options

For example, from the picture above the sorter rules are: tabs highlighted with the Marker add-in go to beginning, tabs with Test in the name go to end, and then tabs are sorted by project and by name.

The Rule type TabNameWithPath can be used in Web projects where tab names contain the parent folder name. The rule type Path uses the Paths property (document paths separated by ‘$’).

Match regex by default captures all text of the property selected by the rule type. You can match e.g. tabs from the project Core with (?<M>^Core$) and move these tabs to the beginning or to the end. Or you can group tabs by category, listing prefixes and suffixes in tab names around category words:
^(I|Test)?(?<M>.+?)(Manager|Repository)?\..+$

Inverse order when unchecked sorts tabs in alphabetical order or places matched tabs to beginning. When checked – sorts from Z to A or places matched tabs to end.

Download link: Sorter v1.0.10

June 26, 2013

Prefix tab grouping with ITransform

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 2:37 pm

It is common to have concepts like User and Admin with multiple classes around them like UserManager, UserRepository and AdminManager, AdminRepository. With prefixes I, Test and suffixes Manager, Repository we end up with the following tabs:

Multiple tabs in Visual Studio 2012

Multiple tabs in Visual Studio 2012

Normally tabs are not nicely sorted by concept like on the picture above and you may want to automatically group related tabs in a larger tab. It is easy to group by suffix – just add common suffix names to the extension part in the Title grouping regex:

Suffix grouping options

Suffix grouping options


Tabs with suffix grouping

Tabs with suffix grouping

Grouping by prefix is also easy – add common prefix names to the front of the Title grouping regex:
(?<Prefix>I|Test)?(?<Name>.+?)(?<Ext>(Manager|Repository)?\..+)
Unfortunately, prefix names are now not displayed (because only Name and Ext groups are displayed by default):

Prefix grouping with truncated names

Prefix grouping with truncated names

This is when the ITransform add-in helps. It renames truncated names back to normal. In the latest v1.0.3 you can even customize how prefix information should be displayed:

ITransform Options

ITransform Options


Prefix grouping with ITransform

Prefix grouping with ITransform

Note that the Interface regex should match only tabs with our prefixes – the Prefix group is not optional comparing to the Title grouping regex. The Replacement regex can be for example only ${Prefix} or include your custom text.

Download link: ITransform v1.0.3

September 17, 2012

Marker menu palette

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 6:34 pm

Instead of a submenu, I’ve created a top level tab context menu selection for Marker highlighting colors:

Marker menu palette

Marker menu palette

It will be easier to mark tabs with different colors, but I’m a little worried that this menu item is now too eye catching. Please, let me know what do you think.

Tab text color customization

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 6:11 pm

There are 4 text elements in a tab: name, extension, name modification marker and extension modification marker. These elements are normally having the same color. Plus, in Visual Studio 2012, close tab button and open preview tab button are drawings also normally having the same color with the text elements. It is much easier to customize colors for all these elements in the new Tabs Studio version.

All elements now by default bind to the tab foreground color. Just set tab foreground color in a style and you are done:

<Style TargetType="TabsStudio:Tab" BasedOn="{StaticResource DefaultTabStyle}">
      <Setter Property="Foreground" Value="Red"/>
</Style>

As always, you can change the color for a specific element too. Plus in VS 2012 you can now change it for the close tab button and the open preview tab button:

<Style TargetType="TabsStudio:CloseTabButton" BasedOn="{StaticResource DefaultCloseTabButtonStyle}">
      <Setter Property="Foreground" Value="Blue"/>
</Style>

And now you can set tab foreground colors simply in the Tab Coloring Rule dialog depending on tab properties state:

Tab background and foreground rule setup

Tab background and foreground rule setup

You can set only background, only foreground or both colors. In the tab coloring rules list, the visible color will be background, foreground and both colors correspondingly:

Visible colors in the tab coloring rules list

Visible colors in the tab coloring rules list

Smart suggestions for tab coloring

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 4:20 pm

I’ve added suggestions to the Tab Coloring Rule dialog. Each field in the dialog now has a corresponding samples button that lets you quickly define tab coloring rules:

Tab Coloring Rule dialog with suggestion buttons

Tab Coloring Rule dialog with suggestion buttons

Let me remind you, that you can start adding a tab coloring rule from two places. From the tab context menu Set color… command and from the Tabs Studio Presentation options page. In the first case the suggestions will be tailored for the tab you selected to color and in the second case all open tabs appear in the suggestions.

For example, Project name regex suggestions for the selected tab contain tab’s project:

Project name regex suggestions for the selected tab

Project name regex suggestions for the selected tab

Selecting the exact match sets the regex to ^WpfApplication1$ and selecting the Contains option sets the regex to WpfApplication1. While you rarely have other projects containing selected project name, it shows how easily you can set the regex for example to Wpf and have a distinct color for all your WPF projects.

If you opened the dialog from Tabs Studio options, all project names from all open tabs appear in the suggestions. The names are alphabetically sorted and the first name has the prebuild regex for the exact match:

Project name regex suggestions for all tabs

Project name regex suggestions for all tabs

I should clarify that while suggestions are different for one tab and all tabs, the rule created works exactly the same. All that matter is actual text in a regex filed.

Tab extensions regex suggestions show extensions from the selected tab or from all tabs:

Tab extensions regex suggestions

Tab extensions regex suggestions

Coloring by file extension can also be done using Document paths regex, but only with the tab extensions regex you can target tabs like [Design]. Selecting an extension suggestion creates a regex like \.vb \[Design]\$. All special regex characters are automatically escaped (it works for all regex fields). \$ forces exact match on extension end.

Tab name regex suggestions work like Project name regex suggestions and Document paths regex suggestions work like Tab extensions regex suggestions.

Custom conditions suggestions show most common currently available tab properties (with current values in one tab mode):

Custom conditions suggestions

Custom conditions suggestions

The list of suggestions is filtered depending on what version of Visual Studio you are running, active Tabs Studio add-ins and whether you have one or more tab groups open. Selecting a suggestion adds a condition like <ConditionX IsTabSelected=”True”/>. It is a shortened form that I use only for this text edit control. The normal form of a WPF MultiDataTrigger condition (that I restore on dialog save) is this:

<Condition Binding="{Binding Path=IsTabSelected, RelativeSource={RelativeSource Self}}" Value="True"/>

Finally, Background suggestions let you select a template for a gradient or solid color brush:

Background suggestions

Background suggestions

September 12, 2012

The right position for the preview tab

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 5:05 pm

I’ve updated tabs layout algorithms in Tabs Studio to keep the preview tab in the last and right aligned position. For the horizontal tabs layout, the preview tab is now always in the right corner and on the last row with normal tabs, if there is space, or below them:

The preview tab on the last row

The preview tab on the last row

If you use vertical tabs in Visual Studio 2012, the preview tab is now always at the bottom of normal tabs and to the right:

The preview tab at the bottom of vertical tabs in Visual Studio 2012

The preview tab at the bottom of vertical tabs in Visual Studio 2012

« Newer PostsOlder Posts »

Blog at WordPress.com.