@vadapty/syntax
v1.0.1
Published
Library for creating syntax modules using textmate-scopes
Downloads
6
Readme
Library for creating syntax modules using textmate-scopes
Usage
yarn add @vadapty/syntax
Note: It is recommended to use with the package tm-scopes
import { Color } from "@vadapty/color";
import { Comment, Source } from "@vadapty/tm-scopes";
import { FontStyle, Property } from "@vadapty/syntax";
const comment = new Comment();
const source = new Source();
class SomeLanguageModule {
public pythonCommentBlock = new Property(
name: "python-comment-block",
scopes: new Scopes("source.python", "comment.block")
);
public javaCommentBlock = new Property(
name: "python-comment-block",
scopes: new Scopes(source.base.with("java"), comment.block)
)
public rustCommentBlock = new Property(
name: "rust-comment-block",
scopes: new Scopes(source.base.with("rust"), comment.block),
settings: new Settings(
foreground: new Color("#ddd"),
fontStyle: FontStyle.Italic
)
)
}