/**
 * TextmateHighlighting.ScopesOnEnterTest
 *
 * Validate that syntax tokens for text mate highlighting are available on etner
 */ import * as assert from "assert" ; import * as Oni from "oni-api" ; import * as types from "vscode-languageserver-types" ; import { createNewFile , getCompletionElement } from "./Common" ; export const test = async ( oni ) => { await oni . automation . waitForEditors ( ) ; await createNewFile ( "ts" , oni , "window" ) ; const currentBuffer = oni . editors . activeEditor . activeBuffer ; const editorAsAny = oni . editors . activeEditor ; const syntaxHighlighter = editorAsAny . syntaxHighlighter ; let tokens = null ; await oni . automation . waitFor ( ( ) => { tokens = syntaxHighlighter . getHighlightTokenAt ( currentBuffer . id , types . Position . create ( 0 , 0 ) ) ; return tokens && tokens . scopes && tokens . scopes . length > 0 ; } , 10000 ) ; assert . deepEqual ( tokens . scopes , [ "source.ts" , "support.variable.dom.ts" ] , "Validate the scopes are correct" ) ; } ; export const settings = { config : { "experimental.editor.textMateHighlighting.enabled" : true , } , } ;