0.4.1 • Published 6 years ago

vscode-syntax-scope v0.4.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

VsCode TM Scopes

Usage

yarn add vscode-syntax-scope

Scope

The Scope class is a lightweight version of the TM scopes

import { Scope } from "vscode-syntax-scope";

It consist of two parts

  • include scope
  • exclude scope

Important! All methods of Scope class create new instance of a class, i.e. you don't need to make a manual copy or use clone method

Supports several extension methods

// "constant.numeric.float constant.numeric.hex"
new Scope("constant.numeric.float")
  .withNew("constant.numeric")
  .with(".hex")
  .toString();

// "constant.numeric - constant.numeric.hex"
new Scope("constant.numeric")
  .withoutNew("constant.numeric")
  .without(".hex")
  .toString();

// "constant.numeric.float constant.numeric.hex"
new Scope("constant.numeric.float").withNew("constant.numeric.hex").toString();

// "constant.numeric - constant.numeric.float"
new Scope("constant.numeric").withoutNew("constant.numeric.float").toString();

Predefined scopes

Represent scopes from Scope Naming – Sublime Text and some scope may not work

import { Comment, Entity, Invalid, Storage } from "vscode-syntax-scope";

new Storage().modifier.combine(new Invalid().deprecated);

new Invalid().deprecated.withNew("source.python", "source.java");
0.4.1

6 years ago

0.4.0

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago