Skip to content

Commit

Permalink
Initiate dram start + jack-in if project is created in the current fo…
Browse files Browse the repository at this point in the history
…lder

* Fixes #2644
  • Loading branch information
PEZ committed Sep 30, 2024
1 parent fc60d6d commit 8948e8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Changes to Calva.

## [Unreleased]

- [Autostart REPL in created projects, also when created in the current folder](https://github.com/BetterThanTomorrow/calva/issues/2644)

## [2.0.478] - 2024-09-30

- [Add `extraNReplMiddleware` to `connectSequence`](https://github.com/BetterThanTomorrow/calva/issues/1691)
Expand Down
9 changes: 8 additions & 1 deletion src/nrepl/drams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,14 @@ export async function createAndOpenDram(

await serializeDramStartConfig(projectRootUri, { config });

return vscode.commands.executeCommand('vscode.openFolder', projectRootUri, true);
const currentWorkspaceFolder = vscode.workspace.workspaceFolders?.[0];

if (currentWorkspaceFolder && currentWorkspaceFolder.uri.fsPath === projectRootUri.fsPath) {
await startDram();
return vscode.commands.executeCommand('calva.jackIn');
} else {
return vscode.commands.executeCommand('vscode.openFolder', projectRootUri, true);
}
}

function ARGS_FILE_PATH(projectRootUri: vscode.Uri) {
Expand Down

0 comments on commit 8948e8e

Please sign in to comment.