Rain Language Support for Visual Studio Code (vscode extention)
Rain language support for vscode. Uses Rain Language Services from rainlang repo under the hood.
Rain Language Server works for rain files with
rainlang`result: add(1 2);`
It has the following language features:
It also includes an End-to-End test.
After installing the extention from vscode marketplace, if
.vscode/settings.json does not already exists in your workspace, create it and add the following property:
"rainlang.opmeta": "0x123abcd... // op meta compressed bytes in hex string"
524289 is Mumbai (Polygon testnet) chain id.
- if no
subgraphUrl are provided, the default Mumbai subgraph will be used and if both are provided, subgraph URL will be prioritized.
Use Rainlang Compile command accessible from Command Palette or from editor's context menu (right-click) to compile the selected rainlang document and get the ExpressionConfig.
- Clone the repo and open VS Code on this folder.
npm install in this folder or
nix-shell if you have nix installed on your machine. This installs all necessary npm modules in both the client and server folder
- Switch to the Run and Debug View in the Sidebar (Ctrl+Shift+D).
Launch Client from the drop down (if it is not already).
- Press ▷ to run the launch config (F5) which will open a new instance of vscode called Extension Development Host.
- In the Extension Development Host instance of VSCode, open or create a new workscpace and then create
.vscode/settings.json and set the
opmeta as explained above in Tutorial section.
- Create a document that ends with
.rain to start the language mode for that. (save this workspace to have them ready for future).
- Start typing your expression and get the completion for opcodes.
- Hover over some of the opcodes or values to get hover items.
- The diagnostics will be generated automatically.
├── client // Rain Language Client
│ ├── src
│ │ ├── test // End to End tests for Language Client / Server
│ │ └── extension.ts // Language Client entry point
├── package.json // The extension manifest.
└── server // Rain Language Server
└── server.ts // Language Server entry point