Inner Loop Buddy README
A Visual Studio Code extension that helps make your inner loop a little bit better. It does this by monitoring tasks you execute inside VS Code, and when one of those tasks matches a configured criteria, the extension opens VS Code’s built in “Simple Browser” to the URL specified.
It also lets you invoke a command manually to open the URL — no need to type the URL every time!
- Monitors tasks
- Opens a browser document based on criteria configured in your workspace
- Manual command to open at the configured URL
- Supports multi-root workspaces
- Tasks that are defined in
- Configured URL & Tasks to monitor
|Opens the configured default URL (see below). Only available when you have a folder or workspace open.
|Starts a quick pick wizard to help add task matching criteria to your folder or workspace settings. See below for more information.
|If your task configuration is complex, this command will help you print out the criteria to match a single (or all) tasks. This is intended to be used in debugging or complex scenarios. See below for more information.
All the extension settings are available in the VS Code settings UI. For reference, the extension contributes the following settings:
|URL to open when the command is invoked
|How often the browser should be triggered.
none (No monitoring, manual only),
onetime (Only the first time in a session the task is observed to start),
everytime (Every time the task starts)
|Should the extension monitor for matching tasks (
matching, the default), or
all (Ignores matches, just any task execution). Useful if you don’t want to configure task matching rules.
|Delay (in ms) before opening the browser. Opening the browser may be dependent on the server completing initialization. By setting this value to non-zero, the delay of opening the browser can be configured till after that initialization
|Editor column for the browser tab to open in. See the VS Code Documenation for more details on the behaviour. Defaults to
|Array of object shapes that will be used to find out if a task of interest has been executed. See below for more information.
|Preconnect to the target host when opening the browser, to ensure it's available
|Timeout for the availability check in milliseconds
|Enable/disable the floating indicator that shows when the page is focused in the browser
|Automatically append parameters to URLs in the simple browser to bypass the browser cache
Multi root support
If you are just using multiple independent folders, or a
code-workspace with only one folder, you are golden. You can skip to the next section.
Multi root workspaces in all scenarios. For more complex multi root configurations there may be added complexity. If you configure
code-workspace or User level tasks or extension configuration, you need to be aware of some challenges when executing tasks that will trigger opening the browser.
If the task and the extension configuration are at the same level (e.g. all in the workspace, or all in the folder), everything will work correctly. However, for tasks & monitoring criteria are configured at different levels (e.g. tasks in the workspace, criteria in a folder), we don’t know which folder the task is executed in — meaning it’s difficult to make a match.
In this case, we will try and match the rules by using the active text editors workspace. This means that if you have tasks on the workspace, rules in folder A, and a document open from folder B, you will not see the task trigger opening the browser window.
Configuring Task Matching Rules
If you have few, or simple rules, the extension provides a command to walk through adding it to the folder or workspace settings.
You can open this by:
- Opening the command palette (⇧⌘P (Mac),
Ctrl+Shift+P (Windows, Linux)
- Search for “Add Configuration to match tasks”
- Execute it
- Select a task you want to monitor
- You’re golden!
If your task is not from the folder and you’ve opened a
code-workspace or multiple folders, you’ll be asked where to place the settings.
If you have complex configuration, or just like doing things in away you have full control over, you can use the “Print Task configuration as matching criteria configuration” from the command palette. From this you can select a single task, or all tasks. From that selection, an output window will be opened, with the JSON needed to add for the task(s) selected. Edit this as you see fit, and place in
codevoid.inner-loop-buddy.monitoredTasks for them to be matched
Why don’t these just match the format in
The data provided by VS Code at runtime does not directly match the configuration in
tasks.json. A primary example of this is that
tasks.json indicates the display name for the task — however, for objects that represent these tasks at runtime it’s called
name. This gets more complex as the tasks get more complex, and rather than providing a mapping from one to the other, we created a loose matching of a number of properties.
Most significantly, this means that these criteria are not an exact match, but in fact a subset of the match — if the criteria you specify is just the
type, then any task that is of that type will be considered a match. Tl;dr: More fields, more specific.