/**
 * 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 , "const test = 1;" ) ; 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 , 8 ) ) ; return tokens && tokens . scopes && tokens . scopes . length > 0 ; } , 10000 ) ; const cell = editorAsAny . _neovimEditor . _screen . getCell ( 11 , 0 ) ; assert . strictEqual ( cell . foregroundColor , "#00ff00" ) ; } ; export const settings = { config : { "editor.tokenColors" : [ { scope : "variable.other" , settings : { foreground : "#00FF00" , } , } , ] , } , } ;