Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added repl command (supports sandbox)

  • Loading branch information...
commit 5315df2a2257b7f594db191ff275cca563716098 1 parent fa1e43a
Alexandr Ruchkin mvoidex authored
Showing with 35 additions and 0 deletions.
  1. +4 −0 Default.sublime-commands
  2. +12 −0 ghci.py
  3. +19 −0 repl.sublime-menu
4 Default.sublime-commands
View
@@ -84,5 +84,9 @@
{
"caption": "SublimeHaskell: Reinspect all",
"command": "sublime_haskell_reinspect_all"
+ },
+ {
+ "caption": "SublimeHaskell: GHCi",
+ "command": "sublime_haskell_repl_open"
}
]
12 ghci.py
View
@@ -1,5 +1,6 @@
import re
import os
+import sublime_plugin
from sublime_haskell_common import *
@@ -60,3 +61,14 @@ def ghci_append_package_db(cmd):
if package_conf:
cmd.extend(['-package-db', package_conf])
return cmd
+
+# Opens REPL in SublimeREPL
+class SublimeHaskellReplOpenCommand(sublime_plugin.WindowCommand):
+ def run(self):
+ self.window.run_command("repl_open", {
+ "type": "subprocess",
+ "encoding": "utf8",
+ "cmd": ghci_append_package_db(["ghci"]),
+ "cwd": "$file_path",
+ "external_id": "sublime_haskell",
+ "syntax": "Packages/Haskell/Haskell.tmLanguage" })
19 repl.sublime-menu
View
@@ -0,0 +1,19 @@
+[
+ {
+ "id": "tools",
+ "children":
+ [{
+ "caption": "SublimeREPL",
+ "mnemonic": "r",
+ "id": "SublimeREPL",
+ "children":
+ [
+ {"command": "sublime_haskell_repl_open",
+ "caption": "SublimeHaskell",
+ "id": "repl_sublime_haskell",
+ "mnemonic": "s"
+ }
+ ]
+ }]
+ }
+]
Please sign in to comment.
Something went wrong with that request. Please try again.