Skip to main content

File Type Associations

When a file is opened in an IDE, the IDE chooses the language service to use according to the file's type. When a file's type doesn't match any association in the IDE, no syntax highlighting or code analysis is provided.

Benefits of file type associations

By setting file type associations, IDEs become able to offer syntax highlighting and code analysis for a given file type.

Additionally, for some CLI file types, schemas are provided. Those offer autocompletion.

For example, Economy has multiple file types (.ecc, .ecr, .ecv, .eci), all of which are populated with JSON content. By associating the Economy file types .ecc, .ecr, .ecv and .eci to JSON, autocompletion will be provided for each expected JSON key (given that the file is being modified in the IDE where the associations were declared).

Setting up file type associations

Rider

  1. Go to Settings/Preferences > Editor > File Types
  2. Select a language service (this is the language service that will provide syntax highlighting and code analysis for the file type, see examples)
  3. Enter a file name pattern (ex: inputting *.ecc will make it so any file that has the .ecc extension will adhere to the language service provided, see examples)
  4. Save

If the above does not work, visit Rider's Documentation on File Type Associations.

Verify that the file type association was successful by opening the file in your IDE and testing that autocomplete and syntax highlighting are working.

Visual Studio Code

  1. Go to Settings > Text Editor > Files
  2. Under "associations", click "Add Item"
  3. As key, enter a file name pattern (ex: inputting *.ecc will make it so any file that has the .ecc extension will adhere to the language service provided, see examples)
  4. As value, enter a language service (this is the language service that will provide syntax highlighting and code analysis for the file type, see examples)
  5. Click "Ok"

If the above does not work, visit Visual Studio Code's Documentation on File Type Associations.

Verify that the file type association was successful by opening the file in your IDE and testing that autocomplete and syntax highlighting are working.

Visual Studio

  1. Go to Tools > Options > Text Editor > Extensions
  2. In the extension box, enter the desired file extension without * (ex: inputting .ecc will make it so any file that has the .ecc extension will adhere to the language service provided, see examples)
  3. Under the Editor dropdown, choose which language service to use for that file extension (this is the language service that will provide syntax highlighting and code analysis for the file type, see examples)
  4. Click on Add
  5. Click on Ok

You might need to restart Visual Studio for changes to take effect. This feature is not available in Visual Studio for Mac.

If the above does not work, visit Visual Studio's Documentation on File Type Associations

Verify that the file type association was successful by opening the file in your IDE and testing that autocomplete and syntax highlighting are working.

File type association examples

Economy

Language ServiceFile Type
json*.ecc
json*.eci
json*.ecv
json*.ecr

Remote Config

Language ServiceFile Type
json*.rc

Leaderboards

Language ServiceFile Type
json*.lb

Access Control

Language ServiceFile Type
json*.ac

Matchmaker

Language ServiceFile Type
json*.mmq
json*.mme

Cloud Code

Cloud Code .js files use JavaScript by default as a language service.

Cloud Code .ccm files are zipped files that are not meant to be modified by hand, therefore no file associations should be made.