TabPainter for Azure Data Studio

01 February 2025
Azure Data StudioTypescript

Accidentally running a query on the wrong database server can have serious consequences. This extension for Azure Data Studio provides an immediate visual indicator of which server you're connected to by coloring your editor interface. Never accidentally run a query on the wrong server again!

Links

GitHub Link

Features

  • Automatically colors editor components based on the active database connection
  • Customizable color schemes for different server names with full regex support
  • Visual safeguard to easily distinguish between production and development environments
  • Helps prevent running queries on unintended servers

Extension Settings

Color Mapping Configuration

The main configuration is done through tabPainter.mapping, which defines the color rules:

{
  "tabPainter.mapping": [
    {
      "regex": "production.*", 
      "color": "#FF0000"
    },
    {
      "regex": "localhost",
      "color": "#00FF00"
    }
  ]
}

The "regex" entry supports all Javascript regex expressions and matches on the server connected in the active tab.

Other Settings

SettingDescriptionDefaultType
colorTabs.ignoreCaseIgnore case when matching regex patternstrueboolean
colorTabs.statusBarBackgroundColor the status bar backgroundtrueboolean
colorTabs.tabBorderColor the tab borderstrueboolean
colorTabs.titleBackgroundColor the title backgroundfalseboolean
colorTabs.activityBarBackgroundColor the activity bar backgroundfalseboolean
colorTabs.titleLabelShow colored title labelfalseboolean
colorTabs.tabBackgroundColor the tab backgroundfalseboolean

Changelog

  • [v0.1.0]
    • Initial release

Credits

I took inspiration from the Visual Studio Code extension ColorTabs by Ore Poran.