Skip to content

Commit 2eefb66

Browse files
committed
indentation fix
Signed-off-by: Ritabrata Ghosh <76sonali40@gmail.com>
1 parent 2e18143 commit 2eefb66

3 files changed

Lines changed: 53 additions & 48 deletions

File tree

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/vscode/extension.test.ts

Lines changed: 44 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -209,49 +209,48 @@ suite('Extension Test Suite', () => {
209209
});
210210

211211
test("Lint diagnostics should be ordered by line number", async function () {
212-
this.timeout(15000);
213-
214-
const extension = vscode.extensions.getExtension(
215-
"sourcemeta.sourcemeta-studio"
216-
);
217-
if (extension && !extension.isActive) {
218-
await extension.activate();
219-
}
220-
const fixtureDir = path.join(
221-
__dirname,
222-
"..",
223-
"..",
224-
"..",
225-
"test",
226-
"vscode",
227-
"fixtures"
228-
);
229-
const schemaPath = path.join(fixtureDir, "lint-order.schema.json");
230-
231-
const document = await vscode.workspace.openTextDocument(
232-
vscode.Uri.file(schemaPath)
233-
);
234-
await vscode.window.showTextDocument(document);
235-
236-
await vscode.commands.executeCommand("sourcemeta-studio.openPanel");
237-
238-
// wait for lint + diagnostics
239-
await new Promise((resolve) => setTimeout(resolve, 5000));
240-
241-
const diagnostics = vscode.languages
242-
.getDiagnostics(document.uri)
243-
.filter((d) => d.source === "Sourcemeta Studio (Lint)");
244-
245-
assert.ok(diagnostics.length > 1, "Expected multiple lint diagnostics");
246-
247-
const lineNumbers = diagnostics.map((d) => d.range.start.line);
248-
249-
const sorted = [...lineNumbers].sort((a, b) => a - b);
250-
251-
assert.deepStrictEqual(
252-
lineNumbers,
253-
sorted,
254-
"Lint diagnostics should be sorted by line number"
255-
);
256-
});
212+
this.timeout(15000);
213+
214+
const extension = vscode.extensions.getExtension(
215+
"sourcemeta.sourcemeta-studio"
216+
);
217+
if (extension && !extension.isActive) {
218+
await extension.activate();
219+
}
220+
const fixtureDir = path.join(
221+
__dirname,
222+
"..",
223+
"..",
224+
"..",
225+
"test",
226+
"vscode",
227+
"fixtures"
228+
);
229+
const schemaPath = path.join(fixtureDir, "lint-order.schema.json");
230+
231+
const document = await vscode.workspace.openTextDocument(
232+
vscode.Uri.file(schemaPath)
233+
);
234+
await vscode.window.showTextDocument(document);
235+
236+
await vscode.commands.executeCommand("sourcemeta-studio.openPanel");
237+
238+
await new Promise((resolve) => setTimeout(resolve, 5000));
239+
240+
const diagnostics = vscode.languages
241+
.getDiagnostics(document.uri)
242+
.filter((d) => d.source === "Sourcemeta Studio (Lint)");
243+
244+
assert.ok(diagnostics.length > 1, "Expected multiple lint diagnostics");
245+
246+
const lineNumbers = diagnostics.map((d) => d.range.start.line);
247+
248+
const sorted = [...lineNumbers].sort((a, b) => a - b);
249+
250+
assert.deepStrictEqual(
251+
lineNumbers,
252+
sorted,
253+
"Lint diagnostics should be sorted by line number"
254+
);
255+
});
257256
});

vscode/src/extension.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,9 @@ async function updatePanelContent(): Promise<void> {
334334
const lintResult = parseLintResult(lintOutput);
335335

336336
if (lintResult.errors && lintResult.errors.length > 0) {
337-
// TODO: Consider moving lint diagnostic ordering to the jsonschema CLI
338-
lintResult.errors = sortLintErrorsByLocation(lintResult.errors);
339-
}
337+
// TODO: Consider moving lint diagnostic ordering to the jsonschema CLI
338+
lintResult.errors = sortLintErrorsByLocation(lintResult.errors);
339+
}
340340

341341
const parseErrors = hasJsonParseErrors(lintResult, metaschemaResult);
342342

0 commit comments

Comments
 (0)