Skip to content

Commit

Permalink
Merge pull request #2645 from BetterThanTomorrow/2644-autostart-dram-…
Browse files Browse the repository at this point in the history
…current-folder

Initiate dram start + jack-in if project is created in the current folder

* Fixes #2644
  • Loading branch information
PEZ authored Oct 1, 2024
2 parents fc60d6d + 8948e8e commit 791b995
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 791b995

Please sign in to comment.