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: