INNER CODE UNIT · TypeScript
getAllKeyPathElementsOfDocument
tim-koehler/Helm-Intellisense · src/Commands/LintCommand.ts:97
export function getAllKeyPathElementsOfDocument(doc: vscode.TextDocument): Element[] {
const txt = doc.getText().split('\n');
const elementArray = new Array<Element>();
for (let lineIndex = 0; lineIndex < txt.length; lineIndex++) {
const line = txt[lineIndex];
if (!line.includes('.Values')) {
continue;
}
const regexBrackets = /\{\{-? ?(else )?if .*?\}\}/g;
if (regexBrackets.exec(line) !== null) {
continue;
}
const words = line.split(' ');
let insideComment = false;