BookmarkSubscribeRSS Feed
boemskats
Lapis Lazuli | Level 10

If someone was to pick this up I'd strongly recommend an implementation using Microsoft's Language Server Protocol. Would be a fair bit of work, but it would make that editor mode available to a range of other editors (vim obviously being the most important). 

 

VSCode uses a MS javascript editor component called Monaco, as after all, VSCode is just a webapp that's been deployed in Electron. We have a mode for Ace (another javascript editor component) that is extremely similar, which we've used within an internal product called AppFactory for 2 or 3 years now.

 

Keep in mind that writing a mode for SAS is really hard, as SAS is not just one language - it's more like 4 or 5. Just ask @sspkmnd - he's been working on his SASLint project for SAS for a long time now (implemented in ANTLR v4, so he also has it compiling to a mode for Ace). I'll let Igor elaborate on the difficulties of an all-encompassing mode for SAS, but it's much harder than you'd assume, compared to almost all other languages. I'm sure the developers behind the SAS Studio editor will agree.

 

Nik

AlanC
Barite | Level 11

SAS is more like 100 languages, at least. Every PROC has its own mechanisms because they are standalone. After spending a lot of time trying to parse the SAS language, that is my conclusion. As you state, it is very hard to parse.

 

I need to research more of your response (thanks, BTW) but the web is about to move toward WebAssembly. That paradigm shift is critical for new projects.

https://github.com/savian-net
AlanC
Barite | Level 11

If the choice in VS Code is TypeScript vs JavaScript, choose TypeScript. Why? Anders Hejlsberg.He is the chief architect of C# and TypeScript (and possibly the best programmer in the world). TypeScript was built to put some rules around JS and make JS easier to debug and maintain.

 

Lots of changes are coming to the web development world (WebAssembly): TypeScript makes it more adaptable to those changes.

 

 

 

https://github.com/savian-net
LinusH
Tourmaline | Level 20
Thanks, I thought we were talking about Visual Statistics and got really confused...😮
Data never sleeps
ChrisHemedinger
Community Manager

Great discussion everyone.  I'm also really interested in something like this -- I use VS Code for some projects.

 

The current extension you found in the marketplace for VS (with the SAS logo) is not an official offering from anyone at SAS.  I think it was created by @77qingliu -- and it looks like an impressive amount of work.

 

Those who point out that SAS syntax is complex are correct, of course.  But we do have a great deal of data about the SAS language grammar -- that's what feeds the experience you see in SAS Enterprise Guide and SAS Studio. There may be an opportunity for some collaboration.

 

The language server step -- that's even more ambitious. 

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
77qingliu
Calcite | Level 5

Cat Happy Found it by you!

I developed the extension from scratch using the TextMate grammar definition, and the source code is on my github repo, https://github.com/77QingLiu/vscode-SAS.tmLanguage. This extension covers some basic functions like highlighting and auto-complete with SAS-like colors, but lack of modern syntax highlighting features like syntax linting, go to definition, on the fly function due to the limitation of TextMate grammar definition. 

It would be great if someone could develop the syntax highlighting engine based on the language server though it does require a fair bit of work.

AllanBowe
Barite | Level 11

This is something we are looking to develop at Analytium.  

Not just for syntax highlighting, but for executing SAS code also.  You can already run your SAS code in Viya from VSCode (I do this every day) using SASjs - documentation is here and a video to demonstrate is shown below.

 

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs
AllanBowe
Barite | Level 11

Hi everyone,

 

We are getting close to a place when we can say we are ready to launch.  The extension is available both on the VS Code marketplace, and also open-vsx (making it available to VSCodium, Theia, and other open source IDEs):

https://marketplace.visualstudio.com/items?itemName=SASjs.sasjs-for-vscode
https://open-vsx.org/extension/sasjs/sasjs-for-vscode

We have the following features:

* Syntax highlighting (with credit and thanks to @77qingliu - https://marketplace.visualstudio.com/items?itemName=77qingliu.sas-syntax)
* Ability to run SAS code in Viya and fetch the log
* Integration with the SASjs CLI so that the user can switch seamlessly between terminal and the extension (it uses the same global sasjsconfig file)

Next up:

* Some basic linting support
* Capturing the session output
* Deploying code as a SASjs Job or Service

If anyone would like to help, or contribute, do get in touch.

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs
sbjyil
SAS Employee

SAS just released the official VS Code SAS Extension:  https://marketplace.visualstudio.com/items?itemName=SAS.sas-lsp

 

If you find any issues, please report here 

   

 

Thank you for all your patience!

 

SASKiwi
PROC Star

@sbjyil  - Looks like you can only run your code from VSCode if you have SAS Viya. Are there any plans to support SAS 9? 

joeFurbee
Community Manager

Hi @SASKiwi,

Releasing the extension for SAS9 is certainly under consideration. Voicing your needs on the Community certainly are noticed. I'll pass this question along to the development team.


Join us for SAS Community Trivia
SAS Bowl XL, SAS Innovate 2024 Recap
Wednesday, May 15, 2024, at 10 a.m. ET | #SASBowl

AllanBowe
Barite | Level 11

For reference - the unofficial SASjs VS Code extension already supports ALL versions of SAS (Viya, SAS9 EBI, Base/foundation), as well as the ability to configure compute contexts on Viya (both 3.5 and 4)

 

It's fully (MIT) open source and includes a linter for code quality checking.

 

https://github.com/sasjs/vscode-extension

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 27 replies
  • 10485 views
  • 48 likes
  • 14 in conversation