Skip to content

Commit

Permalink
Opening Simple Browser when using REPL
Browse files Browse the repository at this point in the history
  • Loading branch information
fdodino committed Sep 18, 2023
1 parent a12f2f0 commit e52e253
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/src/commands.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as path from 'path'
import * as vscode from 'vscode'
import {
commands,
ExtensionContext,
Expand Down Expand Up @@ -52,11 +53,18 @@ export const runAllTests = (): Task =>
export const startRepl = (): Task => {
const currentDocument = window.activeTextEditor.document
const currentFileName = path.basename(currentDocument.uri.path)
return wollokCLITask('repl', `Wollok Repl: ${currentFileName}`, [

const replTask = wollokCLITask('repl', `Wollok Repl: ${currentFileName}`, [
'repl',
fsToShell(currentDocument.uri.fsPath),
'--skipValidations',
])

setTimeout(() => {
vscode.commands.executeCommand('simpleBrowser.show', 'http://localhost:3000/')
}, 1000)

return replTask
}

/**
Expand Down

0 comments on commit e52e253

Please sign in to comment.