monaco-languages-jq

Monaco Editor JQ language definition (and syntax highlight)

Usage no npm install needed!

<script type="module">
  import monacoLanguagesJq from 'https://cdn.skypack.dev/monaco-languages-jq';
</script>

README

monaco-languages-jq · GitHub license npm version PRs Welcome

Monaco Editor JQ language definition (and syntax highlight)

Installation

  • npm i -S monaco-languages-jq

Usage

With a helper function to register straight to monaco

// `monaco` should be global or local in the loading module

import { registerJQLanguageDefinition } from 'monaco-languages-jq';

...

registerJQLanguageDefinition(monaco);

DIY (in case you want it to be called some other name):

// `monaco` should be global or local in the loading module

import { JQLanguageDefinition } from 'monaco-languages-jq';

...

// Register a new language
monaco.languages.register({ id: 'jq' });

// Register a tokens provider for the language
monaco.languages.setMonarchTokensProvider('jq', JQLanguageDefinition);

In monaco editor use "jq" (or your value if changed) as language.

License

monaco-languages-jq is MIT Licensed