bc-vscode-words
TypeScript icon, indicating that this package has built-in type declarations

1.3.16 • Public • Published

Blockception Vscode Words

Npm Package & Publish Npm Test tagged-release npm npm

The lexical analyzers basics used for analyzing code from VSCode documents

Examples

//Offset words contain only the offset of the word in the text
function Process(doc: TextDocument) {
  let Words = RangedWord.Parse(doc, /([^ \t\r\n]+)+/gi);

	foreach(var W in Words) {
		if (W.text === "hello") {
			let offset = W.offset;
			let pos = doc.positionAt(offset);
		}
	}
}
//Ranged words contain the start (the character and line) and end of a word
function Process(doc: TextDocument) {
  let Words = RangedWord.Parse(doc, /([^ \t\r\n]+)+/gi);

	foreach(var W in Words) {
		if (W.text === "hello") {
			let range = W.range;
		}
	}
}
//Location words contain the start (the character and line) and end of a word and the uri
function Process(doc: TextDocument) {
  let Words = LocationWord.ParseFromRegexDoc(doc, /([^ \t\r\n]+)+/gi);

	foreach(var W in Words) {
		if (W.text === "hello") {
			let range = W.location.range;
			let uri = W.location.uri
		}
	}
}

Contributing

First, read the contributing guide. fork the project, clone it and run the following commands:

Installation

  npm ci
  npm update

Readme

Keywords

Package Sidebar

Install

npm i bc-vscode-words

Weekly Downloads

11

Version

1.3.16

License

BSD-3-Clause

Unpacked Size

74.5 kB

Total Files

49

Last publish

Collaborators

  • blockceptionltd
  • daanv2