Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added Scala SBT tool as a REPL #80

Merged
merged 2 commits into from

2 participants

@laughedelic

I offer to integrate SBT (Simple Build Tool) into SublimeREPL for Scala projects. See it's usage in my short screecast.

@wuub wuub merged commit 2d95b43 into wuub:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
10 config/Scala/Default.sublime-commands
@@ -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"
+ }
}
]
View
68 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
4 sublimerepl.py
@@ -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
Something went wrong with that request. Please try again.