Skip to content

blackfisch/VSCode_SQF

 
 

Repository files navigation

SQF Language

This extension integrates the SQF Language into Visual Studio Code. For more information please visit the wiki.

This is a fork of Armitxes/VSCode_SQF, updated for more recent of ArmA 3. See the latest release on Github for information on which versions are currently supported.

Supported Products

Installation

VS Marketplace

  1. Go to the Visual Studio Marketplace or type blackfisch.sqf-language in the search bar of the extensions tab
  2. Click on Install

Manual Installation

Use this guide if the installation over the marketplace isn't possible.

  1. Download the main.zip
  2. Navigate to your VS Code extensions folder
    • Windows: %USERPROFILE%/.vscode/extensions
    • Mac/Linux: ~/.vscode/extensions
  3. In the extensions folder, you create a folder called Armitxes.SQF
  4. Extract the master.zip inside the Armitxes.SQF folder

Development

If you find any problems like incorrect syntax highlighting, missing commands or functions, please don't hesitate to report them in a new GitHub Issues.

Pull Requests for updating the syntax and supported commands are welcome. However, this project is considered legacy support only and new features will not be acepted. If you want to add new features, please consider forking the project or even better: start from scratch.

Updating the commands

  1. Run the updateFromWiki.py script from devHelper directory with Python 3. Parameter --all or a game name (e.g. arma3) has to be given.
    This will result in two (or more) files being generated in the devHelper/output directory.
  2. Copy the files from devHelper/output to their corresponding directories:
    • copy <game>.min.json to shared/commands/json/
    • copy sqf.min.json to syntaxes/

Adding new control statements

Controls statements (e.g. if, for), comparison statements (e.g. ==, isEqualTo) and a few more types of commands are defined separately to apply different syntax highlighting than to "ordinary" commands.

In order to add a new command to the list, you have follow a few steps before running the updateFromWiki.py script.

  1. Edit syntaxes/sqf.min.json and add the command to the regex. The file is pretty large, So I'd recommend searching for an existing command within the same "class" and adding it there (i.e. isNotEqualTo should be added where isEqualTo is defined)
  2. Edit devHelper/wiki/getCommands.py and add the command to the invalid_commands regex there. In this case, position does not matter.
  3. Now you can follow the steps described in the Updating the commands section.

Links & Downloads