/VScode-extension

Red extension for Visual Studio Code

Primary LanguageTypeScriptBoost Software License 1.0BSL-1.0

VSCode extension for Red

An extension with rich support for the Red language, with features including the following and more:

  • hint all syntax errors
  • auto completion
  • goto definition
  • navigate to any symbol definition
  • hover to view signatures
  • Interpret or compile Red source file

Quick Start

  • Install the extension
  • Install Red (Note: For Windows user, need to run red.exe --cli)

download

Note: latest automated build version should be installed for 0.3.x, and this extension not worked with last stable version

  • Turn off the Auto Completion

    You can turn off the autocompletion in the User or Workspace Settings file (settings.json) as follows.

    "red.autocomplete": false
    

Compile Red Source File

Specify the full path of the red toolchain

For compiling Red source file, you need to configure the path to the Red toolchain in the User or Workspace Settings file (settings.json) as follows.

"red.redPath": "/home/user1/tools/red-latest"

For Windows user: c:/work/red/red.exe or c:\\work\\red\\red.exe or c:\work\red\red.exe will all be accepted.

Specify the full path

You can also configure the directory for output files of the compiler. The current work space (project) directory is used by default.

(Note: If no work space directory, the output files are in the same folder as the Red source file.)

"red.buildDir": "/home/user1/debug"

If you are using Linux and prefer to use the Windows version of Red through Wine until GUI support is available for Linux, you can point red.redPath to a small shell script.

Shortcuts

Key Command Command id
F6 Interpret Current Red File red.interpret
Ctrl+F6 Interpret Current Red File(GUI) red.interpretGUI
F7 Compile Current Red File red.compile
Ctrl+K Ctrl+M Show Red Command Menu red.commandMenu

Configurations

The following Visual Studio Code settings are available for the Red extension. These can be set in user preferences or workspace settings.

{
    // Path to Red toolchain
    "red.redPath": "",

    // Directory to put compiling result of Red Source file.
    "red.buildDir": "",

    // Whether to enable or disable autocompletion.
    "red.autoComplete": true
}

The following commands are available for the Red extension. These can be associated with keyboard shortcuts via the keybindings.json file.

  • To configure keyboard shortcuts the way you want, go to the menu under File > Preferences > Keyboard Shortcuts. (Code > Preferences > Keyboard Shortcuts on Mac)
[
    { "key": "f6",                    "command": "red.interpret" },
    { "key": "ctrl+f6",               "command": "red.interpretGUI" },
    { "key": "f7",                    "command": "red.compile" },
    { "key": "ctrl+k ctrl+m",         "command": "red.commandMenu" },
]

Feature Screenshots

  • diagnostics

Image of Completions

  • auto completion

Image of Completions

  • goto definition

Image of Goto Definition

  • navigate to any symbol definition

Image of Goto Definition

  • hover to view signatures

Image of Goto Definition

  • Interpret or compile Red source file

Image of Red Command Menu

  • old Screenshots

Image of General Features

  • Contributions are always welcome. Fork it, modify it and create a pull request.
    • Details on contributing can be found here
  • Any and all feedback is appreciated and welcome.

Source

Github

License

BSL-1.0