Visual Studio Code Extension syntax highlighter

A place to share your useful hints for getting the most from Proclaim, be it as a user or an administrator.

Example maths items are best placed in the "Example Proclaim Maths" topic.
Post Reply
steve
Posts: 399
Joined: Wed Nov 30, 2011 10:20 pm
Been thanked: 85 times

Visual Studio Code Extension syntax highlighter

Post by steve » Tue Aug 13, 2019 11:15 am

I've been working on a Visual Studio Code Language Extension for Proclaim Maths script.

Features:
* syntax highlighting (VSCode grammar)
* code folding/indenting
* snippets framework and basic example

Getting started:
* in VS Code, click Extensions and search for "Proclaim"
* Install the extension "Proclaim Maths Script". current version 0.1.1 at 13/8/19
* Try it out by opening Examples/test.pro:
* the Extension adds "Proclaim Maths Script (.pro)" file support - creating/editing a .pro file will invoke the Language Extension.

Major releases I will push through to the VS Marketplace,
For the bleeding edge, check the GitHub repository for dev releases, notes on how to edit the extension yourself, and notes on how to contribute the development.

I see great potential for snippets to help with sample code structures.

I have added a demo snippet for IF THEN ELSE END block, but can see it would be useful for e.g. sample looping through tables, strings, search-and-replace etc that are demonstrated on the forum

It's a work in progress, so expect some bugs at this early stage.

Github:
https://github.com/proclaimforum/vscode ... t-language

Not sure where best to discuss - here or on Github... I think here to begin with as not all the audience will necessarily do Git.

Steve
Last edited by steve on Tue Aug 13, 2019 11:43 am, edited 3 times in total.

steve
Posts: 399
Joined: Wed Nov 30, 2011 10:20 pm
Been thanked: 85 times

Re: Visual Studio Code Extension syntax highlighter

Post by steve » Tue Aug 13, 2019 11:20 am

interestingly the Proclaim Maths edit has basic 'intellisense' for keywords if you hit Ctrl-Space (built-in to the CodeJock Syntax Edit module) but it just auto-completes keywords. Not sure if the CodeJock module accepts anything else other than keyword definitions - i.e. if we could improve the built-in support with our own .schclass definition to include sample code structures such as loops

David P
Posts: 38
Joined: Thu Jan 11, 2018 10:33 am
Has thanked: 5 times
Been thanked: 5 times

Re: Visual Studio Code Extension syntax highlighter

Post by David P » Tue Aug 27, 2019 2:05 pm

THANK YOU!!!!!!!!!

I'll have a proper play with it soon but it looks great so far :D

steve
Posts: 399
Joined: Wed Nov 30, 2011 10:20 pm
Been thanked: 85 times

Re: Visual Studio Code Extension syntax highlighter

Post by steve » Fri Aug 30, 2019 5:43 pm

New version 0.2.0 pushed to Marketplace today.
The most visible change is the GUI OUTLINE that now displays Database field and strings found in your code:

Image

Most of the work is behind the scenes: the Extension has migrated to a LSP client/server model, allowing for future 'Intellisense' features and IDE-agnostic language server features.

Then end goal is to replicate the previous 'check syntax' feature in Proclaim that listed fields, variables and strings found by the interpreter. This was invaluable in finding typos/misinterpretations by syntax checker.

David P
Posts: 38
Joined: Thu Jan 11, 2018 10:33 am
Has thanked: 5 times
Been thanked: 5 times

Re: Visual Studio Code Extension syntax highlighter

Post by David P » Tue Sep 03, 2019 9:21 am

Thanks again for sharing this Steve, it's great work. I had to deal with a 300 line maths item yesterday afternoon and this made it so much easier to work through.

Post Reply