Skip to content

Commit

Permalink
Fix #703
Browse files Browse the repository at this point in the history
  • Loading branch information
bpringe committed Jul 29, 2020
1 parent b9b43ac commit e829c56
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { REQUESTS, initializeDebugger } from './debugger/calva-debug';
import * as resultsOutput from './result-output'
import evaluate from './evaluate';

async function createAndConnectReplWindow(session: NReplSession, mode: "clj" | "cljs", ): Promise<void> {
async function createAndConnectReplWindow(session: NReplSession, mode: "clj" | "cljs"): Promise<void> {
if (state.config().openREPLWindowOnConnect) {
return createReplWindow(session, mode).then(w => {
return openReplWindow(mode, true).then(w => {
Expand Down Expand Up @@ -76,13 +76,18 @@ async function connectToHost(hostname, port, connectSequence: ReplConnectSequenc
if (connectSequence.afterCLJReplJackInCode) {
const evalPos = outputDocument.positionAt(outputDocument.getText().length);
await resultsOutput.appendToResultsDoc(`; Evaluating 'afterCLJReplJackInCode'\n${connectSequence.afterCLJReplJackInCode}`);
await evaluate.evaluateCode(connectSequence.afterCLJReplJackInCode, {
filePath: outputDocument.fileName,
session: resultsOutput.getSession(),
ns: resultsOutput.getNs(),
line: evalPos.line,
column: evalPos.character
});
try {
await evaluate.evaluateCode(connectSequence.afterCLJReplJackInCode, {
filePath: outputDocument.fileName,
session: resultsOutput.getSession(),
ns: resultsOutput.getNs(),
line: evalPos.line,
column: evalPos.character
});
}
catch (e) {
chan.appendLine("Evaluation of afterCLJReplJackInCode failed. See the output window.")
}
}

let cljsSession = null,
Expand Down

0 comments on commit e829c56

Please sign in to comment.