All Projects → sasjs → vscode-extension

sasjs / vscode-extension

Licence: MIT license
SAS Linting, Syntax Highlighting, and Code Execution from VS Code

Programming Languages

typescript
32286 projects
shell
77523 projects

Projects that are alternatives of or similar to vscode-extension

core
Macros for SAS® App Developers
Stars: ✭ 87 (+443.75%)
Mutual labels:  viya, sasjs
cli
Command line interface for creating, compiling, and building SAS® projects
Stars: ✭ 32 (+100%)
Mutual labels:  viya, sasjs
lint
Linting and formatting for SAS® code
Stars: ✭ 16 (+0%)
Mutual labels:  viya, sasjs
python-sasctl
Python package and CLI for user-friendly integration with SAS Viya
Stars: ✭ 25 (+56.25%)
Mutual labels:  viya

Visual Studio Code Extension for SASjs

All Contributors

This project contains the source code for the SASjs VS Code extension, available in the following locations:

Features

Code Execution

You can run code on SAS Viya, SAS 9 EBI or SASjs Server! Just set up the target, and click the running man to execute your SAS code.

snippet

You can also highlight a section of code and run that. Each log returned will be stored in a sasjsresults folder. You can also run the SASjs: Execute Code command from the command palette(Cmd+Shift+P).

The target 🎯 describes the server on which you intend to run the code. The attributes are added to a file in your home directory - ~/.sasjsrc. More info here).

The following attributes are needed for all server types:

  • Name. An alias to represent the target.
  • Server Url. The full URL (including port if needed) of your SAS server.
  • Server Type. Can be SASVIYA, SAS9 or SASJS.

Below are the setup steps specific to each server type

SAS Viya

Enter the following prompts:

  • CLIENT / SECRET. Relevant for SASVIYA - you will need to ask your administrator for these, and they should have the authorization_code grant type. More info here.
  • Follow the link to obtain your authorisation code

SAS9 EBI

For a SAS9 server type, you need to provide your user and passsword in the prompts. Before you can execute code, you will need a runner (an STP in your metadata home directory) - just follow the instructions here: https://cli.sasjs.io/auth/#sasjs-runner

vscodesas9.mp4

SASjs Server

In order to run on Foundation / Base / Desktop SAS you will need a running version of SASjs server (on the same machine where SAS is installed). You can download SASjs server here. Configuration instructions are here.

For local desktop instances of SASjs Server, the serverUrl is likely to be http://localhost:5000

If you are running SASjs Server in server mode, then you will need a client id - the default is clientID1

SAS Lint and Format

Spend less time on code reviews and more time pushing code! Select VIEW->PROBLEMS (or ctrl+shift+M) to examine the currently opened SAS program for issues.

image

Rules can be configured by creating a .sasjslint file in the root of your project as follows:

{
    "noEncodedPasswords": true,
    "hasDoxygenHeader": true,
    "hasMacroNameInMend": true,
    "hasMacroParentheses": true,
    "ignoreList": [
      "sajsbuild/",
      "sasjsresults/"
    ],
    "indentationMultiple": 2,
    "lowerCaseFileNames": true,
    "maxLineLength": 80,
    "noNestedMacros": true,
    "noSpacesInFileNames": true,
    "noTabIndentation": true,
    "noTrailingSpaces": true
}

SASjs lint can automatically fix certain problems within SAS files, such as trailing spaces, missing Doxygen header blocks and missing macro names in %mend statements. You can use this feature in two ways:

  1. On demand - by selecting 'Format Document' either from the right click menu or from the command palette. format

  2. By enabling automatic formatting of files on save/paste from the Settings menu. image

Syntax Highlighting

Two themes are provided with SAS Code formatting - a Light Theme and a Dark Theme

Contributions

SASjs is an open source project, and contributions are warmly welcomed!

Contributors

Thanks goes to these wonderful people (emoji key):


Allan Bowe

💻 ⚠️ 👀 📹 📖

Yury Shkoda

💻 ⚠️ 📆 📹 📖

Krishna Acondy

💻 ⚠️ 👀 🚇 📦 🚧 🖋

Muhammad Saad

💻 ⚠️ 👀 🧑‍🏫 📖

Sabir Hassan

💻 ⚠️ 👀 🤔

Mihajlo Medjedovic

💻 ⚠️ 👀 🚇

Vladislav Parhomchik

⚠️ 👀

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].