File tree Expand file tree Collapse file tree
src/vs/workbench/services/untitled/test/browser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -287,13 +287,33 @@ suite('Untitled text editors', () => {
287287 const service = accessor . untitledTextEditorService ;
288288 const input = instantiationService . createInstance ( UntitledTextEditorInput , service . create ( { mode } ) ) ;
289289
290+ assert . ok ( input . model . hasModeSetExplicitly ) ;
290291 assert . equal ( input . getMode ( ) , mode ) ;
291292
292293 const model = await input . resolve ( ) ;
293294 assert . equal ( model . getMode ( ) , mode ) ;
294295
296+ input . setMode ( 'plaintext' ) ;
297+
298+ assert . equal ( input . getMode ( ) , PLAINTEXT_MODE_ID ) ;
299+
300+ input . dispose ( ) ;
301+ model . dispose ( ) ;
302+ } ) ;
303+
304+ test ( 'remembers that mode was set explicitly' , async ( ) => {
305+ const mode = 'untitled-input-test' ;
306+
307+ ModesRegistry . registerLanguage ( {
308+ id : mode ,
309+ } ) ;
310+
311+ const service = accessor . untitledTextEditorService ;
312+ const model = service . create ( ) ;
313+ const input = instantiationService . createInstance ( UntitledTextEditorInput , model ) ;
314+
295315 assert . ok ( ! input . model . hasModeSetExplicitly ) ;
296- input . setMode ( 'text ' ) ;
316+ input . setMode ( 'plaintext ' ) ;
297317 assert . ok ( input . model . hasModeSetExplicitly ) ;
298318
299319 assert . equal ( input . getMode ( ) , PLAINTEXT_MODE_ID ) ;
You can’t perform that action at this time.
0 commit comments