@salesforce/soql-tmlanguage

0.1.1 • Public • Published

Introduction

This repository contains the language grammar for Salesforce's SOQL query language.

Development

This package is used from VS Code extension salesforcedx-vscode-soql. With that extension installed, you can see the grammar in action and debug/inspect it by opening a .soql file (with the VS Code text editor) and then runnning command Developer: Inspect Editor Tokens and Scopes.

Grammar file

grammars/
|-- soql.tmLanguage.yaml         ;; The source of the SOQL grammar
`-- soql.tmLanguage.json         ;; Generated .json version of the grammar (git ignored)

VSCode only reads grammars in json format. yarn build generates the .json version of the SOQL grammar using js-yaml.

Tests

Tests are executed with vscode-tmgrammar-tests.

test/                   "Manually" created test case
|-- simple_account.soql
`-- snapshots/          "Snapshot-based" test cases
    |-- example-*.soql
    |-- example-*.soql.snap
    `-- ...
  • yarn test:source validates "manually created" queries.
  • yarn test:snapshots validates "snapshot-based" queries.
  • yarn test validates both.

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.

Readme

Keywords

Package Sidebar

Install

npm i @salesforce/soql-tmlanguage

Weekly Downloads

1

Version

0.1.1

License

BSD-3-Clause

Unpacked Size

47.7 kB

Total Files

3

Last publish

Collaborators

  • dme722
  • nolanlawson
  • ire-npm-team-user
  • jburnie
  • abirchfieldsfdc
  • dlouvton
  • mobify
  • jmsjtu
  • jasonschroeder-sfdc
  • packagellama
  • maward
  • danielshox
  • duane.chew
  • dferro
  • jcourtner
  • jye-sf
  • adirasanam
  • hkii
  • iamaziz
  • dbreese-salesforce
  • ashokrudraraju
  • dhersam
  • demianbrecht
  • mbettio
  • damilareolowoniyi
  • mmadialagan
  • mjrust
  • salesforce-releases
  • mpsenn
  • kevinv11n
  • byao
  • pmdartus
  • ekashida
  • gr8gatsby
  • ravi.jayaramappa
  • apapko
  • jleen-sfdc
  • jqian
  • cwallsf
  • dhagberg-sf
  • khawkins
  • amphro
  • jodarove
  • sfdctaka
  • fernomac
  • jimjag
  • ivarley
  • jbartolotta-sfdc