Skip to content

Commit

Permalink
Merge branch dev into published
Browse files Browse the repository at this point in the history
  • Loading branch information
PEZ committed Jul 14, 2024
2 parents 23710cb + 6cb4cc3 commit 5ad8b28
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Changes to Calva.

## [Unreleased]

## [2.0.467] - 2024-07-14

- Fix: [Test explorer creates a test case each time a keystroke is registered](https://github.com/BetterThanTomorrow/calva/issues/2530)

## [2.0.466] - 2024-07-13

- Internal: Move drams-menu configuration to the Drams repository. Preparing for ways to contribute drams to Calva.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Calva: Clojure & ClojureScript Interactive Programming",
"description": "Integrated REPL, formatter, Paredit, and more. Powered by cider-nrepl and clojure-lsp.",
"icon": "assets/calva.png",
"version": "2.0.466",
"version": "2.0.467",
"publisher": "betterthantomorrow",
"author": {
"name": "Better Than Tomorrow",
Expand Down
18 changes: 10 additions & 8 deletions src/testRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,15 @@ async function uriForFile(fileName: string): Promise<vscode.Uri> {
}

// Return a valid TestItem for the namespace.
// Creates a new item if one does not exist, otherwise we find the existing entry.
// Creates a new item and adds it to the controller, replacing any existing item for the namespace.
// If a Range is supplied, that we set the range on the returned item.
function upsertNamespace(
function createCleanNamespaceItem(
controller: vscode.TestController,
uri: vscode.Uri,
nsName: string,
range?: vscode.Range
): vscode.TestItem {
let ns = controller.items.get(nsName);
if (!ns) {
ns = controller.createTestItem(nsName, nsName, uri);
}
const ns = controller.createTestItem(nsName, nsName, uri);
if (range) {
ns.range = range;
}
Expand All @@ -52,7 +49,7 @@ function upsertTest(
varName: string,
range?: vscode.Range
): vscode.TestItem {
const ns = upsertNamespace(controller, uri, nsName);
const ns = controller.items.get(nsName);
const testId = nsName + '/' + varName;
let test = ns.children.get(testId);
if (!test) {
Expand Down Expand Up @@ -483,7 +480,12 @@ function onTestTree(controller: vscode.TestController, testTree: lsp.TestTreePar
}
try {
const uri = vscode.Uri.parse(testTree.uri);
const ns = upsertNamespace(controller, uri, testTree.tree.name, createRange(testTree.tree));
const ns = createCleanNamespaceItem(
controller,
uri,
testTree.tree.name,
createRange(testTree.tree)
);
ns.canResolveChildren = true;
testTree.tree.children.forEach((c) => {
upsertTest(controller, uri, testTree.tree.name, c.name, createRange(c));
Expand Down

0 comments on commit 5ad8b28

Please sign in to comment.