}
function createDecorationFromTextmate(
- themeStyle: scopes.TextMateRuleSettings
+ themeStyle: scopes.TextMateRuleSettings,
): vscode.TextEditorDecorationType {
const decorationOptions: vscode.DecorationRenderOptions = {};
decorationOptions.rangeBehavior = vscode.DecorationRangeBehavior.OpenOpen;
const color = new vscode.ThemeColor(fallBackTag);
const decor = vscode.window.createTextEditorDecorationType({
color,
- textDecoration
+ textDecoration,
});
return [tag, decor];
}
return extension.packageJSON.contributes.themes
.filter(
(element: any) =>
- (element.id || element.label) === themeName
+ (element.id || element.label) === themeName,
)
.map((element: any) =>
- path.join(extension.extensionPath, element.path)
+ path.join(extension.extensionPath, element.path),
)
.concat(list);
}, Array<string>());
const tokenColorCustomizations: [any] = [
vscode.workspace
.getConfiguration('editor')
- .get('tokenColorCustomizations')
+ .get('tokenColorCustomizations'),
];
tokenColorCustomizations
function mergeRuleSettings(
defaultSetting: TextMateRuleSettings | undefined,
- override: TextMateRuleSettings
+ override: TextMateRuleSettings,
): TextMateRuleSettings {
if (defaultSetting === undefined) {
return override;
function updateRules(
scope: string,
- updatedSettings: TextMateRuleSettings
+ updatedSettings: TextMateRuleSettings,
): void {
[rules.get(scope)]
.map(settings => mergeRuleSettings(settings, updatedSettings))
'comment',
'comment.block',
'comment.line',
- 'comment.block.documentation'
- ]
+ 'comment.block.documentation',
+ ],
],
['string', ['string']],
['keyword', ['keyword']],
['keyword.control', ['keyword.control', 'keyword', 'keyword.other']],
[
'keyword.unsafe',
- ['storage.modifier', 'keyword.other', 'keyword.control', 'keyword']
+ ['storage.modifier', 'keyword.other', 'keyword.control', 'keyword'],
],
['function', ['entity.name.function']],
['parameter', ['variable.parameter']],
['text', ['string', 'string.quoted', 'string.regexp']],
['attribute', ['keyword']],
['literal', ['string', 'string.quoted', 'string.regexp']],
- ['macro', ['support.other']],
+ ['macro', ['entity.name.function', 'keyword.other', 'entity.name.macro']],
['variable', ['variable']],
['variable.mut', ['variable', 'storage.modifier']],
[
'variable.object.property',
'meta.field.declaration',
'meta.definition.property',
- 'variable.other'
- ]
+ 'variable.other',
+ ],
],
- ['module', ['entity.name.section', 'entity.other']]
+ ['module', ['entity.name.section', 'entity.other']],
]);
-// Temporary exported for debugging for now.
export function find(scope: string): string[] {
return mappings.get(scope) || [];
}
export function toRule(
scope: string,
- intoRule: (scope: string) => TextMateRuleSettings | undefined
+ intoRule: (scope: string) => TextMateRuleSettings | undefined,
): TextMateRuleSettings | undefined {
return find(scope)
.map(intoRule)