diff --git a/atom-extensions/atom-bosh/package.json b/atom-extensions/atom-bosh/package.json index 30ac2fdf2..317638018 100644 --- a/atom-extensions/atom-bosh/package.json +++ b/atom-extensions/atom-bosh/package.json @@ -50,7 +50,7 @@ "dependencies": { "atom-package-deps": "^4.6.0", "download": "^6.2.5", - "@pivotal-tools/atom-languageclient-commons": "0.0.9" + "@pivotal-tools/atom-languageclient-commons": "0.0.11" }, "devDependencies": { "typescript": "^2.7.2", diff --git a/atom-extensions/atom-bosh/properties.json b/atom-extensions/atom-bosh/properties.json index 1ce2d8c26..1fa58da79 100644 --- a/atom-extensions/atom-bosh/properties.json +++ b/atom-extensions/atom-bosh/properties.json @@ -1,3 +1,3 @@ { - "jarUrl": "https://s3-us-west-1.amazonaws.com/s3-test.spring.io/sts4/fatjars/snapshots/bosh-language-server-0.6.0-201808212257.jar" + "jarUrl": "https://s3-us-west-1.amazonaws.com/s3-test.spring.io/sts4/fatjars/snapshots/bosh-language-server-1.1.1-201811230132.jar" } diff --git a/atom-extensions/atom-cf-manifest-yaml/package.json b/atom-extensions/atom-cf-manifest-yaml/package.json index d71df9ed9..074ee285a 100644 --- a/atom-extensions/atom-cf-manifest-yaml/package.json +++ b/atom-extensions/atom-cf-manifest-yaml/package.json @@ -19,7 +19,7 @@ "properties.json" ], "dependencies": { - "@pivotal-tools/atom-languageclient-commons": "0.0.9", + "@pivotal-tools/atom-languageclient-commons": "0.0.11", "atom-package-deps": "^4.6.0", "download": "^6.2.5" }, diff --git a/atom-extensions/atom-cf-manifest-yaml/properties.json b/atom-extensions/atom-cf-manifest-yaml/properties.json index 9646c2cb3..30ee33abb 100644 --- a/atom-extensions/atom-cf-manifest-yaml/properties.json +++ b/atom-extensions/atom-cf-manifest-yaml/properties.json @@ -1,3 +1,3 @@ { - "jarUrl": "https://s3-us-west-1.amazonaws.com/s3-test.spring.io/sts4/fatjars/snapshots/manifest-yaml-language-server-0.6.0-201808212257.jar" + "jarUrl": "https://s3-us-west-1.amazonaws.com/s3-test.spring.io/sts4/fatjars/snapshots/manifest-yaml-language-server-1.1.1-201811230132.jar" } diff --git a/atom-extensions/atom-commons/lib/java-process-language-client.ts b/atom-extensions/atom-commons/lib/java-process-language-client.ts index fdb9dd7eb..1efef0ee0 100644 --- a/atom-extensions/atom-commons/lib/java-process-language-client.ts +++ b/atom-extensions/atom-commons/lib/java-process-language-client.ts @@ -6,7 +6,6 @@ import {HighlightParams, ProgressParams, CursorMovementParams, StsAdapter} from import {ActiveServer, LanguageServerProcess} from 'atom-languageclient'; import {AutoLanguageClient} from 'atom-languageclient'; import {findJdk, findJvm, JVM} from '@pivotal-tools/jvm-launch-utils'; -import {InitializeParams} from 'vscode-languageserver-protocol'; import {Writable} from 'stream'; export class JavaProcessLanguageClient extends AutoLanguageClient { @@ -39,16 +38,17 @@ export class JavaProcessLanguageClient extends AutoLanguageClient { return Promise.reject(new Error(detail)); } - protected getInitializeParams(projectPath: string, process: LanguageServerProcess): InitializeParams { - const initParams = super.getInitializeParams(projectPath, process); - initParams.capabilities = { - workspace: { - executeCommand: { - } - } - }; - return super.getInitializeParams(projectPath, process); - } + // TODO: Unclear why that was overriden + // protected getInitializeParams(projectPath: string, process: LanguageServerProcess): InitializeParams { + // const initParams = super.getInitializeParams(projectPath, process); + // initParams.capabilities = { + // workspace: { + // executeCommand: { + // } + // } + // }; + // return initParams; + // } protected startServerProcess(projectPath: string): LanguageServerProcess | Promise { // TODO: Remove when debugging is over @@ -169,7 +169,6 @@ export class JavaProcessLanguageClient extends AutoLanguageClient { private doLaunchProcess(jvm: JVM, launcher: string, args: string[] =[]): LanguageServerProcess { let vmArgs = args.concat([ - // Atom doesn't have lazy completion proposals support - completionItem/resolve message. Disable lazy completions '-Dsts.lsp.client=atom', // '-Dlsp.completions.indentation.enable=true', // Looks like Atom has magic indents same like VSCode - comment it out '-Dlsp.yaml.completions.errors.disable=true', diff --git a/atom-extensions/atom-commons/package.json b/atom-extensions/atom-commons/package.json index 25ca8275f..ca9339642 100644 --- a/atom-extensions/atom-commons/package.json +++ b/atom-extensions/atom-commons/package.json @@ -1,6 +1,6 @@ { "name": "@pivotal-tools/atom-languageclient-commons", - "version": "0.0.9", + "version": "0.0.11", "description": "Atom language client commons for STS4 language servers", "repository": "https://github.com/spring-projects/sts4", "license": "MIT", @@ -22,11 +22,10 @@ }, "dependencies": { "@pivotal-tools/jvm-launch-utils": "0.0.11", - "atom-languageclient": "0.9.6", + "atom-languageclient": "0.9.8", "portfinder": "^1.0.13", "@types/atom": "^1.24.1", - "@types/node": "^8.0.41", - "vscode-languageserver-protocol": "3.6.0-next.5" + "@types/node": "^8.0.41" }, "devDependencies": { "tslint": "^5.9.1", diff --git a/atom-extensions/atom-concourse/grammars/concourse-task-yaml.cson b/atom-extensions/atom-concourse/grammars/concourse-task-yaml.cson index c39eae61a..3c821f0ba 100644 --- a/atom-extensions/atom-concourse/grammars/concourse-task-yaml.cson +++ b/atom-extensions/atom-concourse/grammars/concourse-task-yaml.cson @@ -1,7 +1,7 @@ 'scopeName': 'source.concourse-task-yaml' 'name': 'Concourse-Task-YAML' 'fileTypes': [ - 'tasks.yml' + 'task.yml' ] 'patterns': [ { 'include': 'source.yaml' } diff --git a/atom-extensions/atom-concourse/package.json b/atom-extensions/atom-concourse/package.json index 2ce978629..089e7ea7b 100644 --- a/atom-extensions/atom-concourse/package.json +++ b/atom-extensions/atom-concourse/package.json @@ -21,7 +21,7 @@ "dependencies": { "atom-package-deps": "^4.6.0", "download": "^6.2.5", - "@pivotal-tools/atom-languageclient-commons": "0.0.9" + "@pivotal-tools/atom-languageclient-commons": "0.0.11" }, "devDependencies": { "typescript": "^2.7.2", diff --git a/atom-extensions/atom-concourse/properties.json b/atom-extensions/atom-concourse/properties.json index 58a4ef86f..59544f91e 100644 --- a/atom-extensions/atom-concourse/properties.json +++ b/atom-extensions/atom-concourse/properties.json @@ -1,3 +1,3 @@ { - "jarUrl": "https://s3-us-west-1.amazonaws.com/s3-test.spring.io/sts4/fatjars/snapshots/concourse-language-server-0.6.0-201808212257.jar" + "jarUrl": "https://s3-us-west-1.amazonaws.com/s3-test.spring.io/sts4/fatjars/snapshots/concourse-language-server-1.1.1-201811230132.jar" } diff --git a/atom-extensions/atom-spring-boot/package.json b/atom-extensions/atom-spring-boot/package.json index 9139120b5..6c6ac16bf 100644 --- a/atom-extensions/atom-spring-boot/package.json +++ b/atom-extensions/atom-spring-boot/package.json @@ -47,8 +47,8 @@ } }, "dependencies": { - "atom-languageclient": "0.9.6", - "@pivotal-tools/atom-languageclient-commons": "0.0.9", + "@pivotal-tools/atom-languageclient-commons": "0.0.11", + "vscode-languageserver-protocol": "3.12.0", "atom-package-deps": "^4.6.0", "download": "^6.2.5" }, diff --git a/atom-extensions/atom-spring-boot/properties.json b/atom-extensions/atom-spring-boot/properties.json index 802af2aab..29f3343fa 100644 --- a/atom-extensions/atom-spring-boot/properties.json +++ b/atom-extensions/atom-spring-boot/properties.json @@ -1,3 +1,3 @@ { - "jarUrl": "https://s3.amazonaws.com/dist.springsource.com/release/STS4/fatjars/spring-boot-language-server-0.7.0-201809100923.jar" + "jarUrl": "https://s3-us-west-1.amazonaws.com/s3-test.spring.io/sts4/fatjars/snapshots/spring-boot-language-server-1.1.1-201811230132.jar" } diff --git a/headless-services/commons/commons-language-server/src/main/java/org/springframework/ide/vscode/commons/languageserver/quickfix/Quickfix.java b/headless-services/commons/commons-language-server/src/main/java/org/springframework/ide/vscode/commons/languageserver/quickfix/Quickfix.java index d2a688eb0..0401e813a 100644 --- a/headless-services/commons/commons-language-server/src/main/java/org/springframework/ide/vscode/commons/languageserver/quickfix/Quickfix.java +++ b/headless-services/commons/commons-language-server/src/main/java/org/springframework/ide/vscode/commons/languageserver/quickfix/Quickfix.java @@ -14,6 +14,7 @@ import org.eclipse.lsp4j.CodeActionContext; import org.eclipse.lsp4j.Command; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.Range; +import org.springframework.ide.vscode.commons.util.text.DocumentUtil; import com.google.common.collect.ImmutableList; @@ -59,7 +60,7 @@ public class Quickfix { } public boolean appliesTo(Range range, CodeActionContext context) { - return range.equals(this.range) && appliesToContext(context); + return appliesToContext(context) && DocumentUtil.containsRange(this.range, range); } private boolean appliesToContext(CodeActionContext context) { diff --git a/headless-services/commons/commons-util/src/main/java/org/springframework/ide/vscode/commons/util/text/DocumentUtil.java b/headless-services/commons/commons-util/src/main/java/org/springframework/ide/vscode/commons/util/text/DocumentUtil.java index 4e8aef546..e1f87e092 100644 --- a/headless-services/commons/commons-util/src/main/java/org/springframework/ide/vscode/commons/util/text/DocumentUtil.java +++ b/headless-services/commons/commons-util/src/main/java/org/springframework/ide/vscode/commons/util/text/DocumentUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2016-2017 Pivotal, Inc. + * Copyright (c) 2016, 2018 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,6 +11,8 @@ package org.springframework.ide.vscode.commons.util.text; +import org.eclipse.lsp4j.Position; +import org.eclipse.lsp4j.Range; import org.springframework.ide.vscode.commons.util.Assert; import org.springframework.ide.vscode.commons.util.BadLocationException; @@ -45,5 +47,24 @@ public class DocumentUtil { throw new IllegalStateException("Bug!", e); } } + + /** + * Compares two LSP4J positions + * @param p1 + * @param p2 + * @return integer number which is 0 if equals, <0 if p1 comes before p2 and >0 otherwise + */ + public static int compare(Position p1, Position p2) { + int res = p1.getLine() - p2.getLine(); + if (res == 0) { + res = p1.getCharacter() - p2.getCharacter(); + } + return res; + } + + public static boolean containsRange(Range outer, Range inner) { + return compare(outer.getStart(), inner.getStart()) <= 0 + && compare(outer.getEnd(), inner.getEnd()) >= 0; + } }