The lexical analyzers basics used for analyzing code from VSCode documents
//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
}
}
}
First, read the contributing guide. fork the project, clone it and run the following commands:
Installation
npm ci
npm update