Giter VIP home page Giter VIP logo

apex-tmlanguage's Introduction

Salesforce Apex Language Grammar

CircleCI Commitizen friendly

Introduction

This repository contains the source code for generating the language grammar files for Salesforce's Apex.

Disclaimer

Development and setup of this project has not been tested for Windows OS. You may see a node-gyp error - follow the instrutions here to resolve it.

Development

To build and test install Node.js do the following:

  • Run npm install to install any dependencies.
  • Run gulp to build.
  • Run npm run test to run tests.

Output grammars are output in the grammars/ directory.

To see the token changes from within the Salesforce VS Code Extensions:

  1. Copy the apex.tmLanguage results into ../salesforcedx-vscode/packages/salesforcedx-vscode-apex/node_modules/@salesforce/apex-tmlanguage/grammars/apex.tmLanguage.
  2. From the Command Palette select Developer: Inspect Editor Tokens and Scopes.

Adding grammar rules

Token structure is based off of Textmate's Language Grammar guidelines

Tests for SOQL grammar

For the standalone SOQL grammar, tests are executed with vscode-tmgrammar-tests.

test/soql/
|-- simple_account.soql "Manually" created test cases
|-- ...
`-- snapshots/          "Snapshot-based" test cases
    |-- example-*.soql
    |-- example-*.soql.snap
    `-- ...

The difference between manual vs. snapshot tests is that the latter are auto-generated and can be updated with command vscode-tmgrammar-snap -u. They are useful to quickly see the output of applying the grammar and catch regressions.

The example-* queries were taken from Example SELECT clauses.

Supported outputs

  • grammars/apex.tmLanguage.cson - for Atom
  • grammars/apex.tmLanguage - TextMate grammar (XML plist)
  • grammars/soql.tmLanguage - TextMate grammar (XML plist) for standalone SOQL files

Releasing

Tags on this repo get automatically published as a GitHub release and an NPM package through Travis CI.

Attribution

This repository was copied from https://github.com/dotnet/csharp-tmLanguage

apex-tmlanguage's People

Contributors

dustincampbell avatar lcampos avatar kiootic avatar sfsholden avatar dobladez avatar ivanz avatar ntotten avatar tideteam-sf avatar filipw avatar jgrantham-sf avatar martinwoodward avatar vazexqi avatar dependabot[bot] avatar

Watchers

James Cloos avatar

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.