Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Using atom-package-deps to install plugin dependencies #26

Merged
merged 2 commits into from
Dec 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,13 @@ For the full list of implemented and planned features see the [server roadmap](h

## Installation

* You need to have packages for basic Scala language support and the [IDE UI](https://github.com/facebook-atom/atom-ide-ui) installed. You can install all three at once with this command:
* You can install it using Atom interface or by running this command:
```
apm install language-scala atom-ide-ui ide-scala
apm install ide-scala
```
On the first launch it will automatically install its dependencies if needed:
+ [language-scala](https://github.com/atom-community/language-scala) for basic Scala syntax highlighting
+ [atom-ide-ui](https://github.com/facebook-atom/atom-ide-ui) for the Atom IDE interface

* If you are using [jEnv](http://www.jenv.be) you may need to export `JAVA_HOME` using jEnv plugin:
```
Expand Down
5 changes: 5 additions & 0 deletions apm.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,13 @@ packageJson := {
),
"dependencies" -> Json.obj(
"atom-languageclient" -> "0.7.0",
"atom-package-deps" -> "4.6.1",
"find-java-home" -> "0.2.0"
),
"package-deps" -> Json.arr(
"language-scala",
"atom-ide-ui"
),
"consumedServices" -> Json.obj(
"linter-indie" -> Json.obj(
"versions" -> Json.obj("2.0.0" -> "consumeLinterV2")
Expand Down
15 changes: 13 additions & 2 deletions src/main/scala/Exports.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,23 @@ package laughedelic.atom.ide.scala
import scala.scalajs.js, js.annotation._
import laughedelic.atom.ide.ui.busysignal.BusySignalService

// NOTE: This is pure boilerplate. We need it because we can't simply say `module.exports = new ScalaLanguageClient();`
@js.native @JSImport("atom-package-deps", JSImport.Namespace)
object packageDeps extends js.Object {
def install(
packageName: String = js.native,
showPrompt: Boolean = js.native
): js.Promise[Unit] = js.native
}

// NOTE: This is pure boilerplate. We need it because we can"t simply say `module.exports = new ScalaLanguageClient();`
object Exports {
private val client = new ScalaLanguageClient()

@JSExportTopLevel("activate")
def activate(): Unit = client.activate()
def activate(): Unit = {
packageDeps.install("ide-scala", showPrompt = false)
client.activate()
}
@JSExportTopLevel("deactivate")
def deactivate(): js.Promise[js.Any] = client.deactivate()

Expand Down