diff --git a/README.md b/README.md index b00c5ef..cbae11f 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Validates all `class` attributes in the active editor. ### Clear style cache -Clears stylesheet cache. +Clears style cache. ## Installation diff --git a/src/extension.ts b/src/extension.ts index ebf25e6..866fef0 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -4,8 +4,8 @@ */ import { - ExtensionContext, commands, + ExtensionContext, languages, window, workspace, diff --git a/src/parser.ts b/src/parser.ts index 32fc5ce..685f556 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -23,7 +23,7 @@ export interface Style { export function parse(text: string) { const styles: Style[] = []; - const lc = lineColumn(text); + const lc = lineColumn(text, { origin: 0 }); let match, lci, index; let line = 0; let col = 0; @@ -31,8 +31,8 @@ export function parse(text: string) { index = match.index; lci = lc.fromIndex(index); if (lci) { - line = lci.line - 1; - col = lci.col; + line = lci.line; + col = lci.col + 1; } styles.push({ index, diff --git a/test/suite/index.ts b/test/suite/index.ts index 8f1f9d6..b980a8b 100644 --- a/test/suite/index.ts +++ b/test/suite/index.ts @@ -18,7 +18,7 @@ export function run(): Promise { return new Promise((resolve, reject) => { glob("**/**.test.js", { cwd: testsRoot }) .then((files) => { - files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f))); + files.forEach((file) => mocha.addFile(path.resolve(testsRoot, file))); try { mocha.run((failures) => { if (failures > 0) {