Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>GrainNew to Visual Studio Code? Get it now.

Grain

The Grain Programming Language

|
1,766 installs
| (2) | Free
Grain support for Visual Studio Code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VSCode extension for Grain

The VSCode extension for the Grain programming language.

Requires: vscode 1.67+

Functionality

This LSP Protocol client provides the the following language features for grain (.gr) files:

  • Show compilation warnings and errors
  • Code lenses
  • Hover support

Running the extension

  • Run npm ci in this folder.
  • Open VSCode inside this folder.
  • Switch to the "Run and Debug" pane.
  • Select "Launch Extension" from the drop down.
  • Press the ▶️ button next to "Launch Extension", which will start a TypeScript watcher and launch a new VSCode instance titled [Extension Development Host].
  • The Grain CLI needs to be on your path. If not, set the cliPath setting inside the [Extension Development Host] instance to the location of your Grain CLI.
  • In the [Extension Development Host] instance of VSCode, open a document in 'grain' language mode.
  • After a code change, you'll likely need to trigger a "Developer: Reload Window" action in the [Extension Development Host] instance before the extension will pick up the changes.

Useful files

  • package.json - this is the manifest file in which you declare your language support and define the location of the grammar file that has been copied into your extension.
  • syntaxes/grain.tmLanguage.json - this is the Text mate grammar file that is used for tokenization.
  • language-configuration.json - this the language configuration, defining the tokens that are used for comments and brackets.
  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft