Giter Club home page Giter Club logo

apamacommunity / apama-vscode-extensions Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 6.0 10.97 MB

Support for EPL language , and tooling from the Apama product. See http://www.apamacommunity.com/

Home Page: https://marketplace.visualstudio.com/items?itemName=ApamaCommunity.apama-extensions

License: Apache License 2.0

TypeScript 98.03% Python 0.50% JavaScript 1.46%
apama-community syntax-highlighting epl correlator epl-language vscode-extension apama-epl cumulocity cumulocity-iot

apama-vscode-extensions's Introduction

epl-syntax-highlighting README

CI takes place on the Azure Platform building on Linux, Windows and Mac platforms.

Build Status

This is a community developed VSCode extension to support development of Apama Streaming Analytics applications. Initially it offered syntax highlighting for EPL (Event Programming Language) files. EPL files are used by the Apama Streaming Analytics product to define applications that are executed within a runtime process called the 'correlator'. The language is a domain specific language centered around events and event processing. As the extension has grown, additional capabilities are being added beyond only syntax highlighting, such as launching the correlator runtime with files from your project.

For more information about Apama and EPL please visit the Apama Community website.

Users of this extension may also find the early-stage new vscode extension for PySys testing helpful, as PySys is the primary framework for testing Apama applications.

Features of the epl-syntax-highlighting extension

  • Enables features of the extension for correct matching versions of Apama.
  • Supports EPL language diagnostics from Apama 10.5.3+
  • Support for debugging and launching pure single-file and multi-file EPL applications in a correlator.
  • Supports use of the apama_project tool.
  • Apama based settings for current and upcoming changes live.

Limitations

  • Debug of deployed projects only.
  • Diagnostics are limited to EPL files currently (imported packages may not work).
  • Completion is currently only snippet and history based.

Theme based syntax highlighting

Based on the theme you choose the EPL code will be highlighted and easier to read than plain text files. This has been the case since the beginning of this extension, but it is more complete now (v1.0) and won't change significantly from here onward.

example code

Settings

There are various settings available for the extension now. All the Apama configuration entries are prefixed 'SoftwareAG.Apama', and searching for 'Apama' will show all of them.

  • ApamaHome contains the path to the installation directory of the version you wish to use.
  • DebugHost is the default host for a correlator started for debug (allowing remote instance).
  • DebugPort is the default port for a correlator started for debug.
  • LangserverType is a dropdown that controls the LSP for vscode, it can be local (starts and attaches), remote (attaches) or disabled.
    • Langserver.Host is the host that vscode should connect to the Langserver on.
    • Langserver.Port is the port the Langserver is running on.
    • Langserver.MaxErrors is the maximum number of diagnostics that should be returned by the LSP (INACTIVE)

There are also some placeholders for using EPL with Cumulocity IoT. these will become active in a later release (>v1.0).

settings

Diagnostics

If you have enabled the Language Server and are using Apama full version 10.5.3+ then you will have access to live diagnostics. These diagnostics are limited to the file currently being edited but will become more fully featured as future releases are produced. Specifically, if you write EPL that uses external bundles or code, then the diagnostics may not take these into account.

tasks

Snippets

There are various snippets defined in the extension to make writing code easier.

Snippets

Tasks: correlator, inject monitor, and send event

Tasks can be created for running correlators on specific ports. The commands to inject EPL and send events also support these ports. Additionally there are tasks for engine_watch and engine_recieve that can also be set up. In future releases there will be a more coherent interface for this allowing a suite of tasks to be set up in one operation.

The animation below shows the default operation of the tasks.

correlator

Send Event file

Once you have a correlator executing some EPL then you can send event files to it with a right-click.

events

Create Tasks

The animation below shows how to create a non-default tasks (allowing multiple correlators on different ports for example).

tasks

Create Project

The apama_project tool can be used to create projects which are compatible with the eclipse-based 'Software Ag Designer' IDE, and will also allow you to edit Designer created projects in vscode.

project support

Add bundles

You can add Bundles and instances to the project using the UI.

tasks

Remove bundles

You can remove Bundles and instances from the project using the UI.

tasks

Deploy project

You can deploy the project using the UI and then run that project in a correlator. N.B. currently you may need to create or move a configuration file into the root of the deployed directory.

tasks

Add breakpoints

You can add breakpoints to the code for debugging. These are limited to line-based breakpoints currently.

tasks

Debug

Debugging the application also follows the standard vscode patterns.

tasks

Requirements

To use the diagnostics capability you must have version 10.5.3 or later of Apama installed.

Known Issues

There are a number of issues that will be fixed, but please do raise issues via GitHub if you come accross things. Pull requests are also very welcome!

Development

Users are welcome to make pull requests with fixes and enhancements but I reserve the right to control what and when goes into released versions of the extention.

Release Notes

v1.2.1

  • First release under ApamaCommunity.

v1.0.1 (June 2020)

  • Finished syntax highlighting.
  • Documentation.
  • Apama EPL diagnostics (via LSP support in eplbuddy tool).
  • Integration with apama_project tool.
  • Fixed small bug when starting the Language Server.
  • Preparation for future support of integration with EPL Apps feature of Cumulocity IoT.

v0.2.0 to v0.9.0 (February 2020)

  • Better syntax highlighting, Snippets, Apama EPL debugging
  • Snippets support and further syntax highlighting added
  • Cleanup of code and rewrite of the tmLanguage file
  • Small readme change and addition of image dir.

v0.1.0 (February 2020)

  • Initial release (started June 2018)
  • Basic highlighting with some support for more complex code structures.
  • Placeholder for command functionality

apama-vscode-extensions's People

Contributors

cariboujohn avatar dependabot[bot] avatar kpalf avatar rpeach-sag avatar sag-sbra avatar sag-tgo avatar

Watchers

 avatar  avatar

apama-vscode-extensions's Issues

rewrite syntax highlighting

The highlighting is somewhat naive at the moment. The structure of the Apama EPL is similar to Javascript so adapting a syntax file for javascript to EPL would be a good starting point. The Texmate language grammars for most languages are very complex and It is quite esoteric in nature. I would rather not reinvent the wheel and start with a large portion of the grammar defined.

Extension grabs focus in Output window

On startup the extension writes "Started EPL Extension" to the "Output" tab which steals the focus away from other tabs like Terminal

Other extensions seem to manage to write debug logging without doing this

Syntax highlighting does not support "within" and "where" keywords

These keywords are used with streams. Example:

from m in all Measurement(type=MEASUREMENT_TYPE) within WINDOW_DURATION_SECS
    where m.measurements.hasKey(MEASUREMENT_FRAGMENT) and m.measurements[MEASUREMENT_FRAGMENT].hasKey(MEASUREMENT_SERIES)
    select avg(m.measurements[MEASUREMENT_FRAGMENT][MEASUREMENT_SERIES].value) as movingMean
{
    ...
}

(thanks to @kpalf for reporting this)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.