Merge branch 'master' of github.com:spring-projects/sts4

This commit is contained in:
Kris De Volder
2017-11-23 13:17:23 -08:00
13 changed files with 325 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
.idea/
server/
node_modules/

View File

@@ -0,0 +1,3 @@
.idea/
server/
node_modules/

View File

@@ -0,0 +1,15 @@
language: objective-c
notifications:
email:
on_success: never
on_failure: change
script: 'curl -s https://raw.githubusercontent.com/atom/ci/master/build-package.sh | sh'
git:
depth: 10
branches:
only:
- master

View File

@@ -0,0 +1,51 @@
# Atom package for Spring Boot Application Properties
Atom package and Language Server providing support for editing `application.properties`
and `application.yml` files containing Spring Boot configuration properties.
## Installation:
Install it from Atom `Install Packages`, search for `boot-properties`
## Usage:
The extension will automatically activate when you edit files with the following
name patterns:
- `application.properties` => activates support for .properties file format.
- `application.yml` => activates support for .yml file format.
For all other files select grammar to be `Spring-Boot-Properties` for `properties` file format or `Spring-Boot-Properties-YAML` for 'YAML' file format
# Developer notes
## Bulding and Running
To build all these pieces you normally only need to run:
npm install
Now you can link it to Atom:
apm link .
Open Atom or execute `Refresh Window` in the opened instance (Packages -> Command Palette -> Toggle then search for the command).
## Debugging
**Client Side Debugging**: Open Atom's `Developer Tools` view - View -> Developer -> Toggle Developer Tools
**Server Side Debugging**: Change `launchVmArgs(version)` implementation in `lib/main.js` to be:
```
launchVmArgs(version) {
return Promise.resolve([
'-Xdebug',
'-agentlib:jdwp=transport=dt_socket,server=y,address=7999,suspend=n',
'-Dorg.slf4j.simpleLogger.logFile=boot-properties.log',
'-Dorg.slf4j.simpleLogger.defaultLogLevel=debug',
]);
}
```
(Then setup the remote debugger from your IDE on the same port `7999`)

View File

@@ -0,0 +1,27 @@
version: "{build}"
platform: x64
branches:
only:
- master
clone_depth: 10
skip_tags: true
environment:
APM_TEST_PACKAGES:
matrix:
- ATOM_CHANNEL: stable
- ATOM_CHANNEL: beta
install:
- ps: Install-Product node 6
build_script:
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/atom/ci/master/build-package.ps1'))
test: off
deploy: off

View File

@@ -0,0 +1,37 @@
{
"max_line_length": {
"level": "ignore"
},
"no_empty_param_list": {
"level": "error"
},
"arrow_spacing": {
"level": "error"
},
"no_interpolation_in_single_quotes": {
"level": "error"
},
"no_debugger": {
"level": "error"
},
"prefer_english_operator": {
"level": "error"
},
"colon_assignment_spacing": {
"spacing": {
"left": 0,
"right": 1
},
"level": "error"
},
"braces_spacing": {
"spaces": 0,
"level": "error"
},
"spacing_after_comma": {
"level": "error"
},
"no_stand_alone_at": {
"level": "error"
}
}

View File

@@ -0,0 +1,8 @@
'scopeName': 'source.boot-properties-yaml'
'name': 'Spring-Boot-Properties-YAML'
'fileTypes': [
'application.yml'
]
'patterns': [
{ 'include': 'source.yaml' }
]

View File

@@ -0,0 +1,8 @@
'scopeName': 'source.boot-properties'
'name': 'Spring-Boot-Properties'
'fileTypes': [
'application.properties'
]
'patterns': [
{ 'include': 'source.java-properties' }
]

View File

@@ -0,0 +1,45 @@
const path = require('path');
const { JavaProcessLanguageClient } = require('pivotal-atom-languageclient-commons');
const PROPERTIES = require('../properties.json');
class BootPropertiesClient extends JavaProcessLanguageClient {
constructor() {
//noinspection JSAnnotator
super(
PROPERTIES.jarUrl,
path.join(__dirname, '..', 'server'),
'boot-properties-language-server.jar'
);
}
getGrammarScopes() {
return ['source.boot-properties','source.boot-properties-yaml'];
}
getLanguageName() {
return 'Boot-Properties';
}
getServerName() {
return 'Boot-Properties';
}
activate() {
// replace the example argument 'linter-ruby' with the name of this Atom package
require('atom-package-deps')
.install('boot-properties')
.then(() => console.debug('All dependencies installed, good to go'));
super.activate();
}
launchVmArgs(version) {
return Promise.resolve([
'-Dorg.slf4j.simpleLogger.logFile=boot-properties.log',
'-Dorg.slf4j.simpleLogger.defaultLogLevel=debug',
]);
}
}
module.exports = new BootPropertiesClient();

View File

@@ -0,0 +1,83 @@
{
"name": "boot-properties",
"main": "./lib/main",
"version": "0.0.10",
"description": "Spring Boot Properties support for Atom",
"repository": "https://github.com/spring-projects/atom-boot-properties",
"icon": "icon.png",
"license": "MIT",
"engines": {
"atom": ">=1.21.0"
},
"files": [
"grammars/",
"settings/",
"lib/",
"server/",
"properties.json"
],
"dependencies": {
"atom-package-deps": "^4.6.0",
"download": "^6.2.5",
"pivotal-atom-languageclient-commons": "0.0.16"
},
"devDependencies": {
"coffeelint": "^1.10.1"
},
"scripts": {
"clean": "rm -fr node_modules",
"postinstall": "node script.js"
},
"package-deps": [
"atom-ide-ui"
],
"consumedServices": {
"linter-indie": {
"versions": {
"2.0.0": "consumeLinterV2"
}
},
"datatip": {
"versions": {
"0.1.0": "consumeDatatip"
}
}
},
"providedServices": {
"autocomplete.provider": {
"versions": {
"2.0.0": "provideAutocomplete"
}
},
"code-actions": {
"versions": {
"0.1.0": "provideCodeActions"
}
},
"code-format.range": {
"versions": {
"0.1.0": "provideCodeFormat"
}
},
"code-highlight": {
"versions": {
"0.1.0": "provideCodeHighlight"
}
},
"definitions": {
"versions": {
"0.1.0": "provideDefinitions"
}
},
"find-references": {
"versions": {
"0.1.0": "provideFindReferences"
}
},
"outline-view": {
"versions": {
"0.1.0": "provideOutlines"
}
}
}
}

View File

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

View File

@@ -0,0 +1,34 @@
const fs = require('fs');
const path = require('path');
const download = require('download');
const PROPERTIES = require('./properties.json');
let fileExists = function(path) {
return new Promise((resolve, reject) => {
fs.access(path, fs.R_OK, error => {
resolve(!error || error.code !== 'ENOENT');
})
});
};
const serverDownloadUrl = PROPERTIES.jarUrl;
const serverHome = path.join(__dirname, 'server');
const localFileName = path.join(serverHome, 'boot-properties-language-server.jar');
fileExists(localFileName).then(exists => {
if (!exists) {
console.log(`Downloading ${serverDownloadUrl} to ${localFileName}`);
fileExists(serverHome)
.then(doesExist => { if (!doesExist) fs.mkdir(serverHome) })
.then(() => download(serverDownloadUrl))
.then(data => fs.writeFileSync(localFileName, data))
.then(() => fileExists(localFileName))
.then(doesExist => { if (!doesExist) throw Error(`Failed to install the ${this.getServerName()} language server`) })
.then(() => console.log(`Successfully downloaded ${serverDownloadUrl}`));
}
});

View File

@@ -0,0 +1,8 @@
'.source.boot-properties-yaml':
'editor':
'autoIndentOnPaste': false
'commentStart': '# '
'foldEndPattern': '^\\s*$|^\\s*\\}|^\\s*\\]|^\\s*\\)'
'increaseIndentPattern': '^\\s*.*(:|-) ?(&\\w+)?(\\{[^}"\']*|\\([^)"\']*)?$'
'decreaseIndentPattern': '^\\s+\\}$'
'tabType': 'soft'