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
|
||||
tokenizer: {
|
||||
root: [
|
||||
// identifiers and keywords
|
||||
|
||||
// fields and argument names
|
||||
[
|
||||
/[a-z_$][\w$]*/,
|
||||
/[a-z_][\w$]*/,
|
||||
{
|
||||
cases: {
|
||||
'@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\$]*/,
|
||||
{
|
||||
|
|
@ -87,7 +101,7 @@ export const language = <ILanguage>{
|
|||
'@default': 'type.identifier',
|
||||
},
|
||||
},
|
||||
], // to show class names nicely
|
||||
],
|
||||
|
||||
// whitespace
|
||||
{ include: '@whitespace' },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue