mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 22:02:55 +01:00
add tokenizer for graphql language variables
This commit is contained in:
parent
03db2f621f
commit
3655d9a96a
1 changed files with 18 additions and 4 deletions
|
|
@ -69,16 +69,30 @@ export const language = <ILanguage>{
|
||||||
// The main tokenizer for our languages
|
// The main tokenizer for our languages
|
||||||
tokenizer: {
|
tokenizer: {
|
||||||
root: [
|
root: [
|
||||||
// identifiers and keywords
|
|
||||||
|
// fields and argument names
|
||||||
[
|
[
|
||||||
/[a-z_$][\w$]*/,
|
/[a-z_][\w$]*/,
|
||||||
{
|
{
|
||||||
cases: {
|
cases: {
|
||||||
'@keywords': 'keyword',
|
'@keywords': 'keyword',
|
||||||
'@default': 'identifier',
|
'@default': 'key.identifier',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
// identify typed input variables
|
||||||
|
[
|
||||||
|
/[$][\w$]*/,
|
||||||
|
{
|
||||||
|
cases: {
|
||||||
|
'@keywords': 'keyword',
|
||||||
|
'@default': 'argument.identifier',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
// to show class names nicely
|
||||||
[
|
[
|
||||||
/[A-Z][\w\$]*/,
|
/[A-Z][\w\$]*/,
|
||||||
{
|
{
|
||||||
|
|
@ -87,7 +101,7 @@ export const language = <ILanguage>{
|
||||||
'@default': 'type.identifier',
|
'@default': 'type.identifier',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
], // to show class names nicely
|
],
|
||||||
|
|
||||||
// whitespace
|
// whitespace
|
||||||
{ include: '@whitespace' },
|
{ include: '@whitespace' },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue