Skip to content

CloudSlang/cs-intellij-plugin

Repository files navigation

CloudSlang Plugin for IntelliJ

Build Status

This repository contains an IntelliJ plugin that provides support for CloudSlang in IntelliJ IDEA IDE.

CloudSlang Plugin demo

Table of Contents

  1. Features
  2. Installation
  3. Getting Started
  4. Build and test locally
  5. Contribution Guideline
  • CloudSlang file type support (.sl, .sl.yaml, .sl.yml, .prop.sl)
  • Live templates (e.g: flow, operation, input, output, step, for, java_action etc.)
  • Completion support for CloudSlang keywords
  • Syntax highlighting
  • CloudSlang file validation and error highlighting
  1. Install the CloudSlang IntelliJ Plugin in IntelliJ using the Plugin Installation Wizard from File > Settings > Plugins > Browse repositories... and search for: CloudSlang plugin.
  2. Click Apply button of the Settings dialog.

Following the system prompt that appears, restart IntelliJ IDEA to activate the installed plugin, or postpone it, at your choice.

This is a short tutorial showing how to start developing CloudSlang content.

1. Create a new Project

From the New Project dialog, select the CloudSlang project type.

CloudSlang File Type

2. Create a namespace

Under the new project, create a structure of directories for items grouping:

CloudSlang File Type

You can notice the following directory structure under your project:

CloudSlang File Type

3. Create a new CloudSlang file

Under the base directory, create a new file with one of the following extensions: .sl, .sl.yaml, .sl.yml, .prop.sl
When a file with one of these extensions is created, a CloudSlang icon is associated to it:

CloudSlang File Type

By default, empty CloudSlang files are marked as invalid.

4. Create a new CloudSlang flow from a live template

Open the first_flow.sl file and place the cursor inside the editor.

You can insert a flow template in two ways:

  • Press Ctrl + J to display a list of all available live templates. You can navigate up and down inside this list and select the desired template, that will be extended in the editor.

CloudSlang File Type

  • Start typing the flow word and the template will appear in the suggestions list

CloudSlang File Type

You can always identify CloudSlang templates in the suggestions list by the CloudSlang Template description at right.

After the template is expended in IntelliJ, you may be required to provide values for some input fields. You can navigate between input fields by pressing Tab.

CloudSlang File Type

5. Use completion support for CloudSlang keywords

You can easily modify the flow using CloudSlang keywords support. Whenever you start typing, a suggestion list with CloudSlang keywords will appear:

CloudSlang File Type

To see the complete list of CloudSlang keywords, press Ctrl + Space

In order to differentiate between keywords and live templates in the suggestions list, note that keywords have a small CloudSlang icon at left, while live templates have the CloudSlang Template description at right

6. Use error highlighting to ensure that your flow is correct

Errors are marked with a red underline inside files. Hover over the underlined item to see the error messages:

CloudSlang File Type

  • "gradlew assemble" to build plugin in build/distributions
  • "gradlew runIde" to run IntelliJ IDEA with CloudSlang plugin
If you would like to contribute to the plugin, please read the Contributing Guideline here.