mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 17:25:39 +01:00
WIP: GraphQL first shot
This commit is contained in:
parent
8f7537dee5
commit
f0df74079c
5 changed files with 199 additions and 0 deletions
42
src/graphql/graphql.test.ts
Normal file
42
src/graphql/graphql.test.ts
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('graphql', [
|
||||
// Keywords
|
||||
[{
|
||||
line: 'scalar Date',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.gql' },
|
||||
{ startIndex: 6, type: '' },
|
||||
{ startIndex: 7, type: 'type.identifier.gql' },
|
||||
]
|
||||
}],
|
||||
|
||||
// Root schema definition
|
||||
[{
|
||||
line: 'schema { query: Query }',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: "keyword.gql" },
|
||||
{ startIndex: 6, type: "" },
|
||||
{ startIndex: 7, type: "delimiter.curly.gql" },
|
||||
{ startIndex: 8, type: "" },
|
||||
{ startIndex: 9, type: "keyword.gql" }, // this should be identifier!
|
||||
{ startIndex: 14, type: "delimiter.gql" },
|
||||
{ startIndex: 15, type: "" },
|
||||
{ startIndex: 16, type: "type.identifier.gql" },
|
||||
{ startIndex: 21, type: "" },
|
||||
{ startIndex: 22, type: "delimiter.curly.gql" },
|
||||
]
|
||||
}],
|
||||
|
||||
// Comments - single line
|
||||
|
||||
// Comments - range comment, single line
|
||||
|
||||
]);
|
||||
Loading…
Add table
Add a link
Reference in a new issue