Merge branch 'master' of github.com:spring-projects/sts4
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
},
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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<LanguageServerProcess> {
|
||||
// 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',
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'scopeName': 'source.concourse-task-yaml'
|
||||
'name': 'Concourse-Task-YAML'
|
||||
'fileTypes': [
|
||||
'tasks.yml'
|
||||
'task.yml'
|
||||
]
|
||||
'patterns': [
|
||||
{ 'include': 'source.yaml' }
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
},
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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<T> {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user