Merge branch 'master' into jdt-classpath

This commit is contained in:
Kris De Volder
2018-03-13 10:06:42 -07:00
125 changed files with 1910 additions and 838 deletions

View File

@@ -1,6 +1,7 @@
/.idea
/node_modules
/server
/build
*.tgz
*.iml
*.log

View File

@@ -1,21 +1,22 @@
const path = require('path');
const { JavaProcessLanguageClient } = require('@pivotal-tools/atom-languageclient-commons');
const PROPERTIES = require('../properties.json');
import * as path from 'path';
import {JavaProcessLanguageClient} from '@pivotal-tools/atom-languageclient-commons';
import {ActiveServer} from 'atom-languageclient';
import {JVM} from '@pivotal-tools/jvm-launch-utils';
class BoshYamlClient extends JavaProcessLanguageClient {
export class BoshYamlClient extends JavaProcessLanguageClient {
constructor() {
//noinspection JSAnnotator
super(
PROPERTIES.jarUrl,
path.join(__dirname, '..', 'server'),
'bosh-language-server.jar'
);
);
}
postInitialization(server) {
postInitialization(server: ActiveServer) {
this.sendConfig(server);
this._disposable.add(atom.config.observe('bosh-yaml', () => this.sendConfig(server)));
(<any>this)._disposable.add(atom.config.observe('bosh-yaml', () => this.sendConfig(server)));
}
getGrammarScopes() {
@@ -37,7 +38,7 @@ class BoshYamlClient extends JavaProcessLanguageClient {
super.activate();
}
launchVmArgs(jvm) {
launchVmArgs(jvm: JVM): Promise<string[]> {
return Promise.resolve([
'-Dorg.slf4j.simpleLogger.logFile=bosh-yaml.log',
'-Dorg.slf4j.simpleLogger.defaultLogLevel=debug',
@@ -45,10 +46,8 @@ class BoshYamlClient extends JavaProcessLanguageClient {
}
sendConfig(server) {
sendConfig(server: ActiveServer) {
server.connection.didChangeConfiguration({ settings: atom.config.get('bosh-yaml') });
}
}
module.exports = new BoshYamlClient();
}

View File

@@ -0,0 +1,3 @@
import {BoshYamlClient} from './bosh-yaml-client';
module.exports = new BoshYamlClient();

View File

@@ -1,26 +1,23 @@
{
"name": "bosh-yaml",
"main": "./lib/main",
"version": "0.1.5",
"version": "0.1.6",
"description": "Provides validation and content assist for various Bosh configuration files",
"repository": "https://github.com/spring-projects/atom-bosh",
"icon": "icon.png",
"license": "MIT",
"engines": {
"atom": ">=1.21.0"
"atom": ">=1.24.0"
},
"main": "./build/main",
"types": "./build/main.d.ts",
"files": [
"grammars/",
"settings/",
"lib/",
"build/",
"server/",
"properties.json"
],
"dependencies": {
"atom-package-deps": "^4.6.0",
"download": "^6.2.5",
"@pivotal-tools/atom-languageclient-commons": "0.0.2"
},
"configSchema": {
"bosh": {
"type": "object",
@@ -50,11 +47,22 @@
}
}
},
"dependencies": {
"atom-package-deps": "^4.6.0",
"download": "^6.2.5",
"@pivotal-tools/atom-languageclient-commons": "0.0.4"
},
"devDependencies": {
"typescript": "^2.7.2",
"tslint": "^5.9.1",
"coffeelint": "^1.10.1"
},
"scripts": {
"clean": "rm -fr node_modules",
"clean": "rm -fr build",
"compile": "tsc",
"build": "npm run clean && npm run compile ",
"watch": "tsc -watch",
"lint": "tslint -c tslint.json 'lib/**/*.ts'",
"postinstall": "node script.js"
},
"package-deps": [

View File

@@ -1,3 +1,3 @@
{
"jarUrl": "https://s3-us-west-1.amazonaws.com/s3-test.spring.io/sts4/fatjars/snapshots/bosh-language-server-0.0.10-201711061741.jar"
"jarUrl": "https://s3-us-west-1.amazonaws.com/s3-test.spring.io/sts4/fatjars/snapshots/bosh-language-server-0.1.5-201803080105.jar"
}

View File

@@ -0,0 +1,17 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "build",
"lib": ["es7", "dom"],
"declaration": true,
"inlineSources": true,
"inlineSourceMap": true,
"strictNullChecks": true,
"noImplicitAny": true,
"baseUrl": "./"
},
"include": [
"lib/**/*.ts"
]
}

View File

@@ -0,0 +1,31 @@
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"quotemark": false,
"object-literal-sort-keys": false,
"ordered-imports": false,
"member-ordering": false,
"one-line": false,
"interface-name": false,
"variable-name": false,
"max-classes-per-file": false,
"no-unused-expression": false,
"no-empty": false,
"one-variable-per-declaration": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type",
"check-typecast",
"check-module"
]
},
"rulesDirectory": []
}

View File

@@ -1,6 +1,7 @@
/.idea
/node_modules
/server
/build
*.tgz
*.iml
*.log

View File

@@ -0,0 +1,3 @@
import {ManifestYamlLanguageClient} from './manifest-yaml-language-client';
module.exports = new ManifestYamlLanguageClient();

View File

@@ -1,13 +1,12 @@
const path = require('path');
const { JavaProcessLanguageClient } = require('@pivotal-tools/atom-languageclient-commons');
const PROPERTIES = require('../properties.json');
import * as path from 'path';
import { JavaProcessLanguageClient } from '@pivotal-tools/atom-languageclient-commons';
import {JVM} from '@pivotal-tools/jvm-launch-utils';
class ManifestYamlLanguageClient extends JavaProcessLanguageClient {
export class ManifestYamlLanguageClient extends JavaProcessLanguageClient {
constructor() {
//noinspection JSAnnotator
super(
PROPERTIES.jarUrl,
path.join(__dirname, '..', 'server'),
'cf-manifest-language-server.jar'
);
@@ -33,7 +32,7 @@ class ManifestYamlLanguageClient extends JavaProcessLanguageClient {
super.activate();
}
launchVmArgs(version) {
launchVmArgs(jvm: JVM) {
return Promise.resolve([
'-Dorg.slf4j.simpleLogger.logFile=manifest-yaml.log',
'-Dorg.slf4j.simpleLogger.defaultLogLevel=debug',
@@ -41,6 +40,4 @@ class ManifestYamlLanguageClient extends JavaProcessLanguageClient {
}
}
module.exports = new ManifestYamlLanguageClient();
}

View File

@@ -1,31 +1,39 @@
{
"name": "cf-manifest-yaml",
"main": "./lib/main",
"version": "0.1.5",
"version": "0.1.6",
"description": "Cloud Foundry Deployment Manifest YAML support for Atom",
"repository": "https://github.com/spring-projects/atom-cf-manifest-yaml",
"icon": "icon.png",
"license": "MIT",
"engines": {
"atom": ">=1.21.0"
"atom": ">=1.24.0"
},
"main": "./build/main",
"types": "./build/main.d.ts",
"files": [
"grammars/",
"settings/",
"lib/",
"build/",
"server/",
"properties.json"
],
"dependencies": {
"atom-package-deps": "^4.6.0",
"download": "^6.2.5",
"@pivotal-tools/atom-languageclient-commons": "0.0.2"
"@pivotal-tools/atom-languageclient-commons": "0.0.4"
},
"devDependencies": {
"typescript": "^2.7.2",
"tslint": "^5.9.1",
"coffeelint": "^1.10.1"
},
"scripts": {
"clean": "rm -fr node_modules",
"clean": "rm -fr build",
"compile": "tsc",
"build": "npm run clean && npm run compile ",
"watch": "tsc -watch",
"lint": "tslint -c tslint.json 'lib/**/*.ts'",
"postinstall": "node script.js"
},
"package-deps": [

View File

@@ -1,3 +1,3 @@
{
"jarUrl": "https://s3-us-west-1.amazonaws.com/s3-test.spring.io/sts4/fatjars/snapshots/manifest-yaml-language-server-0.0.10-201711061741.jar"
"jarUrl": "https://s3-us-west-1.amazonaws.com/s3-test.spring.io/sts4/fatjars/snapshots/manifest-yaml-language-server-0.1.5-201803080105.jar"
}

View File

@@ -0,0 +1,17 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "build",
"lib": ["es7", "dom"],
"declaration": true,
"inlineSources": true,
"inlineSourceMap": true,
"strictNullChecks": true,
"noImplicitAny": true,
"baseUrl": "./"
},
"include": [
"lib/**/*.ts"
]
}

View File

@@ -0,0 +1,31 @@
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"quotemark": false,
"object-literal-sort-keys": false,
"ordered-imports": false,
"member-ordering": false,
"one-line": false,
"interface-name": false,
"variable-name": false,
"max-classes-per-file": false,
"no-unused-expression": false,
"no-empty": false,
"one-variable-per-declaration": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type",
"check-typecast",
"check-module"
]
},
"rulesDirectory": []
}

View File

@@ -1,15 +0,0 @@
{
"sourceMap": "inline",
"plugins": [
["add-module-exports", {}],
["transform-async-to-generator", {}],
["transform-decorators-legacy", {}],
["transform-class-properties", {}],
["transform-es2015-modules-commonjs", {"strictMode": false}],
["transform-export-extensions", {}],
["transform-do-expressions", {}],
["transform-function-bind", {}],
["transform-object-rest-spread", {}],
["transform-flow-strip-types", {}],
]
}

View File

@@ -1,4 +0,0 @@
import { JavaProcessLanguageClient } from './java-process-language-client';
import { StsAdapter } from './sts-adapter';
export { JavaProcessLanguageClient, StsAdapter };

View File

@@ -1,217 +0,0 @@
const cp = require('child_process');
const fs = require('fs');
const path = require('path');
const url = require('url');
const remote = require('remote-file-size');
const PortFinder = require('portfinder');
const net = require('net');
const rpc = require('vscode-jsonrpc');
const {AutoLanguageClient, DownloadFile} = require('atom-languageclient');
const { Disposable } = require('atom');
import { StsAdapter } from './sts-adapter';
import {findJdk, findJvm} from '@pivotal-tools/jvm-launch-utils';
export class JavaProcessLanguageClient extends AutoLanguageClient {
DEBUG = false;
constructor(serverDownloadUrl, serverHome, serverLauncherJar) {
super();
this.serverHome = serverHome;
this.serverDownloadUrl = serverDownloadUrl;
this.serverLauncherJar = serverLauncherJar;
}
getServerJar() {
return path.resolve(this.serverHome, this.serverLauncherJar);
}
showErrorMessage(detail, desc) {
const notification = atom.notifications.addError('Cannot start Language Server', {
dismissable: true,
detail: detail,
description: desc,
buttons: [{
text: 'OK',
onDidClick: () => {
notification.dismiss()
},
}]
});
return Promise.reject(new Error(detail));
}
getInitializeParams(projectPath, process) {
const initParams = super.getInitializeParams(projectPath, process);
initParams.capabilities = {
workspace: {
executeCommand: {
}
}
};
return initParams;
}
startServerProcess () {
// //TODO: Remove when debugging is over
atom.config.set('core.debugLSP', true);
let childProcess;
if (this.DEBUG) {
return this.connectToLS();
}
return new Promise((resolve, reject) => {
let basePort = Math.floor(Math.random() * 10000) + 40000;
PortFinder.getPort({port: basePort}, (err, port) => {
this.server = net.createServer(socket => {
this.socket = socket;
resolve(childProcess);
});
this.server.listen(port, 'localhost', () => {
this.launchProcess(port).then(p => childProcess = p);
});
});
});
}
connectToLS() {
return new Promise(resolve => {
this.socket = net.connect({
port: 5007
});
resolve({
pid: -1,
kill: function() {
console.log('fake shutdown');
}
})
});
}
// Start adapters that are not shared between servers
startExclusiveAdapters(server) {
super.startExclusiveAdapters(server);
const stsAdapter = this.createStsAdapter() || new StsAdapter();
server.connection._onRequest({method: 'sts/moveCursor'}, params => stsAdapter.onMoveCursor(params));
server.connection._onNotification({method: 'sts/progress'}, params => stsAdapter.onProgress(params));
server.connection._onNotification({method: 'sts/highlight'}, params => stsAdapter.onHighlight(params));
}
preferJdk() {
return false;
}
findJvm() {
return this.preferJdk() ? findJdk() : findJvm();
}
launchProcess(port) {
return this.findJvm()
.catch(error => {
return this.showErrorMessage("Error trying to find JVM", ""+error);
})
.then(jvm => {
if (!jvm) {
return this.showErrorMessage("Couldn't locate java in $JAVA_HOME or $PATH");
}
let version = jvm.getMajorVersion();
if (version<8) {
return this.showErrorMessage(
'No compatible Java Runtime Environment found',
'The Java Runtime Environment is either below version "1.8" or is missing from the system'
);
}
return this.launchVmArgs(jvm).then(args => {
args.push(`-Dserver.port=${port}`);
return this.doLaunchProcess(
jvm,
this.getServerJar(),
port,
args
);
});
});
}
launchVmArgs(jvm) {
return Promise.resolve([]);
}
doLaunchProcess(jvm, launcher, port, args=[]) {
let vmArgs = args.concat([
// Atom doesn't have lazy completion proposals support - completionItem/resolve message. Disable lazy completions
'-Dlsp.lazy.completions.disable=true',
'-Dlsp.completions.indentation.enable=true',
'-Dlsp.yaml.completions.errors.disable=true',
]);
this.logger.debug(`starting "${jvm.getJavaExecutable()} ${vmArgs.join('\n')}\n-jar ${launcher}"`);
return jvm.jarLaunch(launcher, vmArgs, { cwd: this.serverHome });
}
installServer () {
const localFileName = this.getServerJar();
this.logger.log(`Downloading ${this.serverDownloadUrl} to ${localFileName}`);
return this.fileExists(this.serverHome)
.then(doesExist => { if (!doesExist) fs.mkdir(this.serverHome) })
.then(() => this.remoteFileSize(this.serverDownloadUrl))
.then((size) => DownloadFile(this.serverDownloadUrl, localFileName, (bytesDone, percent) => this.handleDownlaodPercentChange(bytesDone, size, percent), size))
.then(() => this.fileExists(this.getServerJar()))
.then(doesExist => { if (!doesExist) throw Error(`Failed to install the ${this.getServerName()} language server`) })
.then(() => this.handleServerInstalled())
.then(() => Promise.resolve(true));
}
handleDownlaodPercentChange(bytesDone, size, percent) {
}
handleServerInstalled() {
}
preInitialization(connection) {
connection.onCustom('language/status', (e) => this.updateStatusBar(`${e.type.replace(/^Started$/, '')} ${e.message}`));
}
remoteFileSize(url) {
return new Promise((resolve, reject) => {
remote(url, (e,s) => {
if (e) {
reject(e);
} else {
resolve(s);
}
});
});
}
fileExists (path) {
return new Promise((resolve, reject) => {
fs.access(path, fs.R_OK, error => {
resolve(!error || error.code !== 'ENOENT');
})
})
}
// Late wire-up of listeners after initialize method has been sent
postInitialization(server) {
server.disposable.add(new Disposable(() => {
if (this.server) {
this.server.close()
}
}));
}
createStsAdapter() {
}
}

View File

@@ -0,0 +1,163 @@
import * as path from 'path';
import {getPort} from 'portfinder';
import {Server, createServer, connect} from 'net';
import {AtomEnvironment, Disposable} from 'atom';
import {HighlightParams, ProgressParams, CursorMovementParams, StsAdapter} from './sts-adapter';
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';
export class JavaProcessLanguageClient extends AutoLanguageClient {
DEBUG = false;
private server: Server;
constructor(protected serverHome: string, protected serverLauncherJar: string) {
super();
}
getServerJar(): string {
return path.resolve(this.serverHome, this.serverLauncherJar);
}
showErrorMessage(detail: string, desc?: string): Promise<any> {
const atomEnv: AtomEnvironment = atom;
const notification = atomEnv.notifications.addError('Cannot start Language Server', {
dismissable: true,
detail: detail,
description: desc,
buttons: [{
text: 'OK',
onDidClick: () => {
notification.dismiss()
},
}]
});
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);
}
protected startServerProcess(projectPath: string): LanguageServerProcess | Promise<LanguageServerProcess> {
// TODO: Remove when debugging is over
const atomEnv: AtomEnvironment = atom;
atomEnv.config.set('core.debugLSP', true);
let childProcess: LanguageServerProcess;
if (this.DEBUG) {
return this.connectToLS();
}
return new Promise((resolve, reject) => {
let basePort = Math.floor(Math.random() * 10000) + 40000;
getPort({port: basePort}, (err, port) => {
this.server = createServer(socket => {
this.socket = socket;
resolve(childProcess);
});
this.server.listen(port, 'localhost', () => {
this.launchProcess(port).then(p => childProcess = p);
});
});
});
}
private connectToLS(): LanguageServerProcess | Promise<LanguageServerProcess> {
return new Promise(resolve => {
this.socket = connect({
port: 5007
});
resolve(<LanguageServerProcess> {
pid: -1,
kill: () => {
console.log('fake shutdown');
}
})
});
}
// Start adapters that are not shared between servers
protected postInitialization(server: ActiveServer): void {
const stsAdapter = this.createStsAdapter() || new StsAdapter();
(<any>server.connection)._onRequest({method: 'sts/moveCursor'}, (params: CursorMovementParams) => stsAdapter.onMoveCursor(params));
server.connection.onCustom('sts/progress', (params: ProgressParams) => stsAdapter.onProgress(params));
server.connection.onCustom('sts/highlight', (params: HighlightParams) => stsAdapter.onHighlight(params));
server.disposable.add(new Disposable(() => {
if (this.server) {
this.server.close()
}
}));
}
preferJdk(): boolean {
return false;
}
findJvm(): Promise<JVM | null> {
return this.preferJdk() ? findJdk() : findJvm();
}
private launchProcess(port: number): Promise<LanguageServerProcess> {
return this.findJvm()
.catch(error => {
return this.showErrorMessage("Error trying to find JVM", ""+error);
})
.then(jvm => {
if (!jvm) {
return this.showErrorMessage("Couldn't locate java in $JAVA_HOME or $PATH");
}
let version = jvm.getMajorVersion();
if (version<8) {
return this.showErrorMessage(
'No compatible Java Runtime Environment found',
'The Java Runtime Environment is either below version "1.8" or is missing from the system'
);
}
return this.launchVmArgs(jvm).then(args => {
args.push(`-Dserver.port=${port}`);
return this.doLaunchProcess(
jvm,
this.getServerJar(),
args
);
});
});
}
protected launchVmArgs(jvm: JVM): Promise<string[]> {
return Promise.resolve([]);
}
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',
'-Dlsp.yaml.completions.errors.disable=true',
]);
this.logger.debug(`starting "${jvm.getJavaExecutable()} ${vmArgs.join('\n')}\n-jar ${launcher}"`);
return jvm.jarLaunch(launcher, vmArgs, { cwd: this.serverHome });
}
createStsAdapter(): StsAdapter | null {
return null;
}
}

View File

@@ -0,0 +1,10 @@
import {JavaProcessLanguageClient} from './java-process-language-client';
import {StsAdapter, CursorMovementParams, HighlightParams, ProgressParams} from './sts-adapter';
export {
JavaProcessLanguageClient,
StsAdapter,
CursorMovementParams,
HighlightParams,
ProgressParams
}

View File

@@ -1,20 +0,0 @@
import {Convert} from 'atom-languageclient';
export class StsAdapter {
constructor() {}
findEditors(uri) {
return atom.workspace.getTextEditors()
.filter(e => e && e.getPath() && Convert.pathToUri(e.getPath()) === uri);
}
onMoveCursor(params) {
findEditors(params.uri).forEach(e => e.setCursorScreenPosition(Convert.positionToPoint(params.position)));
return { applied: true};
}
onProgress(params) {}
onHighlight(params) {}
}

View File

@@ -0,0 +1,38 @@
import {Convert} from 'atom-languageclient';
import {AtomEnvironment, TextEditor} from 'atom';
import {Position, Range, TextDocumentIdentifier} from 'vscode-languageserver-protocol';
export class StsAdapter {
constructor() {}
findEditors(uri: string): TextEditor[] {
const atomEnv: AtomEnvironment = atom;
return atomEnv.workspace.getTextEditors()
.filter(e => e && e.getPath() && Convert.pathToUri(e.getPath() || '') === uri);
}
onMoveCursor(params: CursorMovementParams): any {
this.findEditors(params.uri).forEach(e => e.setCursorScreenPosition(Convert.positionToPoint(params.position)));
return {applied: true};
}
onProgress(params: ProgressParams): void {}
onHighlight(params: HighlightParams): void {}
}
export interface CursorMovementParams {
readonly uri: string;
readonly position: Position;
}
export interface ProgressParams {
readonly id: string;
readonly statusMsg: string;
}
export interface HighlightParams {
readonly doc: TextDocumentIdentifier;
readonly ranges: Range[];
}

View File

@@ -1,56 +1,35 @@
{
"name": "@pivotal-tools/atom-languageclient-commons",
"version": "0.0.2",
"version": "0.0.4",
"description": "Atom language client commons for STS4 language servers",
"repository": "https://github.com/spring-projects/sts4",
"license": "MIT",
"engines": {
"atom": ">=1.17.0"
"atom": ">=1.24.0"
},
"dependencies": {
"@pivotal-tools/jvm-launch-utils": "0.0.11",
"atom-languageclient": "0.8.0",
"decompress": "^4.2.0",
"portfinder": "^1.0.13",
"postinstall-build": "5.0.1",
"remote-file-size": "^3.0.3"
},
"main": "./build/lib/index",
"main": "./build/main",
"types": "./build/main.d.ts",
"files": [
"build/"
"build/",
"lib/"
],
"scripts": {
"clean": "rm -rf build",
"compile": "babel lib --out-dir build/lib",
"postinstall": "postinstall-build --only-as-dependency build \"npm run compile\"",
"prepublish": "npm run clean && npm run compile",
"watch": "babel lib --out-dir build/lib -w"
"compile": "tsc",
"watch": "tsc -watch",
"lint": "tslint -c tslint.json 'lib/**/*.ts'",
"prepublish": "npm run clean && npm run compile"
},
"dependencies": {
"@pivotal-tools/jvm-launch-utils": "0.0.11",
"atom-languageclient": "0.9.2",
"portfinder": "^1.0.13",
"@types/atom": "^1.24.1",
"@types/node": "^8.0.41",
"vscode-languageserver-protocol": "3.6.0-next.5"
},
"atomTranspilers": [
{
"glob": "{lib}/**/*.js",
"transpiler": "atom-babel6-transpiler",
"options": {
"cacheKeyFiles": [
"package.json",
".babelrc"
]
}
}
],
"devDependencies": {
"atom-babel6-transpiler": "0.0.3",
"babel-cli": "^6.24.0",
"babel-core": "6.22.1",
"babel-plugin-add-module-exports": "0.2.1",
"babel-plugin-transform-async-to-generator": "6.22.0",
"babel-plugin-transform-class-properties": "6.23.0",
"babel-plugin-transform-decorators-legacy": "1.3.4",
"babel-plugin-transform-do-expressions": "6.22.0",
"babel-plugin-transform-es2015-modules-commonjs": "6.23.0",
"babel-plugin-transform-export-extensions": "6.22.0",
"babel-plugin-transform-flow-strip-types": "6.22.0",
"babel-plugin-transform-function-bind": "6.22.0",
"babel-plugin-transform-object-rest-spread": "6.23.0"
"tslint": "^5.9.1",
"typescript": "^2.7.2"
}
}

View File

@@ -0,0 +1,17 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "build",
"lib": ["es7", "dom"],
"declaration": true,
"inlineSources": true,
"inlineSourceMap": true,
"strictNullChecks": true,
"noImplicitAny": true,
"baseUrl": "./"
},
"include": [
"lib/**/*.ts",
]
}

View File

@@ -0,0 +1,31 @@
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"quotemark": false,
"object-literal-sort-keys": false,
"ordered-imports": false,
"member-ordering": false,
"one-line": false,
"interface-name": false,
"variable-name": false,
"max-classes-per-file": false,
"no-unused-expression": false,
"no-empty": false,
"one-variable-per-declaration": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type",
"check-typecast",
"check-module"
]
},
"rulesDirectory": []
}

View File

@@ -1,6 +1,7 @@
/.idea
/node_modules
/server
/build
*.tgz
*iml
*.log

View File

@@ -2,7 +2,7 @@
[![macOS Build Status](https://travis-ci.org/spring-projects/atom-concourse.svg?branch=master)](https://travis-ci.org/spring-projects/atom-concourse) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/1jvknxt9jhykgrxo?svg=true)](https://ci.appveyor.com/project/spring-projects/atom-concourse/branch/master) [![Dependency Status](https://david-dm.org/spring-projects/atom-concourse.svg)](https://david-dm.org/spring-projects/atom-concourse)
This extension provides basic validation, content assist and hover infos
for editing Concourse [Pipeline](https://concourse.ci/pipelines.html) and [Task Configuration](https://concourse.ci/running-tasks.html) Files.
for editing Concourse [Pipeline](https://concourse-ci.org/pipelines.html) and [Task Configuration](https://concourse-ci.org/running-tasks.html) Files.
It is recommended to use this extension package when `atom-ide-ui` atom extension package is installed. Thus, reconciling (error/warning markers) and hover support is fully functional.

View File

@@ -1,13 +1,12 @@
const path = require('path');
const { JavaProcessLanguageClient } = require('@pivotal-tools/atom-languageclient-commons');
const PROPERTIES = require('../properties.json');
import * as path from 'path';
import { JavaProcessLanguageClient } from '@pivotal-tools/atom-languageclient-commons';
import {JVM} from '@pivotal-tools/jvm-launch-utils';
class ConcourseCiYamlClient extends JavaProcessLanguageClient {
export class ConcourseCiYamlClient extends JavaProcessLanguageClient {
constructor() {
//noinspection JSAnnotator
super(
PROPERTIES.jarUrl,
path.join(__dirname, '..', 'server'),
'concourse-language-server.jar'
);
@@ -33,7 +32,7 @@ class ConcourseCiYamlClient extends JavaProcessLanguageClient {
super.activate();
}
launchVmArgs(jvm) {
launchVmArgs(jvm: JVM) {
return Promise.resolve([
'-Dorg.slf4j.simpleLogger.logFile=concourse-ci-yaml.log',
'-Dorg.slf4j.simpleLogger.defaultLogLevel=debug',
@@ -41,6 +40,4 @@ class ConcourseCiYamlClient extends JavaProcessLanguageClient {
}
}
module.exports = new ConcourseCiYamlClient();
}

View File

@@ -0,0 +1,3 @@
import {ConcourseCiYamlClient} from './concourse-ci-yaml-client';
module.exports = new ConcourseCiYamlClient();

View File

@@ -1,17 +1,19 @@
{
"name": "concourse-pipeline-yaml",
"main": "./lib/main",
"version": "0.1.5",
"version": "0.1.6",
"description": "Provides validation and content assist for Concourse CI pipeline and task configuration yml files",
"repository": "https://github.com/spring-projects/atom-concourse",
"icon": "icon.png",
"license": "MIT",
"engines": {
"atom": ">=1.21.0"
"atom": ">=1.24.0"
},
"main": "./build/main",
"types": "./build/main.d.ts",
"files": [
"grammars/",
"settings/",
"build/",
"lib/",
"server/",
"properties.json"
@@ -19,13 +21,19 @@
"dependencies": {
"atom-package-deps": "^4.6.0",
"download": "^6.2.5",
"@pivotal-tools/atom-languageclient-commons": "0.0.2"
"@pivotal-tools/atom-languageclient-commons": "0.0.4"
},
"devDependencies": {
"typescript": "^2.7.2",
"tslint": "^5.9.1",
"coffeelint": "^1.10.1"
},
"scripts": {
"clean": "rm -fr node_modules",
"clean": "rm -fr build",
"compile": "tsc",
"build": "npm run clean && npm run compile ",
"watch": "tsc -watch",
"lint": "tslint -c tslint.json 'lib/**/*.ts'",
"postinstall": "node script.js"
},
"package-deps": [

View File

@@ -0,0 +1,17 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "build",
"lib": ["es7", "dom"],
"declaration": true,
"inlineSources": true,
"inlineSourceMap": true,
"strictNullChecks": true,
"noImplicitAny": true,
"baseUrl": "./"
},
"include": [
"lib/**/*.ts"
]
}

View File

@@ -0,0 +1,31 @@
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"quotemark": false,
"object-literal-sort-keys": false,
"ordered-imports": false,
"member-ordering": false,
"one-line": false,
"interface-name": false,
"variable-name": false,
"max-classes-per-file": false,
"no-unused-expression": false,
"no-empty": false,
"one-variable-per-declaration": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type",
"check-typecast",
"check-module"
]
},
"rulesDirectory": []
}

View File

@@ -1,3 +1,4 @@
.idea/
server/
node_modules/
build/

View File

@@ -0,0 +1,56 @@
import {StsAdapter, HighlightParams} from '@pivotal-tools/atom-languageclient-commons';
import {Convert} from 'atom-languageclient';
import { Range } from 'vscode-languageserver-protocol';
import {TextEditor} from 'atom';
const BOOT_DATA_MARKER_TYPE: any = 'BootApp-Hint';
const BOOT_HINT_GUTTER_NAME = 'boot-hint-gutter';
export class BootStsAdapter extends StsAdapter {
constructor() {
super();
}
onHighlight(params: HighlightParams) {
this.findEditors(params.doc.uri).forEach(editor => this.markHintsForEditor(editor, params.ranges));
}
private markHintsForEditor(editor: TextEditor, ranges: Range[]) {
editor.findMarkers(BOOT_DATA_MARKER_TYPE).forEach(m => m.destroy());
if (Array.isArray(ranges)) {
ranges.forEach(range => this.createHintMarker(editor, range));
}
const gutter = editor.gutterWithName(BOOT_HINT_GUTTER_NAME);
if (gutter) {
if (!ranges || !ranges.length) {
gutter.hide();
} else if (!gutter.isVisible()) {
gutter.show();
}
}
}
private createHintMarker(editor: TextEditor, range: Range) {
// Create marker model
const marker = editor.markBufferRange(Convert.lsRangeToAtomRange(range), BOOT_DATA_MARKER_TYPE);
// Marker around the text in the editor
editor.decorateMarker(marker, {
type: 'highlight',
class: 'boot-hint'
});
// Marker in the diagnostic gutter
let gutter = editor.gutterWithName(BOOT_HINT_GUTTER_NAME);
if (!gutter) {
gutter = editor.addGutter({
name: BOOT_HINT_GUTTER_NAME,
visible: false,
});
}
const iconElement = document.createElement('span');
iconElement.setAttribute('class', 'gutter-boot-hint');
gutter.decorateMarker(marker, {item: iconElement});
}
}

View File

@@ -1,128 +0,0 @@
const path = require('path');
const { JavaProcessLanguageClient, StsAdapter } = require('@pivotal-tools/atom-languageclient-commons');
const { Convert } = require('atom-languageclient');
const PROPERTIES = require('../properties.json');
const BOOT_DATA_MARKER_TYPE = 'BootApp-Hint';
const BOOT_HINT_GUTTER_NAME = 'boot-hint-gutter';
class SpringBootLanguageClient extends JavaProcessLanguageClient {
constructor() {
//noinspection JSAnnotator
super(
PROPERTIES.jarUrl,
path.join(__dirname, '..', 'server'),
'spring-boot-language-server.jar'
);
// this.DEBUG = true;
}
postInitialization(server) {
this.sendConfig(server);
this._disposable.add(atom.config.observe('boot-java', () => this.sendConfig(server)));
}
sendConfig(server) {
server.connection.didChangeConfiguration({ settings: {'boot-java': atom.config.get('boot-java') }});
}
getGrammarScopes() {
return ['source.java', 'source.boot-properties', 'source.boot-properties-yaml'];
}
getLanguageName() {
return 'spring-boot';
}
getServerName() {
return 'Spring Boot';
}
activate() {
require('atom-package-deps')
.install('spring-boot')
.then(() => console.debug('All dependencies installed, good to go'));
super.activate();
}
preferJdk() {
return true;
}
launchVmArgs(jvm) {
let vmargs = [
// '-Xdebug',
// '-agentlib:jdwp=transport=dt_socket,server=y,address=7999,suspend=n',
'-Dorg.slf4j.simpleLogger.logFile=boot-java.log',
'-Dorg.slf4j.simpleLogger.defaultLogLevel=debug',
];
if (!jvm.isJdk()) {
this.showErrorMessage(
'"Boot-Java" Package Functionality Limited',
'JAVA_HOME or PATH environment variable seems to point to a JRE. A JDK is required, hence Boot Hints are unavailable.'
);
}
return Promise.resolve(vmargs);
}
createStsAdapter() {
return new BootStsAdapter();
}
filterChangeWatchedFiles(filePath) {
return filePath.endsWith('.gradle') || filePath.endsWith(path.join('', 'pom.xml'));
}
}
class BootStsAdapter extends StsAdapter {
constructor() {
super();
}
onHighlight(params) {
this.findEditors(params.doc.uri).forEach(editor => this.markHintsForEditor(editor, params.ranges));
}
markHintsForEditor(editor, ranges) {
editor.findMarkers(BOOT_DATA_MARKER_TYPE).forEach(m => m.destroy());
if (Array.isArray(ranges)) {
ranges.forEach(range => this.createHintMarker(editor, range));
}
const gutter = editor.gutterWithName(BOOT_HINT_GUTTER_NAME);
if (gutter) {
if (!ranges || !ranges.length) {
gutter.hide();
} else if (!gutter.isVisible()) {
gutter.show();
}
}
}
createHintMarker(editor, range) {
// Create marker model
const marker = editor.markBufferRange(Convert.lsRangeToAtomRange(range), BOOT_DATA_MARKER_TYPE);
// Marker around the text in the editor
editor.decorateMarker(marker, {
type: 'highlight',
class: 'boot-hint'
});
// Marker in the diagnostic gutter
let gutter = editor.gutterWithName(BOOT_HINT_GUTTER_NAME);
if (!gutter) {
gutter = editor.addGutter({
name: BOOT_HINT_GUTTER_NAME,
visible: false,
});
}
const iconElement = document.createElement('span');
iconElement.setAttribute('class', 'gutter-boot-hint');
gutter.decorateMarker(marker, {item: iconElement});
}
}
module.exports = new SpringBootLanguageClient();

View File

@@ -0,0 +1,3 @@
import {SpringBootLanguageClient} from './spring-boot-language-client';
module.exports = new SpringBootLanguageClient();

View File

@@ -0,0 +1,75 @@
import * as path from 'path';
import {JavaProcessLanguageClient} from '@pivotal-tools/atom-languageclient-commons';
import {BootStsAdapter} from './boot-sts-adapter';
import {ActiveServer} from 'atom-languageclient';
import {JVM} from '@pivotal-tools/jvm-launch-utils';
export class SpringBootLanguageClient extends JavaProcessLanguageClient {
constructor() {
//noinspection JSAnnotator
super(
path.join(__dirname, '..', 'server'),
'spring-boot-language-server.jar'
);
// this.DEBUG = true;
}
protected postInitialization(server: ActiveServer) {
super.postInitialization(server);
this.sendConfig(server);
(<any>this)._disposable.add(atom.config.observe('boot-java', () => this.sendConfig(server)));
}
private sendConfig(server: ActiveServer) {
server.connection.didChangeConfiguration({ settings: {'boot-java': atom.config.get('boot-java') }});
}
getGrammarScopes() {
return ['source.java', 'source.boot-properties', 'source.boot-properties-yaml'];
}
getLanguageName() {
return 'spring-boot';
}
getServerName() {
return 'Spring Boot';
}
activate() {
require('atom-package-deps')
.install('spring-boot')
.then(() => console.debug('All dependencies installed, good to go'));
super.activate();
}
preferJdk() {
return true;
}
launchVmArgs(jvm: JVM) {
let vmargs = [
// '-Xdebug',
// '-agentlib:jdwp=transport=dt_socket,server=y,address=7999,suspend=n',
'-Dorg.slf4j.simpleLogger.logFile=boot-java.log',
'-Dorg.slf4j.simpleLogger.defaultLogLevel=debug',
];
if (!jvm.isJdk()) {
this.showErrorMessage(
'"Boot-Java" Package Functionality Limited',
'JAVA_HOME or PATH environment variable seems to point to a JRE. A JDK is required, hence Boot Hints are unavailable.'
);
}
return Promise.resolve(vmargs);
}
createStsAdapter() {
return new BootStsAdapter();
}
filterChangeWatchedFiles(filePath: string) {
return filePath.endsWith('.gradle') || filePath.endsWith(path.join('', 'pom.xml'));
}
}

View File

@@ -1,17 +1,19 @@
{
"name": "spring-boot",
"main": "./lib/main",
"version": "0.1.5",
"version": "0.1.6",
"description": "Spring Boot support for Atom",
"repository": "https://github.com/spring-projects/atom-spring-boot",
"icon": "icon.png",
"license": "MIT",
"engines": {
"atom": ">=1.21.0"
"atom": ">=1.24.0"
},
"main": "./build/main",
"types": "./build/main.d.ts",
"files": [
"grammars/",
"settings/",
"build/",
"lib/",
"server/",
"styles/",
@@ -25,16 +27,21 @@
}
},
"dependencies": {
"@pivotal-tools/atom-languageclient-commons": "0.0.2",
"atom-languageclient": "0.8.0",
"@pivotal-tools/atom-languageclient-commons": "0.0.4",
"atom-package-deps": "^4.6.0",
"download": "^6.2.5"
},
"devDependencies": {
"typescript": "^2.7.2",
"tslint": "^5.9.1",
"coffeelint": "^1.10.1"
},
"scripts": {
"clean": "rm -fr node_modules",
"clean": "rm -rf build",
"compile": "tsc",
"build": "npm run clean && npm run compile ",
"watch": "tsc -watch",
"lint": "tslint -c tslint.json 'lib/**/*.ts'",
"postinstall": "node script.js"
},
"package-deps": [

View File

@@ -1,3 +1,3 @@
{
"jarUrl": "https://s3-us-west-1.amazonaws.com/s3-test.spring.io/sts4/fatjars/snapshots/spring-boot-language-server-0.1.5-201803022113.jar"
"jarUrl": "https://s3-us-west-1.amazonaws.com/s3-test.spring.io/sts4/fatjars/snapshots/spring-boot-language-server-0.1.5-201803051440.jar"
}

View File

@@ -0,0 +1,17 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "build",
"lib": ["es7", "dom"],
"declaration": true,
"inlineSources": true,
"inlineSourceMap": true,
"strictNullChecks": true,
"noImplicitAny": true,
"baseUrl": "./"
},
"include": [
"lib/**/*.ts"
]
}

View File

@@ -0,0 +1,31 @@
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"quotemark": false,
"object-literal-sort-keys": false,
"ordered-imports": false,
"member-ordering": false,
"one-line": false,
"interface-name": false,
"variable-name": false,
"max-classes-per-file": false,
"no-unused-expression": false,
"no-empty": false,
"one-variable-per-declaration": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type",
"check-typecast",
"check-module"
]
},
"rulesDirectory": []
}

View File

@@ -494,6 +494,67 @@ jobs:
params:
repository: out/repo
rebase: true
- name: tag-atom-release
plan:
- aggregate:
- get: sts4
- get: atom-bosh
passed:
- prepare-bosh-atom-rc
- get: atom-concourse
passed:
- prepare-concourse-atom-rc
- get: atom-spring-boot
passed:
- prepare-spring-boot-atom-rc
- get: atom-cf-manifest-yaml
passed:
- prepare-manifest-yaml-atom-rc
- task: tag-atom-releases
file: sts4/concourse/tasks/tag-atom-releases.yml
- aggregate:
- put: atom-bosh
params:
repository: out/atom-bosh
only_tag: true
- put: atom-concourse
params:
repository: out/atom-concourse
only_tag: true
- put: atom-spring-boot
params:
repository: out/atom-spring-boot
only_tag: true
- put: atom-cf-manifest-yaml
params:
repository: out/atom-cf-manifest-yaml
only_tag: true
- name: publish-atom-releases
serial: true
plan:
- aggregate:
- get: sts4
- get: atom-concourse
trigger: true
passed:
- tag-atom-release
- task: publish-atom-releases
file: sts4/concourse/tasks/publish-atom-releases.yml
params:
atom_token: ((atom_token))
on_failure:
put: slack-notification
params:
text: |
Concourse ${BUILD_PIPELINE_NAME}/${BUILD_JOB_NAME}/${BUILD_NAME} has failed!
on_success:
put: slack-notification
params:
channel: "#tools-team-internal"
text: |
STS 4 Atom Extensions released
Releases now available on Atom Marketplace:
• <https://atom.io/packages/concourse-pipeline-yaml|Concourse CI Pipeline Editor>
- name: build-concourse-rc
plan:
- aggregate:
@@ -699,6 +760,52 @@ jobs:
- put: version
params:
file: version/version
- name: publish-concourse-vsix-release
serial: true
plan:
- aggregate:
- get: tasks
- get: sts4
passed:
- build-concourse-rc
- get: version
passed:
- build-concourse-rc
params:
bump: final
- get: s3-concourse-vsix-snapshot
passed:
- build-concourse-rc
- task: publish-release
file: tasks/concourse/tasks/publish-concourse-vsix-release.yml
input_mapping:
sts4: tasks
params:
vsce_token: ((vsce_token))
on_failure:
put: slack-notification
params:
text: |
Concourse ${BUILD_PIPELINE_NAME}/${BUILD_JOB_NAME}/${BUILD_NAME} has failed!
on_success:
put: slack-notification
params:
channel: "#tools-team-internal"
text_file: version/version
text: |
STS 4 VScode Extensions $TEXT_FILE_CONTENT released
Releases now available on Vscode Marketplace:
• <https://marketplace.visualstudio.com/items?itemName=Pivotal.vscode-concourse|Concourse CI Pipeline Editor>
- aggregate:
- put: sts4-out
params:
repository: sts4
only_tag: true
tag: version/version
tag_prefix: V_
- put: version
params:
file: version/version
- name: bump-version-patch
serial: true
plan:
@@ -981,6 +1088,7 @@ groups:
- build-consourse-vsix-snapshot
- build-bosh-vsix-snapshot
- build-spring-boot-vsix-snapshot
- publish-concourse-vsix-release
- name: bump-versions
jobs:
- bump-version-patch
@@ -993,13 +1101,20 @@ groups:
- build-bosh-atom-package
- build-manifest-yaml-atom-package
- build-spring-boot-atom-package
- name: atom-rc
- name: atom-release
jobs:
- atom-language-servers-test
- build-concourse-atom-package
- build-bosh-atom-package
- build-manifest-yaml-atom-package
- build-spring-boot-atom-package
- prepare-bosh-atom-rc
- prepare-concourse-atom-rc
- prepare-manifest-yaml-atom-rc
- prepare-spring-boot-atom-rc
- promote-fatjars-to-rc
- tag-atom-release
- publish-atom-releases
- name: setup
jobs:
- build-mvn-cache

View File

@@ -11,6 +11,7 @@ fatjar_version=`cat fatjar/version`
#cd $atom_commons
#npm install
#npm run build
cd $atom_package
@@ -24,6 +25,8 @@ EOF
npm install
npm run build
# push code to release repository
cd $workdir

View File

@@ -0,0 +1,17 @@
#!/bin/bash
set -e
workdir=`pwd`
atom_packages=`ls -d atom-*`
for atom_package in $atom_packages
do
echo "****************************************************************"
echo "*** Publishing : ${atom_package}"
echo "****************************************************************"
cd $workdir/$atom_package
tag=v$(cat package.json | jq -r ".version")
export ATOM_ACCESS_TOKEN=$atom_token
# apm login --token $atom_token
apm publish --tag $tag
done

View File

@@ -0,0 +1,13 @@
inputs:
- name: sts4
- name: atom-concourse
params:
atom_token: atom_token_must_be_provided!!!
platform: linux
run:
path: sts4/concourse/tasks/publish-atom-releases.sh
image_resource:
type: docker-image
source:
repository: kdvolder/atom-apm

View File

@@ -0,0 +1,11 @@
inputs:
- name: sts4
- name: s3-concourse-vsix-snapshot
platform: linux
run:
path: sts4/concourse/tasks/publish-vsix-releases.sh
image_resource:
type: docker-image
source:
repository: kdvolder/sts4-build-env

View File

@@ -0,0 +1,21 @@
#!/bin/bash
set -e
# set -x
workdir=$(pwd)
out=${workdir}/out
git config --global user.email "kdevolder@pivotal.io"
git config --global user.name "Kris De Volder"
for package in atom-* ; do
echo "Processing ${package}..."
mkdir "${out}/${package}"
cd "${out}"
git clone "${workdir}/${package}/.git"
cd ${package}
tag=v$(cat package.json | jq -r ".version")
echo "Tag: ${tag}"
git tag $tag
done

View File

@@ -0,0 +1,15 @@
platform: linux
image_resource:
type: docker-image
source:
repository: kdvolder/sts4-build-env
inputs:
- name: sts4
- name: atom-bosh
- name: atom-concourse
- name: atom-spring-boot
- name: atom-cf-manifest-yaml
outputs:
- name: out
run:
path: sts4/concourse/tasks/tag-atom-releases.sh

View File

@@ -21,13 +21,31 @@
Instead add them to the available update sites in your Eclipse/STS preferences or paste them into the "Install New Software" dialog.
</p>
<p>
<p><b>STS4 Distribution:</b>
<ul>
<li>for Eclipse Photon (4.8): <a href="http://dist.springsource.com/snapshot/TOOLS/sts4/nightly/e4.8">http://dist.springsource.com/snapshot/TOOLS/sts4/nightly/e4.8</a></li>
<li>for Eclipse Neon (4.7): <a href="http://dist.springsource.com/snapshot/TOOLS/sts4/nightly/e4.7">http://dist.springsource.com/snapshot/TOOLS/sts4/nightly/e4.7</a></li>
</ul>
</p>
<p><b>STS4 language server extensions</b> (this repository is meant to be used to ship updates of the language server extensions to existing STS4 installations. In production, the release version of this repository is used.)
</p>
<p>
<ul>
<li><a href="http://dist.springsource.com/snapshot/TOOLS/sts4-language-server-integrations/nightly">http://dist.springsource.com/snapshot/TOOLS/sts4-language-server-integrations/nightly</a></li>
</ul>
</p>
<p><b>STS3 language server extensions</b> (this repository is used by existing STS3 installations and can be used to update the embedded CF manifest language server that is already used by STS3 independent of general STS3 releases. In production, the release version of this repository is used.)
</p>
<p>
<ul>
<li><a href="http://dist.springsource.com/snapshot/TOOLS/sts4-language-servers/nightly">http://dist.springsource.com/snapshot/TOOLS/sts4-language-servers/nightly</a></li>
</ul>
</p>
<h2>Eclipse-based Distribution Builds</h2>
<h3>Spring Tool Suite 4 - based on Eclipse Photon Milestone Builds (4.8.0 Mx)</h3>

View File

@@ -30,28 +30,21 @@ org.eclipse.core.resources/refresh.lightweight.enabled=true
# Order help books in table of contents
org.eclipse.help/HELP_DATA = helpData.xml
# enable line number ruler in all textual editors by default
org.eclipse.ui.editors/lineNumberRuler=true
# Disable M2Eclipse repository index download
org.eclipse.m2e.core/eclipse.m2.updateIndexes=false
# Disable Atlassian connector data usage tracking
com.atlassian.connector.eclipse.monitor.usage/com.atlassian.connector.eclipse.monitor.usage.enabled=false
com.atlassian.connector.eclipse.monitor.ui/com.atlassian.connector.eclipse.monitor.usage.enabled=false
com.atlassian.connector.eclipse.monitor.ui/com.atlassian.connector.eclipse.monitor.usage.first.time=false
org.eclipse.m2e.core/eclipse.m2.downloadSources=true
# Disable Mylyn service message
org.eclipse.mylyn.tasks.ui/org.eclipse.mylyn.tasks.ui.servicemessage.id=0
# check for updates every Tuesday at 10am
# check for updates
# automatic update options are defined in org.eclipse.equinox.p2.sdk.scheduler.PreferenceConstants
org.eclipse.equinox.p2.ui.sdk.scheduler/enabled=true
org.eclipse.equinox.p2.ui.sdk.scheduler/schedule=on-schedule
org.eclipse.equinox.p2.ui.sdk.scheduler/day=Every Tuesday
org.eclipse.equinox.p2.ui.sdk.scheduler/hour=10\:00 AM
# remind the user every 24 hours
org.eclipse.equinox.p2.ui.sdk.scheduler/remindOnSchedule=true
# see AutomaticUpdatesPopup, values can be "30 minutes", "Hour", "4 Hours"
org.eclipse.equinox.p2.ui.sdk.scheduler/remindElapsedTime=24 Hours
org.eclipse.equinox.p2.ui.sdk.scheduler/schedule=on-fuzzy-schedule
org.eclipse.equinox.p2.ui.sdk.scheduler/fuzzy_recurrence=Once a week
# download updates before notifying the user
org.eclipse.equinox.p2.ui.sdk.scheduler/download=false

View File

@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: Spring Boot Language Server
Bundle-Vendor: Pivotal, Inc.
Bundle-SymbolicName: org.springframework.tooling.boot.ls;singleton:=true
Bundle-Version: 0.1.5.qualifier
Bundle-Version: 0.1.6.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.jdt.launching;bundle-version="3.9.0",
org.eclipse.core.runtime;bundle-version="3.12.0",

View File

@@ -12,14 +12,14 @@
</parent>
<artifactId>org.springframework.tooling.boot.ls</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<dependencies>
<dependency>
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>spring-boot-language-server</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -16,7 +16,7 @@ package org.springframework.tooling.boot.ls;
public class Constants {
public static final String PLUGIN_ID = "org.springframework.tooling.boot.ls";
public static final String LANGUAGE_SERVER_VERSION = "0.1.5-SNAPSHOT.jar";
public static final String LANGUAGE_SERVER_VERSION = "0.1.6-SNAPSHOT.jar";
public static final String PREF_BOOT_HINTS = "boot-java.boot-hints.on";

View File

@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: BOSH Manifest Language Server
Bundle-Vendor: Pivotal, Inc.
Bundle-SymbolicName: org.springframework.tooling.bosh.ls;singleton:=true
Bundle-Version: 0.1.5.qualifier
Bundle-Version: 0.1.6.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.jdt.launching;bundle-version="3.9.0",
org.eclipse.core.runtime;bundle-version="3.12.0",

View File

@@ -12,14 +12,14 @@
</parent>
<artifactId>org.springframework.tooling.bosh.ls</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<dependencies>
<dependency>
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>bosh-language-server</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework.ide.eclipse</groupId>

View File

@@ -16,6 +16,6 @@ package org.springframework.tooling.bosh.ls;
public class Constants {
public static final String PLUGIN_ID = "org.springframework.tooling.bosh.ls";
public static final String LANGUAGE_SERVER_VERSION = "0.1.5-SNAPSHOT";
public static final String LANGUAGE_SERVER_VERSION = "0.1.6-SNAPSHOT";
}

View File

@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: Cloud Foundry Manifest Language Server
Bundle-Vendor: Pivotal, Inc.
Bundle-SymbolicName: org.springframework.tooling.cloudfoundry.manifest.ls;singleton:=true
Bundle-Version: 0.1.5.qualifier
Bundle-Version: 0.1.6.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.jdt.launching;bundle-version="3.8.0",
org.eclipse.core.runtime;bundle-version="3.12.0",

View File

@@ -12,14 +12,14 @@
</parent>
<artifactId>org.springframework.tooling.cloudfoundry.manifest.ls</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<dependencies>
<dependency>
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>manifest-yaml-language-server</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -16,6 +16,6 @@ package org.springframework.tooling.cloudfoundry.manifest.ls;
public class Constants {
public static final String PLUGIN_ID = "org.springframework.tooling.cloudfoundry.manifest.ls";
public static final String LANGUAGE_SERVER_VERSION = "0.1.5-SNAPSHOT.jar";
public static final String LANGUAGE_SERVER_VERSION = "0.1.6-SNAPSHOT.jar";
}

View File

@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: Concourse Pipeline Language Server
Bundle-Vendor: Pivotal, Inc.
Bundle-SymbolicName: org.springframework.tooling.concourse.ls;singleton:=true
Bundle-Version: 0.1.5.qualifier
Bundle-Version: 0.1.6.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.jdt.launching;bundle-version="3.9.0",
org.eclipse.core.runtime;bundle-version="3.12.0",

View File

@@ -12,14 +12,14 @@
</parent>
<artifactId>org.springframework.tooling.concourse.ls</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<dependencies>
<dependency>
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>concourse-language-server</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework.ide.eclipse</groupId>

View File

@@ -16,6 +16,6 @@ package org.springframework.tooling.concourse.ls;
public class Constants {
public static final String PLUGIN_ID = "org.springframework.tooling.concourse.ls";
public static final String LANGUAGE_SERVER_VERSION = "0.1.5-SNAPSHOT";
public static final String LANGUAGE_SERVER_VERSION = "0.1.6-SNAPSHOT";
}

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>commons-parent</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<relativePath>../commons/pom.xml</relativePath>
</parent>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>commons-parent</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>commons-parent</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>commons-parent</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -76,8 +76,8 @@ public class GradleCore {
*/
((DefaultGradleConnector) gradleConnector).daemonMaxIdleTime(1, TimeUnit.SECONDS);
configuration.configure(gradleConnector);
// Use patched Gradle 4.3 distribution as a workaround for https://github.com/gradle/gradle/issues/2483
gradleConnector.useDistribution(URI.create("http://s3-test.spring.io/sts4/custom-gradle-builds/gradle-4.3-build.zip"));
// Use patched Gradle 4.4 distribution or higher as a workaround for https://github.com/gradle/gradle/issues/2483
gradleConnector.useGradleVersion("4.6");
connection = gradleConnector.connect();
return connection.getModel(modelType);
} catch (GradleConnectionException e) {

View File

@@ -83,7 +83,7 @@ public class GradleProjectTest {
@Test
public void outputFolder() throws Exception {
GradleJavaProject project = getGradleProject("test-app-1");
assertTrue(project.getClasspath().getOutputFolder().endsWith("bin"));
assertTrue(project.getClasspath().getOutputFolder().toString().contains("/bin"));
}
@Test

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>commons-parent</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>commons-parent</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016-2018 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
@@ -31,12 +31,14 @@ import org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguage
import org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService;
import org.springframework.ide.vscode.commons.languageserver.util.SortKeys;
import org.springframework.ide.vscode.commons.util.BadLocationException;
import org.springframework.ide.vscode.commons.util.Log;
import org.springframework.ide.vscode.commons.util.Renderable;
import org.springframework.ide.vscode.commons.util.StringUtil;
import org.springframework.ide.vscode.commons.util.text.TextDocument;
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import com.google.common.collect.ImmutableList;
import com.google.gson.JsonPrimitive;
import reactor.core.publisher.Mono;
import reactor.core.scheduler.Schedulers;
@@ -46,6 +48,8 @@ import reactor.core.scheduler.Schedulers;
*/
public class VscodeCompletionEngineAdapter implements VscodeCompletionEngine {
private static final Supplier<Logger> LOG = Suppliers.memoize(() -> LoggerFactory.getLogger(VscodeCompletionEngineAdapter.class));
public static class LazyCompletionResolver {
private int nextId = 0; //Used to assign unique id to completion items.
@@ -64,7 +68,7 @@ public class VscodeCompletionEngineAdapter implements VscodeCompletionEngine {
try {
resolveItem(doc, completion, unresolved);
} catch (Exception e) {
Log.log(e);
LOG.get().error("{}", e);
}
});
return id;
@@ -73,12 +77,12 @@ public class VscodeCompletionEngineAdapter implements VscodeCompletionEngine {
public synchronized void resolveNow(CompletionItem unresolved) {
Object id = unresolved.getData();
if (id!=null) {
Consumer<CompletionItem> resolver = resolvers.get(id);
Consumer<CompletionItem> resolver = resolvers.get(id instanceof JsonPrimitive ? ((JsonPrimitive)id).getAsString() : id);
if (resolver!=null) {
resolver.accept(unresolved);
unresolved.setData(null); //No longer needed after item is resolved.
} else {
Log.warn("Couldn't resolve completion item. Did it already get flushed from the resolver's cache? "+unresolved.getLabel());
LOG.get().warn("Couldn't resolve completion item. Did it already get flushed from the resolver's cache? "+unresolved.getLabel());
}
}
}
@@ -225,7 +229,7 @@ public class VscodeCompletionEngineAdapter implements VscodeCompletionEngine {
return Optional.of(vscodeEdit);
}
} catch (Exception e) {
Log.log(e);
LOG.get().error("{}", e);
return Optional.empty();
}
}
@@ -241,7 +245,7 @@ public class VscodeCompletionEngineAdapter implements VscodeCompletionEngine {
return StringUtil.stripIndentation(refIndent, newText);
}
} catch (BadLocationException e) {
Log.log(e);
LOG.get().error("{}", e);
}
return newText;
}

View File

@@ -238,7 +238,6 @@ public class SimpleLanguageServer implements Sts4LanguageServer, LanguageClientA
if (ih!=null){
ih.accept(params);
}
Log.info("IntializeResult = {}");
return CompletableFuture.completedFuture(result);
}

View File

@@ -10,7 +10,7 @@
<parent>
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>commons-parent</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>commons-parent</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>commons-parent</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>commons-parent</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>commons-parent</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -6,7 +6,7 @@
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>commons-parent</artifactId>
<packaging>pom</packaging>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<name>commons-parent</name>
<modules>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>commons-parent</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<relativePath>../commons/pom.xml</relativePath>
</parent>

View File

@@ -401,8 +401,11 @@ public class PipelineYmlSchema implements YamlSchema {
addProp(resourceType, "source", resourceSource);
addProp(resourceType, "privileged", t_boolean);
YType t_group_name_def= f.yatomic("Group Name")
.parseWith(ValueParsers.NE_STRING);
AbstractType group = f.ybean("Group");
addProp(group, "name", t_ne_string).isPrimary(true);
addProp(group, "name", t_group_name_def).isPrimary(true);
addProp(group, "resources", f.yseq(t_resource_name));
addProp(group, "jobs", f.yseq(t_job_name));
@@ -414,7 +417,8 @@ public class PipelineYmlSchema implements YamlSchema {
definitionTypes = ImmutableList.of(
jobNameDef,
resourceTypeNameDef,
t_resource_name_def
t_resource_name_def,
t_group_name_def
);
initializeDefaultResourceTypes();

View File

@@ -17,5 +17,5 @@ plan:
get: string
```
*Required.* The logical name of the resource being fetched. This name satisfies logical inputs to a [Task](https://concourse.ci/concepts.html#tasks), and may be referenced within the plan itself (e.g. in the `file` attribute of a `task` step).
*Required.* The logical name of the resource being fetched. This name satisfies logical inputs to a [Task](https://concourse-ci.org/concepts.html#tasks), and may be referenced within the plan itself (e.g. in the `file` attribute of a `task` step).

View File

@@ -4,4 +4,4 @@ If set to `latest`, scheduling will just find the latest available version of a
If set to `every`, builds will walk through all available versions of the resource. Note that if `passed` is also configured, it will only step through the versions satisfying the constraints.
If set to a specific version (e.g. `{ref: abcdef123}`), only that version will be used. Note that the version must be available and detected by the resource, otherwise the input will never be satisfied. You may want to use [check-resource](https://concourse.ci/fly-check-resource.html) to force detection of resource versions, if you need to use an older one that was never detected (as all newly configured resources start from the latest version).
If set to a specific version (e.g. `{ref: abcdef123}`), only that version will be used. Note that the version must be available and detected by the resource, otherwise the input will never be satisfied. You may want to use [check-resource](https://concourse-ci.org/fly-check-resource.html) to force detection of resource versions, if you need to use an older one that was never detected (as all newly configured resources start from the latest version).

View File

@@ -3,8 +3,8 @@ to the specified files are ignored.
Note that if you want to push commits that change these files via a `put`,
the commit will still be "detected", as [`check` and `put` both introduce
versions](https://concourse.ci/pipeline-mechanics.html#collecting-versions).
versions](https://concourse-ci.org/pipeline-mechanics.html#collecting-versions).
To avoid this you should define a second resource that you use for commits
that change files that you don't want to feed back into your pipeline - think
of one as read-only (with `ignore_paths`) and one as write-only (which
shouldn't need it).
shouldn't need it).

View File

@@ -1,3 +1,3 @@
*Optional.* Password for HTTP(S) auth when pulling/pushing.
Note: You can also use pipeline templating to hide this password in source control. (For more information: https://concourse.ci/fly-set-pipeline.html)
Note: You can also use pipeline templating to hide this password in source control. (For more information: https://concourse-ci.org/fly-set-pipeline.html)

View File

@@ -9,4 +9,4 @@ Example:
DWiJL+OFeg9kawcUL6hQ8JeXPhlImG6RTUffma9+iGQyyBMCGd1l
-----END RSA PRIVATE KEY-----
Note: You can also use pipeline templating to hide this private key in source control. (For more information: https://concourse.ci/fly-set-pipeline.html)
Note: You can also use pipeline templating to hide this private key in source control. (For more information: https://concourse-ci.org/fly-set-pipeline.html)

View File

@@ -17,5 +17,5 @@ A simple grouping for the pipeline above may look like:
This would display two tabs at the top of the home page: "tests" and "deploy". Once you have added groups to your pipeline then all jobs must be in a group otherwise they will not be visible.
For a real world example of how groups can be used to simplify navigation and provide logical grouping, see the groups used at the top of the page in the [Concourse pipeline](https://ci.concourse.ci/).
For a real world example of how groups can be used to simplify navigation and provide logical grouping, see the groups used at the top of the page in the [Concourse pipeline](https://ci.concourse-ci.org/).

View File

@@ -1,7 +1,7 @@
Pushes to the given [Resource](https://concourse.ci/concepts.html#resources).
Pushes to the given [Resource](https://concourse-ci.org/concepts.html#resources).
All artifacts collected during the plan's execution will be available in the working directory.
For example, the following plan fetches a repo using [get](https://concourse.ci/get-step.html) and pushes it to another repo (assuming `repo-develop` and `repo-master` are defined as `git` resources):
For example, the following plan fetches a repo using [get](https://concourse-ci.org/get-step.html) and pushes it to another repo (assuming `repo-develop` and `repo-master` are defined as `git` resources):
```
plan:
@@ -34,4 +34,4 @@ plan:
put: string
```
Required. The logical name of the resource being pushed. The pushed resource will be available under this name after the push succeeds.
Required. The logical name of the resource being pushed. The pushed resource will be available under this name after the push succeeds.

View File

@@ -1,3 +1,3 @@
*Optional.* Defaults to `name`.
The resource to update, as configured in [resources](https://concourse.ci/configuring-resources.html).
The resource to update, as configured in [resources](https://concourse-ci.org/configuring-resources.html).

View File

@@ -1 +1 @@
*Required.* The name of the resource. This should be short and simple. This name will be referenced by [build plans](https://concourse.ci/build-plans.html) of jobs in the pipeline.
*Required.* The name of the resource. This should be short and simple. This name will be referenced by [build plans](https://concourse-ci.org/build-plans.html) of jobs in the pipeline.

View File

@@ -19,4 +19,4 @@ The following example configures the task to use the `golang:1.6` Docker image:
You can use any resource that returns a filesystem in the correct format (a `/rootfs` directory and a `metadata.json` file in the top level) but normally this will be the [Docker Image resource](https://github.com/concourse/docker-image-resource). If you'd like to make a resource of your own that supports this please use that as a reference implementation for now.
If you want to use an artifact source within the plan containing an image, you must set the [image](https://concourse.ci/task-step.html#task-image) in the plan step instead.
If you want to use an artifact source within the plan containing an image, you must set the [image](https://concourse-ci.org/task-step.html#task-image) in the plan step instead.

View File

@@ -1,3 +1,3 @@
*Required.* The expected set of inputs for the task.
This determines which artifacts will propagate into the task, as the [build plan](https://concourse.ci/build-plans.html) executes. If any specified inputs are not present, the task will end with an error, without running.
This determines which artifacts will propagate into the task, as the [build plan](https://concourse-ci.org/build-plans.html) executes. If any specified inputs are not present, the task will end with an error, without running.

View File

@@ -1,6 +1,6 @@
*Optional.* The artifacts produced by the task.
Each output configures a directory to make available to later steps in the [build plan](https://concourse.ci/build-plans.html). The directory will be automatically created before the task runs, and the task should place any artifacts it wants to export in the directory.
Each output configures a directory to make available to later steps in the [build plan](https://concourse-ci.org/build-plans.html). The directory will be automatically created before the task runs, and the task should place any artifacts it wants to export in the directory.
For example, the following task and script would be used to propagate a built binary to later steps:

View File

@@ -1,4 +1,4 @@
Executes a [Task](https://concourse.ci/concepts.html#tasks), either from a file fetched via the preceding steps, or with inlined configuration.
Executes a [Task](https://concourse-ci.org/concepts.html#tasks), either from a file fetched via the preceding steps, or with inlined configuration.
task: string

View File

@@ -3458,15 +3458,20 @@ public class ConcourseEditorTest {
"- name: bar-resource\n" +
"jobs:\n" +
"- name: do-some-stuff\n" +
"- name: do-more-stuff\n"
"- name: do-more-stuff\n" +
"groups:\n" +
"- name: group-one\n" +
"- name: group-two\n"
);
editor.assertDocumentSymbols(
editor.assertDocumentSymbols(
"some-resource-type|ResourceType",
"foo-resource|Resource",
"bar-resource|Resource",
"do-some-stuff|Job",
"do-more-stuff|Job"
"do-more-stuff|Job",
"group-one|Group",
"group-two|Group"
);
}

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>commons-parent</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<relativePath>../commons/pom.xml</relativePath>
</parent>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.springframework.ide.vscode</groupId>
<artifactId>commons-parent</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<relativePath>../commons/pom.xml</relativePath>
</parent>

View File

@@ -0,0 +1,52 @@
/*******************************************************************************
* Copyright (c) 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pivotal, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.ide.vscode.boot.java.requestmapping;
/**
* @author Martin Lippert
*/
public enum MediaTypeMapping {
ALL("*/*"),
APPLICATION_ATOM_XML("application/atom+xml"),
APPLICATION_FORM_URLENCODED("application/x-www-form-urlencoded"),
APPLICATION_JSON("application/json"),
APPLICATION_JSON_UTF8("application/json;charset=UTF-8"),
APPLICATION_OCTET_STREAM("application/octet-stream"),
APPLICATION_PDF("application/pdf"),
APPLICATION_PROBLEM_JSON("application/problem+json"),
APPLICATION_PROBLEM_JSON_UTF8("application/problem+json;charset=UTF-8"),
APPLICATION_PROBLEM_XML("application/problem+xml"),
APPLICATION_RSS_XML("application/rss+xml"),
APPLICATION_STREAM_JSON("application/stream+json"),
APPLICATION_XHTML_XML("application/xhtml+xml"),
APPLICATION_XML("application/xml"),
IMAGE_GIF("image/gif"),
IMAGE_JPEG("image/jpeg"),
IMAGE_PNG("image/png"),
MULTIPART_FORM_DATA("multipart/form-data"),
TEXT_EVENT_STREAM("text/event-stream"),
TEXT_HTML("text/html"),
TEXT_MARKDOWN("text/markdown"),
TEXT_PLAIN("text/plain"),
TEXT_XML("text/xml");
private String mediaType;
private MediaTypeMapping(String mediaType) {
this.mediaType = mediaType;
}
public String getMediaType() {
return mediaType;
}
}

View File

@@ -28,8 +28,6 @@ import org.eclipse.jdt.core.dom.NormalAnnotation;
import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.eclipse.lsp4j.Location;
import org.eclipse.lsp4j.SymbolInformation;
import org.eclipse.lsp4j.SymbolKind;
import org.springframework.ide.vscode.boot.java.Annotations;
import org.springframework.ide.vscode.boot.java.handlers.EnhancedSymbolInformation;
import org.springframework.ide.vscode.boot.java.handlers.SymbolProvider;
@@ -48,9 +46,9 @@ public class RequestMappingSymbolProvider implements SymbolProvider {
Location location = new Location(doc.getUri(), doc.toRange(node.getStartPosition(), node.getLength()));
String[] path = getPath(node);
String[] parentPath = getParentPath(node);
String[] method = getMethod(node);
String methodStr = method == null || method.length == 0 ? "" : String.join(",", method);
String[] methods = getMethod(node);
String[] contentTypes = getContentTypes(node);
String[] acceptTypes = getAcceptTypes(node);
return (parentPath == null ? Stream.of("") : Arrays.stream(parentPath)).filter(Objects::nonNull)
.flatMap(parent -> (path == null ? Stream.<String>empty() : Arrays.stream(path))
@@ -62,8 +60,7 @@ public class RequestMappingSymbolProvider implements SymbolProvider {
}
return resultPath.startsWith("/") ? resultPath : "/" + resultPath;
}))
.map(p -> "@" + p + (methodStr.isEmpty() ? "" : " -- " + methodStr))
.map(symbolLabel -> new EnhancedSymbolInformation(new SymbolInformation(symbolLabel, SymbolKind.Interface, location), null))
.map(p -> RouteUtils.createRouteSymbol(location, p, methods, contentTypes, acceptTypes, null))
.collect(Collectors.toList());
} catch (Exception e) {
e.printStackTrace();
@@ -176,6 +173,44 @@ public class RequestMappingSymbolProvider implements SymbolProvider {
}
return null;
}
private String[] getAcceptTypes(Annotation node) {
if (node.isNormalAnnotation()) {
NormalAnnotation normNode = (NormalAnnotation) node;
List<?> values = normNode.values();
for (Iterator<?> iterator = values.iterator(); iterator.hasNext();) {
Object object = iterator.next();
if (object instanceof MemberValuePair) {
MemberValuePair pair = (MemberValuePair) object;
String valueName = pair.getName().getIdentifier();
if (valueName != null && valueName.equals("consumes")) {
Expression expression = pair.getValue();
return ASTUtils.getExpressionValueAsArray(expression);
}
}
}
}
return new String[0];
}
private String[] getContentTypes(Annotation node) {
if (node.isNormalAnnotation()) {
NormalAnnotation normNode = (NormalAnnotation) node;
List<?> values = normNode.values();
for (Iterator<?> iterator = values.iterator(); iterator.hasNext();) {
Object object = iterator.next();
if (object instanceof MemberValuePair) {
MemberValuePair pair = (MemberValuePair) object;
String valueName = pair.getName().getIdentifier();
if (valueName != null && valueName.equals("produces")) {
Expression expression = pair.getValue();
return ASTUtils.getExpressionValueAsArray(expression);
}
}
}
}
return new String[0];
}
@Override
public Collection<EnhancedSymbolInformation> getSymbols(TypeDeclaration typeDeclaration, TextDocument doc) {

View File

@@ -0,0 +1,44 @@
/*******************************************************************************
* Copyright (c) 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pivotal, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.ide.vscode.boot.java.requestmapping;
import org.eclipse.lsp4j.Location;
import org.eclipse.lsp4j.SymbolInformation;
import org.eclipse.lsp4j.SymbolKind;
import org.springframework.ide.vscode.boot.java.handlers.EnhancedSymbolInformation;
/**
* @author Martin Lippert
*/
public class RouteUtils {
public static EnhancedSymbolInformation createRouteSymbol(Location location, String path,
String[] httpMethods, String[] contentTypes, String[] acceptTypes, Object enhancedInformation) {
if (path != null && path.length() > 0) {
String label = "@" + (path.startsWith("/") ? path : ("/" + path));
label += (httpMethods == null || httpMethods.length == 0 ? "" : " -- " + WebfluxUtils.getStringRep(httpMethods, string -> string));
String acceptType = WebfluxUtils.getStringRep(acceptTypes, WebfluxUtils::getMediaType);
label += acceptType != null ? " - Accept: " + acceptType : "";
String contentType = WebfluxUtils.getStringRep(contentTypes, WebfluxUtils::getMediaType);
label += contentType != null ? " - Content-Type: " + contentType : "";
return new EnhancedSymbolInformation(new SymbolInformation(label, SymbolKind.Interface, location), enhancedInformation);
}
else {
return null;
}
}
}

View File

@@ -0,0 +1,52 @@
/*******************************************************************************
* Copyright (c) 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pivotal, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.ide.vscode.boot.java.requestmapping;
import java.util.LinkedHashSet;
import java.util.Set;
import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.IMethodBinding;
import org.eclipse.jdt.core.dom.MethodInvocation;
/**
* @author Martin Lippert
*/
public class WebfluxAcceptTypeFinder extends ASTVisitor {
private Set<String> acceptTypes;
public WebfluxAcceptTypeFinder() {
this.acceptTypes = new LinkedHashSet<>();
}
public Set<String> getAcceptTypes() {
return acceptTypes;
}
@Override
public boolean visit(MethodInvocation node) {
IMethodBinding methodBinding = node.resolveMethodBinding();
if (WebfluxUtils.REQUEST_PREDICATES_TYPE.equals(methodBinding.getDeclaringClass().getBinaryName())) {
String name = methodBinding.getName();
if (name != null && WebfluxUtils.REQUEST_PREDICATE_ACCEPT_TYPE_METHOD.equals(name)) {
String acceptType = WebfluxUtils.extractSimpleNameArgument(node);
if (acceptType != null) {
acceptTypes.add(acceptType);
}
}
}
return !WebfluxUtils.isRouteMethodInvocation(methodBinding);
}
}

View File

@@ -0,0 +1,62 @@
/*******************************************************************************
* Copyright (c) 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pivotal, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.ide.vscode.boot.java.requestmapping;
import java.util.LinkedHashSet;
import java.util.Set;
import org.eclipse.jdt.core.dom.ASTNode;
import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.IMethodBinding;
import org.eclipse.jdt.core.dom.MethodInvocation;
/**
* @author Martin Lippert
*/
public class WebfluxContentTypeFinder extends ASTVisitor {
private Set<String> contentTypes;
private ASTNode root;
public WebfluxContentTypeFinder(ASTNode root) {
this.root = root;
this.contentTypes = new LinkedHashSet<>();
}
public Set<String> getContentTypes() {
return contentTypes;
}
@Override
public boolean visit(MethodInvocation node) {
boolean visitChildren = true;
if (node != this.root) {
IMethodBinding methodBinding = node.resolveMethodBinding();
if (WebfluxUtils.REQUEST_PREDICATES_TYPE.equals(methodBinding.getDeclaringClass().getBinaryName())) {
String name = methodBinding.getName();
if (name != null && WebfluxUtils.REQUEST_PREDICATE_CONTENT_TYPE_METHOD.equals(name)) {
String contentType = WebfluxUtils.extractSimpleNameArgument(node);
if (contentType != null) {
contentTypes.add(contentType);
}
}
}
if (WebfluxUtils.isRouteMethodInvocation(methodBinding)) {
visitChildren = false;
}
}
return visitChildren;
}
}

Some files were not shown because too many files have changed in this diff Show More