1.0.1 • Published 5 years ago

@vadapty/syntax v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

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
    )
  )
}
1.0.1

5 years ago

1.0.0

5 years ago

0.7.1

6 years ago

0.7.0

6 years ago