🎉 initiate project *astro_rewrite*

This commit is contained in:
sindrekjelsrud 2023-07-19 21:31:30 +02:00
parent ffd4d5e86c
commit 2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions

View file

@ -0,0 +1,5 @@
import './grammar.test';
import './json.test';
import './matcher.test';
import './themes.test';
import './tokenization.test';

View file

@ -0,0 +1 @@
export {};

View file

@ -0,0 +1 @@
export {};

View file

@ -0,0 +1 @@
export {};

View file

@ -0,0 +1 @@
export {};

View file

@ -0,0 +1,2 @@
import { IOnigLib } from '../onigLib';
export declare function getOniguruma(): Promise<IOnigLib>;

View file

@ -0,0 +1,33 @@
import { IOnigLib } from '../onigLib';
import { RegistryOptions } from '../main';
import { IRawGrammar } from '../rawGrammar';
export interface ILanguageRegistration {
id: string;
extensions: string[];
filenames: string[];
}
export interface IGrammarRegistration {
language: string;
scopeName: string;
path: string;
embeddedLanguages: {
[scopeName: string]: string;
};
grammar?: Promise<IRawGrammar>;
}
export declare class Resolver implements RegistryOptions {
readonly language2id: {
[languages: string]: number;
};
private _lastLanguageId;
private _id2language;
private readonly _grammars;
private readonly _languages;
readonly onigLib: Promise<IOnigLib>;
constructor(grammars: IGrammarRegistration[], languages: ILanguageRegistration[], onigLibPromise: Promise<IOnigLib>);
findLanguageByExtension(fileExtension: string): string | null;
findLanguageByFilename(filename: string): string | null;
findScopeByFilename(filename: string): string | null;
findGrammarByLanguage(language: string): IGrammarRegistration;
loadGrammar(scopeName: string): Promise<IRawGrammar | null>;
}

View file

@ -0,0 +1,14 @@
import { ThemeData } from './themes.test';
import { Resolver } from './resolver';
export declare class ThemeTest {
private static _readFile;
private static _normalizeNewLines;
private readonly EXPECTED_FILE_PATH;
private readonly tests;
readonly expected: string;
readonly testName: string;
actual: string | null;
constructor(THEMES_TEST_PATH: string, testFile: string, themeDatas: ThemeData[], resolver: Resolver);
evaluate(): Promise<any>;
writeExpected(): void;
}

View file

@ -0,0 +1,6 @@
import { IGrammar } from '../main';
export interface IThemedToken {
content: string;
color: string;
}
export declare function tokenizeWithTheme(colorMap: string[], fileContents: string, grammar: IGrammar): IThemedToken[];

View file

@ -0,0 +1,7 @@
import { Registry } from '../main';
import { IRawTheme } from '../theme';
export interface ThemeData {
themeName: string;
theme: IRawTheme;
registry: Registry;
}

View file

@ -0,0 +1 @@
export {};