Dummy package for atom-boot-java
This commit is contained in:
@@ -1,68 +1,3 @@
|
||||
# Atom package for Spring Boot projects
|
||||
# Atom package for Spring Boot projects __(Obsolete)__
|
||||
|
||||
[](https://travis-ci.org/spring-projects/atom-boot-java) [](https://ci.appveyor.com/project/spring-projects/atom-boot-java/branch/master) [](https://david-dm.org/spring-projects/atom-boot-java)
|
||||
|
||||
Atom package and Language Server providing support for working with Spring Boot apps in Java.
|
||||
|
||||
# Usage:
|
||||
|
||||
The extension will automatically activate when you edit files with the following
|
||||
name patterns:
|
||||
|
||||
- `*.java` => activates support for Java files
|
||||
|
||||
# Functionality
|
||||
|
||||
## Navigating the source code - Go to symbol in file
|
||||
Easy navigation to Spring-specific elements of your source code. Open `.java` file then open Atom's `Outline View` - View -> Toggle Outline View
|
||||
|
||||
![Go to Symbol in file][screenshot-navigation]
|
||||
|
||||
## Live application information hovers
|
||||
Show information from running Spring Boot apps on your machine in the source code. This allows you to run the Spring Boot app locally on your machine and visualizes information from those running apps in your source code.
|
||||
|
||||
### Visualization
|
||||
Once the tooling detects a running Spring Boot app on your local machine, it automatically shows hints in the source code where data from the running app can be inspected. Then hovering over that area (with the mouse pointer), the data from the running app shows up.
|
||||
|
||||
If there are multiple instances of the app running on your machine, the live data from all those instances will show up in the hover information.
|
||||
|
||||
![live data from running apps as hover on source code][screenshot-live-hovers]
|
||||
|
||||
### Examples
|
||||
* `@Profile`: shows information about the active profiles on the running apps
|
||||
* `@Component`, `@Bean`, `@Autowired`: shows detailed information about the beans and their wiring from the live app
|
||||
* `@ContidionalOn...`: shows information about the conditions and their evaluation at runtime
|
||||
* `RequestMapping`: show information about the request mapping for running apps
|
||||
|
||||
### Configuration
|
||||
You can enable/disable this feature via workspace preferences by adding the following:
|
||||
```
|
||||
"boot-java":
|
||||
"boot-hints":
|
||||
on: false
|
||||
|
||||
```
|
||||
|
||||
## Smart code completions
|
||||
Additional code completions for Spring-specific annotations
|
||||
|
||||
![Smart code completion for boot properties][screenshot-code-completion]
|
||||
|
||||
### Examples
|
||||
* `@Value`: code completion for Spring Boot property keys
|
||||
* `@Scope`: code completion for standard scope names
|
||||
|
||||
# Releases:
|
||||
|
||||
Released versions of this package can be installed directly from the Atom package installer.
|
||||
|
||||
There are also development snapshots available with the latest fixes and improvements as a `.tgz` file
|
||||
that can be donwloaded from
|
||||
[here](http://dist.springsource.com/snapshot/STS4/nightly-distributions.html). To install it:
|
||||
1. Unpack into a folder `<package>` (this folder should have `package.json` file)
|
||||
2. Execute `apm link .` from that folder
|
||||
3. Execute `Window Reload` (Package -> Command Palette -> Toggle then search for it) command in the opened Atom instance or open an Atom instance
|
||||
|
||||
[screenshot-live-hovers]: https://raw.githubusercontent.com/spring-projects/sts4/112106b8bfdcebc33bb7923dda496f7a91fa93d8/atom-extensions/atom-boot-java/readme-imgs/screenshot-live-hovers.png
|
||||
[screenshot-code-completion]: https://github.com/spring-projects/sts4/blob/112106b8bfdcebc33bb7923dda496f7a91fa93d8/atom-extensions/atom-boot-java/readme-imgs/screenshot-code-completion.png
|
||||
[screenshot-navigation]: https://github.com/spring-projects/sts4/blob/26452532e6151f6668bcae4b5a2503c5a75c8d15/atom-extensions/atom-boot-java/readme-imgs/screenshot-navigation-in-file.png
|
||||
It has been merged with Spring Boot Properties support and has moved to [Spring Boot](https://github.com/spring-projects/atom-spring-boot)
|
||||
|
||||
@@ -1,140 +1,39 @@
|
||||
const path = require('path');
|
||||
const { JavaProcessLanguageClient, StsAdapter } = require('pivotal-atom-languageclient-commons');
|
||||
const { Convert } = require('atom-languageclient');
|
||||
const PROPERTIES = require('../properties.json');
|
||||
const {AutoLanguageClient} = require('atom-languageclient');
|
||||
|
||||
const BOOT_DATA_MARKER_TYPE = 'BootApp-Hint';
|
||||
const BOOT_HINT_GUTTER_NAME = 'boot-hint-gutter';
|
||||
|
||||
class BootJavaLanguageClient extends JavaProcessLanguageClient {
|
||||
|
||||
constructor() {
|
||||
//noinspection JSAnnotator
|
||||
super(
|
||||
PROPERTIES.jarUrl,
|
||||
path.join(__dirname, '..', 'server'),
|
||||
'boot-java-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']
|
||||
}
|
||||
|
||||
getLanguageName() {
|
||||
return 'boot-java'
|
||||
}
|
||||
|
||||
getServerName() {
|
||||
return 'Spring Boot'
|
||||
}
|
||||
|
||||
activate() {
|
||||
require('atom-package-deps')
|
||||
.install('boot-java')
|
||||
.then(() => console.debug('All dependencies installed, good to go'));
|
||||
super.activate();
|
||||
}
|
||||
|
||||
getOrInstallLauncher() {
|
||||
return Promise.resolve('org.springframework.boot.loader.JarLauncher');
|
||||
}
|
||||
|
||||
launchVmArgs(version) {
|
||||
return super.getOrInstallLauncher().then(lsJar => {
|
||||
const toolsJar = this.findJavaFile('lib', 'tools.jar');
|
||||
if (version < 9 && !toolsJar) {
|
||||
// Notify the user that tool.jar is not found
|
||||
const notification = atom.notifications.addWarning(`"Boot-Java" Package Functionality Limited`, {
|
||||
dismissable: true,
|
||||
detail: 'No tools.jar found',
|
||||
description: 'JAVA_HOME environment variable points either to JRE or JDK missing "lib/tools.jar" hence Boot Hints are unavailable',
|
||||
buttons: [{
|
||||
text: 'OK',
|
||||
onDidClick: () => {
|
||||
notification.dismiss()
|
||||
},
|
||||
}],
|
||||
});
|
||||
}
|
||||
return [
|
||||
// '-Xdebug',
|
||||
// '-agentlib:jdwp=transport=dt_socket,server=y,address=7999,suspend=n',
|
||||
'-Dorg.slf4j.simpleLogger.logFile=boot-java.log',
|
||||
'-Dorg.slf4j.simpleLogger.defaultLogLevel=debug',
|
||||
'-cp',
|
||||
`${toolsJar ? `${toolsJar}${path.delimiter}` : ''}${lsJar}`
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
createStsAdapter() {
|
||||
return new BootStsAdapter();
|
||||
}
|
||||
|
||||
filterChangeWatchedFiles(filePath) {
|
||||
return filePath.endsWith('.gradle') || filePath.endsWith(path.join('', 'pom.xml'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class BootStsAdapter extends StsAdapter {
|
||||
class BootJavaLanguageClient extends AutoLanguageClient {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
onHighlight(params) {
|
||||
this.findEditors(params.doc.uri).forEach(editor => this.markHintsForEditor(editor, params.ranges));
|
||||
getGrammarScopes() {
|
||||
return [];
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
getLanguageName() {
|
||||
return 'boot-java';
|
||||
}
|
||||
|
||||
createHintMarker(editor, range) {
|
||||
// Create marker model
|
||||
const marker = editor.markBufferRange(Convert.lsRangeToAtomRange(range), BOOT_DATA_MARKER_TYPE);
|
||||
getServerName() {
|
||||
return 'Spring Boot';
|
||||
}
|
||||
|
||||
// Marker around the text in the editor
|
||||
editor.decorateMarker(marker, {
|
||||
type: 'highlight',
|
||||
class: 'boot-hint'
|
||||
activate() {
|
||||
const notification = atom.notifications.addInfo('`boot-java` Extension __NOT__ Functional', {
|
||||
dismissable: true,
|
||||
detail: '`boot-java` extension starting from 0.1.4 is obsolete',
|
||||
description: 'The `boot-java` extension is obsolete and no longer functional. Please uninstall it and install the `spring-boot` extension instead.',
|
||||
buttons: [{
|
||||
text: 'OK',
|
||||
onDidClick: () => {
|
||||
notification.dismiss();
|
||||
}
|
||||
}]
|
||||
});
|
||||
|
||||
// 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});
|
||||
super.activate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
module.exports = new BootJavaLanguageClient();
|
||||
|
||||
@@ -10,81 +10,12 @@
|
||||
"atom": ">=1.21.0"
|
||||
},
|
||||
"files": [
|
||||
"lib/",
|
||||
"server/",
|
||||
"styles/",
|
||||
"properties.json"
|
||||
"lib/"
|
||||
],
|
||||
"configSchema": {
|
||||
"boot-hints.on": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Enable/Disable Spring running Boot application live hints decorators in the source code"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"atom-package-deps": "^4.6.0",
|
||||
"download": "^6.2.5",
|
||||
"pivotal-atom-languageclient-commons": "0.0.19"
|
||||
},
|
||||
"devDependencies": {
|
||||
"coffeelint": "^1.10.1"
|
||||
"atom-languageclient": "0.8.0"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rm -fr node_modules",
|
||||
"postinstall": "node script.js"
|
||||
},
|
||||
"package-deps": [
|
||||
"atom-ide-ui",
|
||||
"ide-java"
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
"clean": "rm -fr node_modules"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"jarUrl": "https://s3-us-west-1.amazonaws.com/s3-test.spring.io/sts4/fatjars/snapshots/boot-java-language-server-0.0.10-201711061741.jar"
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 76 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 54 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 139 KiB |
@@ -1,34 +0,0 @@
|
||||
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-java-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}`));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 617 B |
@@ -1,16 +0,0 @@
|
||||
.boot-hint .region {
|
||||
border-color: #32BA56;
|
||||
border-style: dotted;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
atom-text-editor.editor {
|
||||
.gutter-boot-hint:before {
|
||||
content: url("atom://boot-java/styles/boot-icon.png");
|
||||
display: block;
|
||||
width: 10px;
|
||||
height: 1em;
|
||||
margin: 0 2px 0 0;
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user