Skip to content

Commit

Permalink
EncodedTokensProvider works once theme data is loaded!
Browse files Browse the repository at this point in the history
  • Loading branch information
bolinfest committed May 1, 2020
1 parent f257c63 commit d305813
Show file tree
Hide file tree
Showing 3 changed files with 338 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {loadWASM} from 'onigasm';

type GrammarConfiguration = {language: string; scopeName: string; url: string};

const useEncodedTokens = false;
const useEncodedTokens = true;
main(useEncodedTokens, 'hack');

const testOptions = {
Expand Down
334 changes: 334 additions & 0 deletions src/dark_vs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,334 @@
export default {
name: 'Dark Visual Studio',
settings: [
{
settings: {
foreground: '#D4D4D4',
background: '#1E1E1E',
},
},
{
scope: 'emphasis',
settings: {
fontStyle: 'italic',
},
},
{
scope: 'strong',
settings: {
fontStyle: 'bold',
},
},
{
scope: 'header',
settings: {
foreground: '#000080',
},
},

{
scope: 'comment',
settings: {
foreground: '#608b4e',
},
},
{
scope: 'constant.language',
settings: {
foreground: '#569cd6',
},
},
{
scope: 'constant.numeric',
settings: {
foreground: '#b5cea8',
},
},
{
scope: 'constant.regexp',
settings: {
foreground: '#646695',
},
},
{
scope: [
'constant.other.color.rgb-value.css',
'constant.numeric.color.rgb-value.scss',
'constant.other.rgb-value.css',
],
settings: {
foreground: '#d4d4d4',
},
},
{
scope: 'entity.name.tag',
settings: {
foreground: '#569cd6',
},
},
{
scope: 'entity.name.tag.css',
settings: {
foreground: '#d7ba7d',
},
},
{
scope: 'entity.other.attribute-name',
settings: {
foreground: '#9cdcfe',
},
},
{
scope: [
'entity.other.attribute-name.class.css',
'entity.other.attribute-name.class.mixin.css',
'entity.other.attribute-name.id.css',
'entity.other.attribute-name.parent-selector.css',
'entity.other.attribute-name.pseudo-class.css',
'entity.other.attribute-name.pseudo-element.css',

'source.css.less entity.other.attribute-name.id',

'entity.other.attribute-name.attribute.scss',
'entity.other.attribute-name.scss',
],
settings: {
foreground: '#d7ba7d',
},
},
{
scope: 'invalid',
settings: {
foreground: '#f44747',
},
},
{
scope: 'markup.underline',
settings: {
fontStyle: 'underline',
},
},
{
scope: 'markup.bold',
settings: {
fontStyle: 'bold',
foreground: '#569cd6',
},
},
{
scope: 'markup.heading',
settings: {
fontStyle: 'bold',
foreground: '#569cd6',
},
},
{
scope: 'markup.italic',
settings: {
fontStyle: 'italic',
},
},
{
scope: 'markup.inserted',
settings: {
foreground: '#b5cea8',
},
},
{
scope: 'markup.deleted',
settings: {
foreground: '#ce9178',
},
},
{
scope: 'markup.changed',
settings: {
foreground: '#569cd6',
},
},
{
scope: 'beginning.punctuation.definition.quote.markdown',
settings: {
foreground: '#608b4e',
},
},
{
scope: 'beginning.punctuation.definition.list.markdown',
settings: {
foreground: '#6796e6',
},
},
{
scope: 'markup.inline.raw',
settings: {
foreground: '#ce9178',
},
},
{
scope: 'meta.selector',
settings: {
foreground: '#d7ba7d',
},
},
{
name: 'brackets of XML/HTML tags',
scope: 'punctuation.definition.tag',
settings: {
foreground: '#808080',
},
},
{
scope: 'meta.preprocessor',
settings: {
foreground: '#569cd6',
},
},
{
scope: 'meta.preprocessor.string',
settings: {
foreground: '#ce9178',
},
},
{
scope: 'meta.preprocessor.numeric',
settings: {
foreground: '#b5cea8',
},
},
{
scope: 'meta.structure.dictionary.key.python',
settings: {
foreground: '#9cdcfe',
},
},
{
scope: 'meta.diff.header',
settings: {
foreground: '#569cd6',
},
},
{
scope: 'storage',
settings: {
foreground: '#569cd6',
},
},
{
scope: 'storage.type',
settings: {
foreground: '#569cd6',
},
},
{
scope: 'storage.modifier',
settings: {
foreground: '#569cd6',
},
},
{
scope: 'string',
settings: {
foreground: '#ce9178',
},
},
{
scope: 'string.tag',
settings: {
foreground: '#ce9178',
},
},
{
scope: 'string.value',
settings: {
foreground: '#ce9178',
},
},
{
scope: 'string.regexp',
settings: {
foreground: '#d16969',
},
},
{
name: 'JavaScript string interpolation ${}',
scope: [
'punctuation.definition.template-expression.begin.ts',
'punctuation.definition.template-expression.end.ts',
],
settings: {
foreground: '#569cd6',
},
},
{
scope: 'support.type.property-name',
settings: {
foreground: '#9cdcfe',
},
},
{
scope: 'keyword',
settings: {
foreground: '#569cd6',
},
},
{
scope: 'keyword.control',
settings: {
foreground: '#569cd6',
},
},
{
scope: 'keyword.operator',
settings: {
foreground: '#d4d4d4',
},
},
{
scope: ['keyword.operator.new', 'keyword.operator.expression'],
settings: {
foreground: '#569cd6',
},
},
{
scope: 'keyword.other.unit',
settings: {
foreground: '#b5cea8',
},
},
{
scope: [
'punctuation.section.embedded.metatag.begin.php',
'punctuation.section.embedded.metatag.end.php',
],
settings: {
foreground: '#569cd6',
},
},
{
scope: 'support.function.git-rebase',
settings: {
foreground: '#9cdcfe',
},
},
{
scope: 'constant.sha.git-rebase',
settings: {
foreground: '#b5cea8',
},
},
{
name: 'coloring of the Java import and package identifiers',
scope: ['storage.modifier.import.java', 'storage.modifier.package.java'],
settings: {
foreground: '#d4d4d4',
},
},
{
name: 'this.self',
scope: 'variable.language',
settings: {
foreground: '#569cd6',
},
},
],
};
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {createOnigScanner, createOnigString, loadWASM} from 'vscode-oniguruma';
import {INITIAL, Registry, parseRawGrammar} from 'vscode-textmate';
type IState = monaco.languages.IState;

import DEFAULT_THEME from './dark_vs';

export async function createGrammarStore(
scopeNameToTextMateGrammarURL: Map<string, string>,
): Promise<GrammarStore> {
Expand Down Expand Up @@ -109,6 +111,7 @@ async function createRegistry(

throw Error(`request to ${url} failed: ${response}`);
},
theme: DEFAULT_THEME,
});
}

Expand Down

0 comments on commit d305813

Please sign in to comment.