2525 * POSSIBILITY OF SUCH DAMAGE.
2626 */
2727
28- import { SideBarView , VSBrowser , WebDriver , Workbench } from 'vscode-extension-tester' ;
28+ import { InputBox , TextEditor , SideBarView , VSBrowser , WebDriver , Workbench } from 'vscode-extension-tester' ;
2929import { Delays , IDEOperations , ignoreFails , printRascalOutputOnFailure , RascalREPL , sleep , TestWorkspace } from './utils' ;
3030
3131import { expect } from 'chai' ;
@@ -75,7 +75,6 @@ parameterizedDescribe(function (errorRecovery: boolean) {
7575 await repl . terminate ( ) ;
7676 }
7777
78-
7978 before ( async ( ) => {
8079 browser = VSBrowser . instance ;
8180 driver = browser . driver ;
@@ -103,7 +102,7 @@ parameterizedDescribe(function (errorRecovery: boolean) {
103102 await fs . writeFile ( TestWorkspace . picoFile , picoFileBackup ) ;
104103 } ) ;
105104
106- it ( "have highlighting and parse errors" , async function ( ) {
105+ it ( "has highlighting and parse errors" , async function ( ) {
107106 await ignoreFails ( new Workbench ( ) . getEditorView ( ) . closeAllEditors ( ) ) ;
108107 const editor = await ide . openModule ( TestWorkspace . picoFile ) ;
109108 const isPicoLoading = ide . statusContains ( "Pico" ) ;
@@ -126,7 +125,7 @@ parameterizedDescribe(function (errorRecovery: boolean) {
126125 }
127126 } ) . retries ( 2 ) ;
128127
129- it ( "have highlighting and parse errors for second extension" , async function ( ) {
128+ it ( "has highlighting and parse errors for second extension" , async function ( ) {
130129 const editor = await ide . openModule ( TestWorkspace . picoNewFile ) ;
131130 await ide . hasSyntaxHighlighting ( editor ) ;
132131 try {
@@ -137,6 +136,40 @@ parameterizedDescribe(function (errorRecovery: boolean) {
137136 }
138137 } ) ;
139138
139+ it ( "has syntax highlighting in documents without extension" , async function ( ) {
140+ await bench . executeCommand ( "workbench.action.files.newUntitledFile" ) ;
141+ await bench . executeCommand ( "workbench.action.editor.changeLanguageMode" ) ;
142+
143+ const inputBox = new InputBox ( ) ;
144+ await inputBox . setText ( "parametric-rascalmpl" ) ;
145+ await inputBox . confirm ( ) ;
146+
147+ const file = "Untitled-1" ;
148+ const editor = await driver . wait ( async ( ) => {
149+ const result = await ignoreFails ( new Workbench ( ) . getEditorView ( ) . openEditor ( file ) ) as TextEditor ;
150+ if ( result && await ignoreFails ( result . getTitle ( ) ) === file ) {
151+ return result ;
152+ }
153+ return undefined ! as TextEditor ;
154+ } , Delays . normal , "Could not open file" ) ;
155+ expect ( editor ) . to . not . be . undefined ;
156+
157+ await editor . setText ( `begin
158+ declare
159+ a : natural;
160+ a := 2
161+ end
162+ ` ) ;
163+ await ide . hasSyntaxHighlighting ( editor , Delays . slow ) ;
164+
165+ try {
166+ await editor . setTextAtLine ( 4 , " a := " ) ;
167+ await ide . hasErrorSquiggly ( editor , Delays . slow ) ;
168+ } finally {
169+ await ide . revertOpenChanges ( ) ;
170+ }
171+ } ) . retries ( 2 ) ;
172+
140173 it ( "error recovery works" , async function ( ) {
141174 if ( ! errorRecovery ) { this . skip ( ) ; }
142175 const editor = await ide . openModule ( TestWorkspace . picoNewFile ) ;
0 commit comments