diff --git a/content/copilot/configuring-github-copilot/configuring-github-copilot-in-your-environment.md b/content/copilot/configuring-github-copilot/configuring-github-copilot-in-your-environment.md index 290dc4e567b0..a0f7d2d50394 100644 --- a/content/copilot/configuring-github-copilot/configuring-github-copilot-in-your-environment.md +++ b/content/copilot/configuring-github-copilot/configuring-github-copilot-in-your-environment.md @@ -77,12 +77,110 @@ You can enable or disable {% data variables.product.prodname_copilot %} from wit You can manage advanced settings for {% data variables.product.prodname_copilot %} in your JetBrains IDE, such as how your IDE displays code completions, and which languages you want to enable or disable for {% data variables.product.prodname_copilot %}. -1. In your JetBrains IDE, click the **File** menu, then click **Settings**. -1. Under **Languages & Frameworks**, click **{% data variables.product.prodname_copilot %}**. +{% data reusables.copilot.jetbrains-settings %} +{% data reusables.copilot.jetbrains-languages-and-frameworks %} 1. Edit the settings according to your personal preferences. - To adjust the behavior and appearance of code suggestions, and whether to automatically check for updates, select or deselect the corresponding checkboxes. - If you have selected to receive automatic updates, you can choose whether to receive stable, but less frequent updates, or nightly updates, which may be less stable. Click the **Update channel** dropdown and select **Stable** for stable updates, or **Nightly** for nightly updates. - - Under "Disabled languages," use the checkboxes to select or deselect the languages you want to disable {% data variables.product.prodname_copilot %} for. + +## Configuring language settings for {% data variables.product.prodname_copilot %} + +You can specify which languages you want to activate or deactivate {% data variables.product.prodname_copilot %} for either in the IDE or by editing your `github-copilot.xml` file. If you make changes to language settings in your IDE, you can individually select and deselect the languages you want to activate or deactivate. + +If you make changes to the language settings in your `github-copilot.xml` file, you can specify individual languages, or you can use a wildcard to activate or deactivate {% data variables.product.prodname_copilot %} for all languages. You can also specify exceptions, which will override the wild card setting for the specified languages. For example, you can deactivate {% data variables.product.prodname_copilot %} for all languages, except for Python and YAML. By default, when you install the {% data variables.product.prodname_copilot %} extension, {% data variables.product.prodname_copilot %} is activated for all languages. + +### Configuring language settings in the IDE + +{% data reusables.copilot.jetbrains-settings %} +{% data reusables.copilot.jetbrains-languages-and-frameworks %} +1. Under "Languages," select or deselect the checkboxes for the languages you want to activate or deactivate {% data variables.product.prodname_copilot %} for. +1. Click **Apply**, and then click **OK**. +1. Restart your JetBrains IDE for the changes to take effect. + +### Editing your `github-copilot.xml` file + +To configure language settings in the `github-copilot.xml` file, you must edit the `languageAllowList`. Every line you add to the `languageAllowList` must contain an entry key and a value. The entry key is the name of the language, or (`*`) for a wildcard. The value is either `true` or `false`. If the value is `true`, {% data variables.product.prodname_copilot %} is activated for the specified language. If the value is `false`, {% data variables.product.prodname_copilot %} is deactivated for the specified language. + +The file is located in the following directory: + +- **macOS**: `~/Library/Application Support/JetBrains//options/github-copilot.xml` +- **Windows**: `%APPDATA%\JetBrains\\options\github-copilot.xml` +- **Linux**: `~/.config/JetBrains//options/github-copilot.xml` + +For example, if you are using IntelliJ IDEA 2021.1 on macOS, the file is located at `~/Library/Application Support/JetBrains/IdeaIC2021.1/options/github-copilot.xml`. + +The `github-copilot.xml` file might not be generated until you make a change to your default language configuration in the IDE's settings. If you cannot locate the file, you should try modifying the default language settings in the IDE. For more information, see "[Configuring language settings in the IDE](#configuring-language-settings-in-the-ide)." + +Alternatively, you can create the file manually and save it in the location for your operating system listed above. For more information, see "[Example language configurations](#example-language-configurations)." + +1. Open the `github-copilot.xml` file in a text editor. +1. Between the `` tags, add the line or lines for the languages you want to activate or deactivate {% data variables.product.prodname_copilot %} for. For example, to deactivate {% data variables.product.prodname_copilot %} for all languages: + + ```xml copy + + ``` +1. Save the changes to the `github-copilot.xml` file. +1. Restart your JetBrains IDE for the changes to take effect. + +### Example language configurations + +The default configuration of the `github-copilot.xml` file, which enables {% data variables.product.prodname_copilot %} for all languages is as follows: + +```xml copy + + + + + + + + + +``` + +To deactivate {% data variables.product.prodname_copilot %} for all languages, the wildcard (`*`) value is changed to `false`: + +```xml copy + + + + + + + + + +``` +To specify languages individually, add an entry for each language you want to activate or deactivate {% data variables.product.prodname_copilot %} for. Specific language settings will override the wildcard. For example, to activate {% data variables.product.prodname_copilot %} for Python and YAML, and deactivate {% data variables.product.prodname_copilot %} for all other languages, add the following entries: + +```xml copy + + + + + + + + + + + +``` + +You can also add a configuration to make the `languageAllowList` readonly in the IDE's settings. This will prevent you from changing the language settings in the IDE. For example: + +```xml copy + + + + +``` {% data reusables.copilot.dotcom-settings %} diff --git a/data/reusables/copilot/jetbrains-languages-and-frameworks.md b/data/reusables/copilot/jetbrains-languages-and-frameworks.md new file mode 100644 index 000000000000..d6057f60ab9e --- /dev/null +++ b/data/reusables/copilot/jetbrains-languages-and-frameworks.md @@ -0,0 +1 @@ +1. Under **Languages & Frameworks**, click **{% data variables.product.prodname_copilot %}**. \ No newline at end of file diff --git a/data/reusables/copilot/jetbrains-settings.md b/data/reusables/copilot/jetbrains-settings.md new file mode 100644 index 000000000000..d421f8e20b63 --- /dev/null +++ b/data/reusables/copilot/jetbrains-settings.md @@ -0,0 +1 @@ +1. In your JetBrains IDE, click the **File** menu, then click **Settings**. \ No newline at end of file