description:nls.localize('schema.token.settings','Colors and styles for the token.'),
properties:{
foreground:{
type:'string',
description:nls.localize('schema.token.foreground','Foreground color for the token.'),
format:'color-hex',
default:'#ff0000'
},
background:{
type:'string',
deprecationMessage:nls.localize('schema.token.background.warning','Token background colors are currently not supported.')
},
fontStyle:{
type:'string',
description:nls.localize('schema.token.fontStyle','Font style of the rule: \'italic\', \'bold\' or \'underline\', \'-italic\', \'-bold\' or \'-underline\'or a combination. The empty string unsets inherited settings.'),
patternErrorMessage:nls.localize('schema.fontStyle.error','Font style must be \'italic\', \'bold\' or \'underline\' to set a style or \'-italic\', \'-bold\' or \'-underline\' to unset or a combination. The empty string unsets all styles.'),
@@ -257,7 +301,7 @@ class TokenClassificationRegistry implements ITokenClassificationRegistry {
...
@@ -257,7 +301,7 @@ class TokenClassificationRegistry implements ITokenClassificationRegistry {
}
}
}
}
}
}
if(useDefault){
if(themingRules===undefined){
for(construleofthis.tokenStylingDefaultRules){
for(construleofthis.tokenStylingDefaultRules){
constmatchScore=match(rule,classification);
constmatchScore=match(rule,classification);
if(matchScore>=0){
if(matchScore>=0){
...
@@ -270,13 +314,20 @@ class TokenClassificationRegistry implements ITokenClassificationRegistry {
...
@@ -270,13 +314,20 @@ class TokenClassificationRegistry implements ITokenClassificationRegistry {
}
}
}
}
}
}
}
}else{
for(construleofthemingRules){
for(construleofthemingRules){
constmatchScore=match(rule,classification);
constmatchScore=match(rule,classification);
if(matchScore>=0){
if(matchScore>=0){
_processStyle(matchScore,rule.value);
_processStyle(matchScore,rule.value);
}
}
}
}
}
for(construleofcustomThemingRules){
constmatchScore=match(rule,classification);
if(matchScore>=0){
_processStyle(matchScore,rule.value);
}
}
returnTokenStyle.fromData(result);
returnTokenStyle.fromData(result);
}
}
...
@@ -297,6 +348,10 @@ class TokenClassificationRegistry implements ITokenClassificationRegistry {
...
@@ -297,6 +348,10 @@ class TokenClassificationRegistry implements ITokenClassificationRegistry {
returnundefined;
returnundefined;
}
}
publicgetTokenStylingSchema():IJSONSchema{
returnthis.tokenStylingSchema;
}
publictoString(){
publictoString(){
letsorter=(a:string,b:string)=>{
letsorter=(a:string,b:string)=>{
...
@@ -348,40 +403,40 @@ export function getTokenClassificationRegistry(): ITokenClassificationRegistry {
...
@@ -348,40 +403,40 @@ export function getTokenClassificationRegistry(): ITokenClassificationRegistry {
returntokenClassificationRegistry;
returntokenClassificationRegistry;
}
}
exportconstcomments=registerTokenType('comments',nls.localize('comments',"Token style for comments."),[['comment']]);
exportconstcomments=registerTokenType('comments',nls.localize('comments',"Style for comments."),[['comment']]);
exportconststrings=registerTokenType('strings',nls.localize('strings',"Token style for strings."),[['string']]);
exportconststrings=registerTokenType('strings',nls.localize('strings',"Style for strings."),[['string']]);
exportconstkeywords=registerTokenType('keywords',nls.localize('keywords',"Token style for keywords."),[['keyword.control']]);
exportconstkeywords=registerTokenType('keywords',nls.localize('keywords',"Style for keywords."),[['keyword.control']]);
exportconstnumbers=registerTokenType('numbers',nls.localize('numbers',"Token style for numbers."),[['constant.numeric']]);
exportconstnumbers=registerTokenType('numbers',nls.localize('numbers',"Style for numbers."),[['constant.numeric']]);
exportconstregexp=registerTokenType('regexp',nls.localize('regexp',"Token style for regular expressions."),[['constant.regexp']]);
exportconstregexp=registerTokenType('regexp',nls.localize('regexp',"Style for expressions."),[['constant.regexp']]);
exportconstoperators=registerTokenType('operators',nls.localize('operator',"Token style for operators."),[['keyword.operator']]);
exportconstoperators=registerTokenType('operators',nls.localize('operator',"Style for operators."),[['keyword.operator']]);
exportconstnamespaces=registerTokenType('namespaces',nls.localize('namespace',"Token style for namespaces."),[['entity.name.namespace']]);
exportconstnamespaces=registerTokenType('namespaces',nls.localize('namespace',"Style for namespaces."),[['entity.name.namespace']]);
exportconsttypes=registerTokenType('types',nls.localize('types',"Token style for types."),[['entity.name.type'],['entity.name.class'],['support.type'],['support.class']]);
exportconsttypes=registerTokenType('types',nls.localize('types',"Style for types."),[['entity.name.type'],['entity.name.class'],['support.type'],['support.class']]);
exportconststructs=registerTokenType('structs',nls.localize('struct',"Token style for struct."),[['storage.type.struct']],types);
exportconststructs=registerTokenType('structs',nls.localize('struct',"Style for structs."),[['storage.type.struct']],types);
exportconstclasses=registerTokenType('classes',nls.localize('class',"Token style for classes."),[['ntity.name.class']],types);
exportconstclasses=registerTokenType('classes',nls.localize('class',"Style for classes."),[['entity.name.class']],types);
exportconstinterfaces=registerTokenType('interfaces',nls.localize('interface',"Token style for interfaces."),undefined,types);
exportconstinterfaces=registerTokenType('interfaces',nls.localize('interface',"Style for interfaces."),undefined,types);
exportconstenums=registerTokenType('enums',nls.localize('enum',"Token style for enums."),undefined,types);
exportconstenums=registerTokenType('enums',nls.localize('enum',"Style for enums."),undefined,types);
exportconstparameterTypes=registerTokenType('parameterTypes',nls.localize('parameterType',"Token style for parameterTypes."),undefined,types);
exportconstparameterTypes=registerTokenType('parameterTypes',nls.localize('parameterType',"Style for parameter types."),undefined,types);
exportconstfunctions=registerTokenType('functions',nls.localize('functions',"Token style for functions."),[['entity.name.function'],['support.function']]);
exportconstfunctions=registerTokenType('functions',nls.localize('functions',"Style for functions"),[['entity.name.function'],['support.function']]);
exportconstmacros=registerTokenType('macros',nls.localize('macro',"Token style for macros."),undefined,functions);
exportconstmacros=registerTokenType('macros',nls.localize('macro',"Style for macros."),undefined,functions);
exportconstvariables=registerTokenType('variables',nls.localize('variables',"Token style for variables."),[['variable'],['entity.name.variable']]);
exportconstvariables=registerTokenType('variables',nls.localize('variables',"Style for variables."),[['variable'],['entity.name.variable']]);
exportconstconstants=registerTokenType('constants',nls.localize('constants',"Token style for constants."),undefined,variables);
exportconstconstants=registerTokenType('constants',nls.localize('constants',"Style for constants."),undefined,variables);
exportconstparameters=registerTokenType('parameters',nls.localize('parameters',"Token style for parameters."),undefined,variables);
exportconstparameters=registerTokenType('parameters',nls.localize('parameters',"Style for parameters."),undefined,variables);
exportconstproperty=registerTokenType('properties',nls.localize('properties',"Token style for properties."),undefined,variables);
exportconstproperty=registerTokenType('properties',nls.localize('properties',"Style for properties."),undefined,variables);
exportconstlabels=registerTokenType('labels',nls.localize('labels',"Token style for labels."),undefined);
exportconstlabels=registerTokenType('labels',nls.localize('labels',"Style for labels. "),undefined);
exportconstm_declaration=registerTokenModifier('declaration',nls.localize('declaration',"Token modifier for declarations."),undefined);
exportconstm_declaration=registerTokenModifier('declaration',nls.localize('declaration',"Style for all symbol declarations."),undefined);
exportconstm_documentation=registerTokenModifier('documentation',nls.localize('documentation',"Token modifier for documentation."),undefined);
exportconstm_documentation=registerTokenModifier('documentation',nls.localize('documentation',"Style to use for references in documentation."),undefined);
exportconstm_member=registerTokenModifier('member',nls.localize('member',"Token modifier for member."),undefined);
exportconstm_member=registerTokenModifier('member',nls.localize('member',"Style to use for member functions, variables (fields) and types."),undefined);
exportconstm_static=registerTokenModifier('static',nls.localize('static',"Token modifier for statics."),undefined);
exportconstm_static=registerTokenModifier('static',nls.localize('static',"Style to use for symbols that are static."),undefined);
exportconstm_abstract=registerTokenModifier('abstract',nls.localize('abstract',"Token modifier for abstracts."),undefined);
exportconstm_abstract=registerTokenModifier('abstract',nls.localize('abstract',"Style to use for symbols that are abstract."),undefined);
exportconstm_deprecated=registerTokenModifier('deprecated',nls.localize('deprecated',"Token modifier for deprecated."),undefined);
exportconstm_deprecated=registerTokenModifier('deprecated',nls.localize('deprecated',"Style to use for symbols that are deprecated."),undefined);
exportconstm_modification=registerTokenModifier('modification',nls.localize('modification',"Token modifier for modification."),undefined);
exportconstm_modification=registerTokenModifier('modification',nls.localize('modification',"Style to use for write accesses."),undefined);
exportconstm_async=registerTokenModifier('async',nls.localize('async',"Token modifier for async."),undefined);
exportconstm_async=registerTokenModifier('async',nls.localize('async',"Style to use for symbols that are async."),undefined);
returnPromise.reject(newError(nls.localize({key:'error.invalidformat.tokenColors',comment:['{0} will be replaced by a path. Values in quotes should not be translated.']},"Problem parsing color theme file: {0}. Property 'tokenColors' should be either an array specifying colors or a path to a TextMate theme file",themeLocation.toString())));
returnPromise.reject(newError(nls.localize({key:'error.invalidformat.tokenColors',comment:['{0} will be replaced by a path. Values in quotes should not be translated.']},"Problem parsing color theme file: {0}. Property 'tokenColors' should be either an array specifying colors or a path to a TextMate theme file",themeLocation.toString())));