Skip to content

Contribution

bitbegin edited this page Nov 6, 2020 · 8 revisions

Contribution

  • Please feel free to fork and submit pull requests
  • Feature requests can be added here

Prerequisites

  1. Node.js
  2. Red Console (need run ./red --cli)
  3. Windows, OS X or Linux

Setup

git clone https://github.com/red/VScode-extension
cd VScode-extension
npm install
code .

Debugging the extension

Finishing above steps, we can start debugging. Press F5 or use the "Launch Extension" launch option in debug view.

Debug redlangserver (the code use git submodule to put repo to server folder)

  • if you need use cli console from source code, please not add -d flag (there're should not any print info), compile like this do/args %red.r "-r environment/console/cli/console.red", then put it to C:\ProgramData\Red\, the console name also should changed like this console-2020-8-14-22474.exe. The extension will use the latest version.

  • view redlangserver debug log, need switch this on, then you can find logger.txt in folder server/

  • there are many test cases in folder test, you can see the ast like this:
[
  [
    range: [1x1 1x9]
    nested: 
    [
      [
        expr: #"^@"
        range: [1x1 1x9]
        type: char!
        upper: [1x1 1x9]
      ]
    ]
    source: {#"^^(00)"}
    lines: [
      {#"^^(00)"}
      1
    ]
  ]
]

the source code for this:

{#"^^(00)"}
  • semantic.red module will use this ast to report info to lsp client.

Syntax highlight: syntaxes/Red.tmLanguage.json