@@ -12,7 +12,7 @@ import { IModeService } from 'vs/editor/common/services/modeService';
1212import pfs = require( 'vs/base/node/pfs' ) ;
1313import { CommandsRegistry } from 'vs/platform/commands/common/commands' ;
1414import { IInstantiationService , ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' ;
15- import { IThemeService , IThemeDocument } from 'vs/workbench/services/themes/common/themeService' ;
15+ import { IThemeService , IColorTheme } from 'vs/workbench/services/themes/common/themeService' ;
1616import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService' ;
1717import { toResource } from 'vs/workbench/common/editor' ;
1818import { ITextMateService } from 'vs/editor/node/textMate/textMateService' ;
@@ -40,11 +40,11 @@ interface IThemesResult {
4040}
4141
4242class ThemeDocument {
43- private readonly _theme : IThemeDocument ;
43+ private readonly _theme : IColorTheme ;
4444 private readonly _cache : { [ scopes : string ] : ThemeRule ; } ;
4545 private readonly _defaultColor : string ;
4646
47- constructor ( theme : IThemeDocument ) {
47+ constructor ( theme : IColorTheme ) {
4848 this . _theme = theme ;
4949 this . _cache = Object . create ( null ) ;
5050 this . _defaultColor = '#000000' ;
@@ -68,15 +68,15 @@ class ThemeDocument {
6868 let expected = this . _defaultColor . toUpperCase ( ) ;
6969 // No matching rule
7070 if ( actual !== expected ) {
71- throw new Error ( `[${ this . _theme . name } ]: Unexpected color ${ actual } for ${ scopes } . Expected default ${ expected } ` ) ;
71+ throw new Error ( `[${ this . _theme . label } ]: Unexpected color ${ actual } for ${ scopes } . Expected default ${ expected } ` ) ;
7272 }
7373 return this . _generateExplanation ( 'default' , color ) ;
7474 }
7575
7676 let actual = color . toUpperCase ( ) ;
7777 let expected = matchingRule . settings . foreground . toUpperCase ( ) ;
7878 if ( actual !== expected ) {
79- throw new Error ( `[${ this . _theme . name } ]: Unexpected color ${ actual } for ${ scopes } . Expected ${ expected } coming in from ${ matchingRule . rawSelector } ` ) ;
79+ throw new Error ( `[${ this . _theme . label } ]: Unexpected color ${ actual } for ${ scopes } . Expected ${ expected } coming in from ${ matchingRule . rawSelector } ` ) ;
8080 }
8181 return this . _generateExplanation ( matchingRule . rawSelector , color ) ;
8282 }
@@ -187,14 +187,14 @@ class Snapper {
187187 if ( success ) {
188188 let themeName = getThemeName ( themeId ) ;
189189 result [ themeName ] = {
190- document : new ThemeDocument ( this . themeService . getColorThemeDocument ( ) ) ,
190+ document : new ThemeDocument ( this . themeService . getColorTheme ( ) ) ,
191191 tokens : this . _themedTokenize ( grammar , lines )
192192 } ;
193193 }
194194 } ) ;
195195 } ) ) ;
196196 } ) . then ( _ => {
197- return this . themeService . setColorTheme ( currentTheme , false ) . then ( _ => {
197+ return this . themeService . setColorTheme ( currentTheme . id , false ) . then ( _ => {
198198 return result ;
199199 } ) ;
200200 } ) ;
0 commit comments