LaunchDarkly extension for GitHub Copilot
The LaunchDarkly extension for GitHub Copilot is available to customers on select plans
The LaunchDarkly extension for GitHub Copilot on Visual Studio Marketplace is available only in conjunction with the LaunchDarkly VSCode extension. The VSCode extension is only available to customers on select plans. To learn more, read about our pricing. To upgrade your plan, contact Sales.
Overview
The LaunchDarkly extension for GitHub Copilot on Visual Studio Marketplace provides GitHub Copilot functionality for managing the lifecycle of a feature flag from within Visual Studio Code (VSCode).
To enable @LaunchDarkly commands in GitHub Copilot, confirm that you are using the latest version of VSCode and that you are using the GitHub Copilot Chat extension for VSCode.
In your GitHub Copilot prompt, you can use the following @LaunchDarkly commands:
Flag Actions command
Use the LaunchDarkly: Flag Actions command to bring up a menu of options that you can choose from to interact with your feature flags.
Dashboard Shortcuts command
Use the LaunchDarkly: Dashboard Shortcuts command to open a list of your shortcuts for the configured project.
Code references in the VSCode extension
The LaunchDarkly VSCode extension supports code references. If you use code references, configuring aliases makes the informational hover available wherever an alias appears in your code. Aliases appear under the flag entry in the Explorer view. To learn more, read Find flag aliases.
Flag searches across the workspace also include flag references.
Quick targeting in the VSCode extension
The LaunchDarkly VSCode extension supports quick targeting. This is useful if you use a consistent targeting context key or rule when coding with feature flags.
It will look for a yaml file, rules.yaml, located in the .launchdarkly subdirectory of your home directory. The full path is: ~/.launchdarkly/rules.yaml.
Here’s an example:
Targets
You can define targets with the following attributes:
- Name: A descriptive name for the target.
- ContextKind (Optional): The kind of context for account-related targeting, for example,
account. If not provided, defaults touser. - Values: An array of specific keys or identifiers for targeting.
Rules
Rules are conditions set for targeting. Each rule has:
- Name: A descriptive name for the rule.
- Clauses: Conditions under which this rule applies. Each clause can specify:
- ContextKind: The context kind, such as
user, to which the clause applies. - Attribute: The specific attribute within the context to evaluate, such as
organization. - Operation (op): Defines the operation to apply for the clause’s condition. Supported operations include:
in,endsWith,startsWith,matches,contains,lessThan,semVerEqual,semVerLessThan,semVerGreaterThan,before, andafter. - Negate: A boolean indicating if the condition should be inverted. If true, the rule applies when the condition is not met.
- Values: An array of values to compare the attribute against based on the operation.
- ContextKind: The context kind, such as
Telemetry
LaunchDarkly collects information about your use of this extension in accordance with the LaunchDarkly privacy policy.
You can opt out at any time in the extension settings by navigating to LaunchDarkly > Enable Telemetry and unchecking the box. We also respect the VSCode Telemetry setting.