Permalink
Browse files

Merge pull request #80 from laughedelic/sbt

Added Scala SBT tool as a REPL
  • Loading branch information...
2 parents 359e679 + 77840a1 commit 2d95b43c83484fc4d74920158215709e11dab87b @wuub wuub committed Sep 23, 2012
Showing with 60 additions and 22 deletions.
  1. +9 −1 config/Scala/Default.sublime-commands
  2. +47 −21 config/Scala/Main.sublime-menu
  3. +4 −0 sublimerepl.py
@@ -1,10 +1,18 @@
[
- {
+ {
"caption": "SublimeREPL: Scala",
"command": "run_existing_window_command", "args":
{
"id": "repl_scala",
"file": "config/Scala/Main.sublime-menu"
}
+ },
+ {
+ "caption": "SublimeREPL: SBT for opened folder",
+ "command": "run_existing_window_command", "args":
+ {
+ "id": "repl_sbt",
+ "file": "config/Scala/Main.sublime-menu"
+ }
}
]
@@ -8,27 +8,53 @@
"id": "SublimeREPL",
"children":
[
- {"command": "repl_open",
- "caption": "Scala",
- "id": "repl_scala",
- "mnemonic": "s",
- "args": {
- "type": "subprocess",
- "encoding": "utf8",
- "external_id": "scala",
- "cmd": {"linux": ["scala"],
- "osx": ["scala"],
- "windows": ["scala.bat", "-i"]},
- "soft_quit": "\nexit\n",
- "cwd": "$file_path",
- "cmd_postfix": "\n",
- "extend_env": {"osx": {"EMACS": "1", "PATH": "{PATH}:/usr/local/bin"},
- "linux": {"EMACS": "1", "PATH": "{PATH}:/usr/local/bin"},
- "windows": {"EMACS": "1"}},
- "suppress_echo": false,
- "syntax": "Packages/Scala/Scala.tmLanguage"
- }
- }
+ {"caption": "Scala",
+ "id": "Scala",
+
+ "children":[
+ {"command": "repl_open",
+ "caption": "scala REPL",
+ "id": "repl_scala",
+ "mnemonic": "s",
+ "args": {
+ "type": "subprocess",
+ "encoding": "utf8",
+ "external_id": "scala",
+ "cmd": {"linux": ["scala"],
+ "osx": ["scala"],
+ "windows": ["scala.bat", "-i"]},
+ "soft_quit": "\nexit\n",
+ "cwd": "$file_path",
+ "cmd_postfix": "\n",
+ "extend_env": {"osx": {"EMACS": "1", "PATH": "{PATH}:/usr/local/bin"},
+ "linux": {"EMACS": "1", "PATH": "{PATH}:/usr/local/bin"},
+ "windows": {"EMACS": "1"}},
+ "suppress_echo": false,
+ "syntax": "Packages/Scala/Scala.tmLanguage"
+ }
+ },
+ {"command": "repl_open",
+ "caption": "SBT for opened folder",
+ "id": "repl_sbt",
+ "mnemonic": "b",
+ "args": {
+ "type": "subprocess",
+ "encoding": "utf8",
+ "external_id": "scala",
+ "cmd": {"linux": ["sbt"],
+ "osx": ["sbt"],
+ "windows": ["sbt"]},
+ "soft_quit": "\nexit\n",
+ "cwd": "$folder",
+ "cmd_postfix": "\n",
+ "extend_env": {"osx": {"EMACS": "1", "PATH": "{PATH}:/usr/local/bin"},
+ "linux": {"EMACS": "1", "PATH": "{PATH}:/usr/local/bin"},
+ "windows": {"EMACS": "1"}},
+ "suppress_echo": false,
+ "syntax": "Packages/Scala/Scala.tmLanguage"
+ }
+ }
+ ]}
]
}]
}
View
@@ -454,6 +454,10 @@ def _subst_for_translate(window):
res["file"] = filename
res["file_path"] = os.path.dirname(filename)
res["file_basename"] = os.path.basename(filename)
+ if window.folders():
+ res["folder"] = window.folders()[0]
+ else:
+ res["folder"] = res["file_path"]
return res
@staticmethod

0 comments on commit 2d95b43

Please sign in to comment.