From a56f2d9c720479efbb1ecfbfba26bd95e81619dc Mon Sep 17 00:00:00 2001 From: Dave Townsend Date: Tue, 10 Jun 2025 19:27:18 +0000 Subject: [PATCH] Bug 1966892: Add recommended extension and configuration for autolinking bug numbers and phabricator revisions in VSCode terminals. r=Standard8 Differential Revision: https://phabricator.services.mozilla.com/D253154 --- .vscode/extensions.json | 2 ++ python/mozbuild/mozbuild/backend/mach_commands.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index b6e8e3548077..783a3ebf6758 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -20,5 +20,7 @@ "mythmon.idl", // VSCode Remote Development over SSH "ms-vscode-remote.remote-ssh", + // Support auto-linking bug numbers and phabricator revisions in the terminal + "fractalbrew.terminal-links", ] } diff --git a/python/mozbuild/mozbuild/backend/mach_commands.py b/python/mozbuild/mozbuild/backend/mach_commands.py index aab852030581..8ffb2052e214 100644 --- a/python/mozbuild/mozbuild/backend/mach_commands.py +++ b/python/mozbuild/mozbuild/backend/mach_commands.py @@ -166,6 +166,21 @@ def setup_vscode(command_context, interactive): "editor.formatOnSave": True, } + # Add matchers for autolinking bugs and revisions in the terminal. + new_settings = { + **new_settings, + "terminalLinks.matchers": [ + { + "regex": "\\b[Bb]ug\\s*(\\d+)\\b", + "uri": "https://bugzilla.mozilla.org/show_bug.cgi?id=$1", + }, + { + "regex": "\\b(D\\d+)\\b", + "uri": "https://phabricator.services.mozilla.com/$1", + }, + ], + } + import difflib try: