summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Fraser <george@fivetran.com>2019-03-26 22:23:11 -0700
committerGeorge Fraser <george@fivetran.com>2019-03-26 22:23:11 -0700
commit71533945fefd6e17e3080cdc8f7a09131f9d3e2a (patch)
tree369f0603d990c7aca3bbc5c1a1003c317a06ecaf
parent1a08b3120ce8285180ec42c9656040fc9981078c (diff)
parent2a1b095e32d5e1bfdb64803ce8b7c3d08f8b2b6f (diff)
downloadjava-language-server-71533945fefd6e17e3080cdc8f7a09131f9d3e2a.zip
Merge branch 'master' into pr/leighmcculloch/86
-rw-r--r--package-lock.json22
-rw-r--r--package.json2
-rw-r--r--src/main/java/org/javacs/Lib.java19
3 files changed, 25 insertions, 18 deletions
diff --git a/package-lock.json b/package-lock.json
index 0babdd0..e289f56 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1774,27 +1774,27 @@
"integrity": "sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg=="
},
"vscode-languageclient": {
- "version": "5.2.1",
- "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-5.2.1.tgz",
- "integrity": "sha512-7jrS/9WnV0ruqPamN1nE7qCxn0phkH5LjSgSp9h6qoJGoeAKzwKz/PF6M+iGA/aklx4GLZg1prddhEPQtuXI1Q==",
+ "version": "5.3.0-next.3",
+ "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-5.3.0-next.3.tgz",
+ "integrity": "sha512-8yMmSYPsMeX6tYCtNDbi5MvzOgDO67ol4YM5oW0MsjzP7ygOgfGqf0+zGXgOV6t+7aqanjTOsSGxZX3FsO8/ig==",
"requires": {
"semver": "^5.5.0",
- "vscode-languageserver-protocol": "3.14.1"
+ "vscode-languageserver-protocol": "3.15.0-next.3"
}
},
"vscode-languageserver-protocol": {
- "version": "3.14.1",
- "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.14.1.tgz",
- "integrity": "sha512-IL66BLb2g20uIKog5Y2dQ0IiigW0XKrvmWiOvc0yXw80z3tMEzEnHjaGAb3ENuU7MnQqgnYJ1Cl2l9RvNgDi4g==",
+ "version": "3.15.0-next.3",
+ "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.0-next.3.tgz",
+ "integrity": "sha512-UzgfXgo+2FgRj27mx2IRUyq/PYkqoh0Cy2OZsao6IGK9LNBTi5n5dICaZw4dzSCJCX8MtbkQ17oCNjcPNy+a+g==",
"requires": {
"vscode-jsonrpc": "^4.0.0",
- "vscode-languageserver-types": "3.14.0"
+ "vscode-languageserver-types": "3.15.0-next.1"
}
},
"vscode-languageserver-types": {
- "version": "3.14.0",
- "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.14.0.tgz",
- "integrity": "sha512-lTmS6AlAlMHOvPQemVwo3CezxBp0sNB95KNPkqp3Nxd5VFEnuG1ByM0zlRWos0zjO3ZWtkvhal0COgiV1xIA4A=="
+ "version": "3.15.0-next.1",
+ "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.15.0-next.1.tgz",
+ "integrity": "sha512-R0kzmaI8gOGEoU7b9huYQAzgZzRQ/5Q8HKjsIUdfz0MjXcBZ4tr1ik1So1p1O5kGrI1VTCd22Fw/wI7ECGoIPw=="
},
"wrappy": {
"version": "1.0.2",
diff --git a/package.json b/package.json
index d104dbb..bb11af5 100644
--- a/package.json
+++ b/package.json
@@ -120,7 +120,7 @@
"test": "npm run compile && node ./node_modules/vscode/bin/test"
},
"dependencies": {
- "vscode-languageclient": "^5.2.1"
+ "vscode-languageclient": "^5.3.0-next.3"
},
"devDependencies": {
"typescript": "^3.2.2",
diff --git a/src/main/java/org/javacs/Lib.java b/src/main/java/org/javacs/Lib.java
index 61c5bc4..083e69c 100644
--- a/src/main/java/org/javacs/Lib.java
+++ b/src/main/java/org/javacs/Lib.java
@@ -3,18 +3,25 @@ package org.javacs;
import java.io.File;
import java.lang.System;
import java.util.Optional;
+import java.util.Arrays;
import java.nio.file.*;
class Lib {
static Optional<Path> srcZipPath() {
return Optional.ofNullable(System.getenv("JAVA_HOME"))
- .flatMap(home -> Optional.of(Paths.get(home).resolve("lib/src.zip")))
- .flatMap(path -> {
- if (path.toFile().exists()) {
- return Optional.of(path);
- } else {
- return Optional.empty();
+ .map(home -> {
+ return Arrays.asList(new Path[]{
+ Paths.get(home).resolve("lib/src.zip"),
+ Paths.get(home).resolve("src.zip"),
+ });
+ })
+ .flatMap(paths -> {
+ for (Path path : paths) {
+ if (path.toFile().exists()) {
+ return Optional.of(path);
+ }
}
+ return Optional.empty();
});
}