@vadapty/tm-scopes
v0.5.0
Published
## Usage
Downloads
4
Readme
TM Scopes
Usage
yarn add @vadapty/tm-scopes
Scope
The Scope
class is a lightweight version of the TM scopes
import { Scope } from "@vadapty/tm-scopes";
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 "@vadapty/tm-scopes";
new Storage().modifier.combine(new Invalid().deprecated);
new Invalid().deprecated.withNew("source.python", "source.java");