Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

Commit 01c6e22

Browse files
authored
Merge branch 'master' into master
2 parents 5ebda6f + ceba58e commit 01c6e22

File tree

11 files changed

+46
-17
lines changed

11 files changed

+46
-17
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ out/
1212
scala/server/ensimeServer-assembly*
1313
coursier
1414
.ensime
15+
.hydra

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This is an experiment for building a Language Server for Scala, in Scala.
1111
- scala: A Typescript-based Scala extension (language client). Ideally it will be ported to Scala.js
1212
- ensime-lsp: An implementation of the Language Server based on Ensime
1313

14-
The language server may be backed up by [ensime](http://ensime.github.io/) or directly by the presentation compiler. Ideally, the language server ca be used as a basis for implementing support for any language, not just Scala.
14+
The language server may be backed up by [ensime](http://ensime.github.io/) or directly by the presentation compiler. Ideally, the language server can be used as a basis for implementing support for any language, not just Scala.
1515

1616
# How to try it out
1717

@@ -41,7 +41,7 @@ $ npm install -g vsce typescript # if you don't have Typescript installed global
4141
$ vsce package
4242
```
4343

44-
You should see a file `ensime-scala-0.0.4.vsix` (or whatever version you are building). Now install it in Code by choosing `Install from VSIX` in the Extensions view.
44+
You should see a file `scala-lsp-x.x.x.vsix` (`x.x.x` representing the version you are building). Now install it in Code by choosing `Install from VSIX` in the Extensions view.
4545

4646

4747
The root Sbt project controls all the Scala parts of the build. The client is written in Typescript (it's really minimal) and lives under scala/. This one is built using Code's tools.
@@ -83,4 +83,4 @@ This setting is passed to the Language Server affecting the log level on the ser
8383
> sonatypeRelease
8484
```
8585

86-
Then `cd scala/` and run `vsce publish`
86+
Then `cd scala/` and run `vsce publish`

build.sbt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ pomIncludeRepository := { _ => false }
99

1010
lazy val commonSettings = Seq(
1111
organization := "com.github.dragos",
12-
version := "0.1.7-SNAPSHOT",
1312
resolvers += "dhpcs at bintray" at "https://dl.bintray.com/dhpcs/maven",
1413
libraryDependencies ++= Seq(
1514
"org.scalatest" %% "scalatest" % "3.0.1" % "test"
@@ -87,3 +86,8 @@ lazy val `ensime-lsp` = project.
8786
</developers>
8887
}
8988
)
89+
90+
lazy val vscodeRoot = project
91+
.in(file("."))
92+
.settings(publishArtifact := false)
93+
.aggregate(languageserver, `ensime-lsp`)

ensime-lsp/src/main/scala/org/github/dragos/vscode/EnsimeLanguageServer.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class EnsimeLanguageServer(in: InputStream, out: OutputStream) extends LanguageS
8989
logger.debug(config)
9090
val fallback = ConfigFactory.parseString(config)
9191
ConfigFactory.load().withFallback(fallback)
92-
}
92+
}
9393

9494
private def initializeEnsime(rootPath: String): Try[EnsimeConfig] = {
9595
val ensimeFile = new File(s"$rootPath/.ensime")
@@ -100,7 +100,7 @@ class EnsimeLanguageServer(in: InputStream, out: OutputStream) extends LanguageS
100100
val serverConfig: EnsimeServerConfig = parseServerConfig(config)
101101
val ensimeConfig = EnsimeConfigProtocol.parse(serverConfig.config.file.readString()(MessageReader.Utf8Charset))
102102
Canon.config = ensimeConfig
103-
Canon.serverConfig = serverConfig
103+
Canon.serverConfig = serverConfig
104104
(ensimeConfig, serverConfig)
105105
}
106106

@@ -119,7 +119,7 @@ class EnsimeLanguageServer(in: InputStream, out: OutputStream) extends LanguageS
119119
fileStore = new TempFileStore(config.cacheDir.file.toString)
120120
ensimeActor = system.actorOf(Props(classOf[EnsimeActor], this, config, serverConfig), "server")
121121
}
122-
t.recover{case e =>
122+
t.recover{case e =>
123123
logger.error(s"initializeEnsime: ${e.getMessage}"); e.printStackTrace
124124
connection.showMessage(MessageType.Error, s"Error creating storage: ${e.getMessage}")
125125
}
@@ -172,7 +172,7 @@ class EnsimeLanguageServer(in: InputStream, out: OutputStream) extends LanguageS
172172
}
173173

174174
override def onCloseTextDocument(td: TextDocumentIdentifier) = {
175-
logger.debug("Removing ${td.uri} from Ensime.")
175+
logger.debug(s"Removing ${td.uri} from Ensime.")
176176
val doc = documentManager.documentForUri(td.uri)
177177
doc.map(d => ensimeActor ! RemoveFileReq(d.toFile))
178178
}

scala/CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
# Change Log
22

3-
## 0.1.x (MM DD, YYYY)
3+
## 0.2.1 (Oct 1, 2017)
4+
5+
- Fix configuration path on Windows (#62)
6+
- Use placeholders in snippets (#64)
7+
8+
## 0.2.0 (Sept 19, 2017)
9+
10+
- Add Scala 2.12 support (based on Ensime 2.0-M4)
11+
- Customizable log level
12+
13+
## 0.1.6 (June 20, 2017)
14+
15+
- Only start the VSCode extension when a .ensime file exists (#47)
16+
- Added support for scalariformFormat (#44)
17+
18+
## 0.1.4 (April 18, 2017)
419

520
- add proxy settings for Coursier download. Use `"http.proxy": "http://host:port/"` in the VS Code settings file.
621

scala/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ If you find this useful, please file tickets and contribute fixes. I'm working o
1212

1313
If you can't contribute your time but would like to donate, please [donate to the Ensime project](http://ensime.org/sponsor/) instead. This plugin delegates to Ensime for most of its features.
1414

15+
# Setting up
16+
17+
This extension is based on [Ensime](http://ensime.org), so you need to create an Ensime configuration file before you can use it. This file lists source directories, classpath entries and compiler arguments. If you have an Sbt project simply add the [sbt-ensime](http://ensime.org/build_tools/sbt/) plugin and follow the guide (other build tools are [supported](http://ensime.org/build_tools/)). Then just run `sbt ensimeConfig` and voilà! You're all set up.
18+
19+
>Remember to regenerate this file everytime you change your build (adding/removing dependencies, compiler arguments, etc.).
20+
21+
If you already started Code, it should detect that a new `.ensime` file was created and pick up the project.
22+
1523
# Setting the JDK
1624

1725
The path to the Java Development Kit is searched in the following order:

scala/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Scala Language Server",
44
"description": "A Scala language server based on Ensime",
55
"icon": "images/scala-logo.png",
6-
"version": "0.1.6",
6+
"version": "0.2.1",
77
"repository": {
88
"url": "https://github.com/dragos/dragos-vscode-scala"
99
},
@@ -12,7 +12,7 @@
1212
},
1313
"publisher": "dragos",
1414
"engines": {
15-
"vscode": "^1.10.0"
15+
"vscode": "^1.16.1"
1616
},
1717
"categories": [
1818
"Languages"

scala/snippets/scala.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
"prefix": "resolvers",
1111
"body": [
1212
"resolvers += ",
13-
" \"${name: Repository name}\" at \"${url: Url where the repository is defined}\""
13+
"\"${1:Repository name}\" at \"${2:Url where the repository is defined}\""
1414
]
1515
},
1616

1717
"New ScalaTest suite": {
1818
"prefix": "suite",
1919
"body": [
20-
"class ${MyTestSuite} extends FunSuite {",
21-
" test(\"${test name}\") {",
20+
"class ${1:MyTestSuite} extends FunSuite {",
21+
" test(\"${2:Test name}\") {",
2222
" }",
2323
"}"
2424
]
2525
}
26-
}
26+
}

scala/src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export async function activate(context: ExtensionContext) {
4949
let logLevelStr = ''
5050
if(logLevel != null) logLevelStr = logLevel.toString()
5151

52-
let coursierArgs = ['launch', '-r', 'https://dl.bintray.com/dhpcs/maven', '-r', 'sonatype:releases', '-J', toolsJar, 'com.github.dragos:ensime-lsp_2.12:0.1.7-SNAPSHOT', '-M', 'org.github.dragos.vscode.Main'];
52+
let coursierArgs = ['launch', '-r', 'https://dl.bintray.com/dhpcs/maven', '-r', 'sonatype:releases', '-J', toolsJar, 'com.github.dragos:ensime-lsp_2.12:0.2.1', '-M', 'org.github.dragos.vscode.Main'];
5353
let javaArgs = proxyArgs.concat(['-Dvscode.workspace=' + workspace.rootPath,'-Dvscode.logLevel=' + logLevel, '-jar', coursierPath]).concat(coursierArgs);
5454
// The debug options for the server
5555
let debugOptions = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000,quiet=y'];

sonatype.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
//sonatypeProfileName := "dragos"
1+
sonatypeProfileName := "com.github.dragos"

0 commit comments

Comments
 (0)