Categories
Artificial Intelligence Journalism Software Engineering Tutorial

GitHub Copilot – VSCode – Add New File Extensions, File Types, and Programming Languages for Completion

This article is a short description of how to add new file extensions, file types, and new programming languages to your GitHub Copilot extension in VSCode.

Since you are already here I will assume you know what GitHub, VSCode, VSCode Extensions, and VSCode Extension Settings are.

By default the GitHub Copilot Visual Studio Code Extension does not have all completion enabled for all file types. For example, if you want to add .txt files or .yaml files or other files like that you can do so easily with the extension settings.

Step 1 – Open The VSCode Extension Settings

I did this by opening Settings and searching “copilot”.

How To Enable or Disable Copilot for Other Programming Languages or File Types? What Languages Are There?

If you click the tiny link that says “languages” you get sent to an extremely helpful website that has documentation for exactly what languages are supported. Generally speaking the language that you choose dictates what file extensions it supports.

These are called “Language Identifiers” by VSCode.

Click Here to See the Languages GitHub Copilot VS Code supports.

Remember: Github Copilot Does Not Support Every Language

They support some subset and it changes. Try your best to find a Language Identifier that works with your file extension.

Github Copilot Doesn’t Support My File, File Extension, or Programming Language

It might! Read some of the VSCode Language Descriptions carefully and see if they apply to your filetype.

There Is No Way For GitHub Copilot To Support .txt Text Files?

Oh but there is! It is done by putting the VSCode Language Extension called Plaintext in the correct place in the GitHub Copilot VSCode Extension Settings.

Click Edit in settings.json

This will open up the GitHub Copilot section of your VSCode Settings JSON file.

Add Your Language Identifier

In this example we want to add our .txt files for completion so we add the “plaintext” language identifier to our settings.json file and set it to “true”.

Yay! You Have GitHub Copilot VSCode in New Files!

Your to-do lists can now complete themselves.