Readme for Theia extensions

This commit is contained in:
BoykoAlex
2018-05-24 14:44:41 -04:00
parent 1bdd6f45aa
commit 9d8dcbdd5f
3 changed files with 321 additions and 0 deletions

View File

@@ -0,0 +1,154 @@
# Bosh Deployment Manifest Editor for Theia IDE
This extension provides validation, content assist and documentation hovers
for editing [Bosh](https://bosh.io/) Deployment Manifest files and
Cloud Configs.
## Functionality
### Validation
As you type the text is parsed and checked for basic syntactic and structural correctness. Hover over
an error marker to see an explanation:
![Linting Screenshot][linting]
### Content assist
Having trouble remembering all the names of the attributes, and their spelling? Or can't remember
the exact name/version of the stemcell you just uploaded to your bosh environment? Content assist
to the rescue:
![Content Assist Screenshot][ca1]
![Content Assist Screenshot][ca2]
### Documentation Hovers
Having trouble remembering exactly what the meaning of each attribute is? Hover over an attribute and
read its detailed documentation:
![Hover Docs Screenshot][hovers]
### Goto Symbol in File
Is your Deployment Manifest getting larger and is it becoming harder to find a particular Instance Group,
Release, or Stemcell definition? The "Goto Symbol in File" command helps you quickly jump to a specific
definition.
Type `CTRL-SHIFT-O` to popup a list of all symbols in your current file. Start typing a name
(or portion thereof) to narrow down the list. Select a symbol to jump directly to its location in the
file.
![Goto Symbol Screenshot][goto_symbol]
### Goto/Peek Definition
Use "Goto Defition" or "Peek Definition" to quickly go (or peek) from a Release or Stemcell name
to its corresponding definition.
![Peek Definition Screenshot][peek]
### V2 versus V1 Schema
The editor is intended primarily to support editing manifests in the [V2 schema](https://bosh.io/docs/manifest-v2.html).
When you use attributes from the V1 schema the editor will detect this however and switch to 'V1 tolerance' mode.
In this mode, V1 properties are accepted but marked with deprecation warnings and V2 properties are marked as (unknown property)
errors.
## Usage
### Activating the Editor
The Bosh editor automatically activates when the name of the `.yml` file you are editing
follows a certain pattern:
- `**/*deployment*.yml` : activates support for Bosh manifest file.
- `**/*cloud-config*.yml` : activates support for Bosh cloud config.
### Targetting a specific Director
Some of the Validations and Content Assist depend on information dymanically retrieved from an active Bosh director.
The editor retreives information by executing commands using the Bosh CLI. For this to work the CLI (V2
CLI is required) and editor have to be installed and configured correctly.
There are two ways to set things up to make this work:
#### Explicitly Configure the CLI:
The bosh cli is configured by specifying keys of the form `bosh.cli.XXX`. These can be specified in the Theia preference
file (`~/.theia/settings.json`).
Note that the `bosh.cli.XXX` settings do not allow you to provide credentials to connect to the director.
The editor assumes that you are providing the credentials implicitly by using the `bosh login` command from a terminal.
The bosh cli will persist the credentials in `~/.bosh/config` and read them from there. A typical sequence of commands
to store the credentials would be something like the following:
First, create an alias for your environment:
```
$ bosh alias-env my-env -e 10.194.4.35 --ca-cert <(bosh int ./creds.yml --path /director_ssl/ca)
Using environment '10.194.4.35' as anonymous user
...
Succeeded
$
```
Second, obtain username/password for your director. For example:
```
$ bosh int ./creds.yml --path /admin_password
very-secret-admin-password
Succeeded
```
Now use `bosh login` to establish a session and store the credentials:
```
$ bosh login -e my-env
Username (): admin
Password (): very-secret-admin-password
Using environment '10.194.4.35' as client 'admin'
Logged in to '10.194.4.35'
Succeeded
```
You can verify that CLI is setup correctly by executing a command like:
```
$ bosh -e my-env cloud-config
...
Succeeded
```
#### Implictly Configure the CLI:
If the bosh cli is not explicitly configured, the editor will, by default, try to execute commands like `bosh cloud-config --json`
and `bosh stemcells --json` without an explicit `-e ...` argument. This works only if you ensure that the editor
process executes with a proper set of OS environment variables:
- `PATH`: must be set so that `bosh` cli executable can be found and refers to the V2 CLI.
- `BOSH_ENVIRONMENT`: must be set to point to the bosh director you want to target.
If you start Theia from a terminal, you can verify that things are setup correctly by executing command:
bosh cloud-config
If that command executes without any errors and returns the cloud-config you expected, then things are setup correctly.
If you subsequently launch Theia from that same terminal the dynamic CA and linting should work correctly.
## Issues and Feature Requests
Please report bugs, issues and feature requests on the [Github STS4 issue tracker](https://github.com/spring-projects/sts4/issues).
[linting]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-bosh/bosh/readme-imgs/validation.png
[ca1]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-bosh/bosh/readme-imgs/ca-1.png
[ca2]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-bosh/bosh/readme-imgs/ca-2.png
[hovers]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-bosh/bosh/readme-imgs/hover.png
[peek]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-bosh/bosh/readme-imgs/peek-definition.png
[goto_symbol]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-bosh/bosh/readme-imgs/doc-symbol.png

View File

@@ -0,0 +1,48 @@
# Cloud Foundry Manifest Editor for Theia IDE
This extension provides basic validation, content assist and hover infos
for editing Cloud Foundry [Manifest](https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html) Files.
## Usage
The CF manifest editor automatically activates when the name of the `.yml` file you are editing,
matches the glob pattern: `manifest*.yml`.
## Functionality
### Validation
As you type the manifest is parsed and checked for basic syntactic and structural correctness. Hover over
an error marker to see an explanation.
![Linting Screenshot][linting]
### Content Assist
Having trouble remembering all the names of the attributes, and their spelling? Content assist to the
rescue:
![Content Assist Screenshot][ca]
### Dynamic Cloud Foundry Content Assist
Would you like to see actual Cloud Foundry values for attributes like `services`, `buildpack`, `domain`, and `stack`? If you have [cf CLI](https://docs.cloudfoundry.org/cf-cli/) installed and connected to a Cloud target, the extension will automatically display values for certain manifest attributes.
For example, if you are connected to a Cloud target that has services, and you invoke content assist in an entry under `services`, you will see the available service instances. In addition, service instances that do not exist in the Cloud target, like `redisserv` in the example below, are highlighted with a warning.
Dynamic content assist also shows which Cloud target you are connected to.
![Dynamic Cloud Foundry Content Assist Screenshot][dcfca]
### Documentation Hovers
Having trouble remembering exactly what the meaning of each attribute is? Hover over any attribute and
read its detailed documentation.
![Hover Docs Screenshot][hovers]
[linting]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-cf-manifest-yaml/cf-manifest-yaml/readme-imgs/validation.png
[ca]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-cf-manifest-yaml/cf-manifest-yaml/readme-imgs/ca.png
[dcfca]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-cf-manifest-yaml/cf-manifest-yaml/readme-imgs/dynamic-ca.png
[hovers]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-cf-manifest-yaml/cf-manifest-yaml/readme-imgs/hovers.png

View File

@@ -0,0 +1,119 @@
# Spring Boot Application Support for Theia IDE
Theia extension and Language Server providing support for working with Spring Boot
`application.properties`, `application.yml` and `.java` files.
# Usage:
The extension will automatically activate when you edit files with the following
name patterns:
- `application*.properties` => activates support for Spring Boot properties in `.properties`format.
- `application*.yml` => activates support for Spring Boot properties in `.yml` format.
- `*.java` => activates Spring Boot specific support editing `.java` files.
# Functionality for `.java`
## Navigating the source code - Go to symbol in file/workspace
Easy navigation to Spring-specific elements of your source code.
![Go to Symbol in workspace][java-navigation]
### Shortcuts
* Mac: Cmd-Shift-O (symbols in file), Cmd-T (symbols in workspace)
* Linux/Windows: Ctrl-Shift-O (symbols in file), Ctrl-T (symbols in workspace)
### Examples
* `@/` shows all defined request mappings (mapped path, request method, source location)
* `@+` shows all defined beans (bean name, bean type, source location)
* `@>` shows all functions (prototype implementation)
* `@` shows all Spring annotations in the code
## Quick-access for running apps
Easy navigation to the provided request mappings of running apps.
![accessing running apps quickly][java-live-apps-quick-access]
### Shortcuts
* Mac: Cmd-Shift-O (symbols in file), Cmd-T (symbols in workspace)
* Linux/Windows: Ctrl-Shift-O (symbols in file), Ctrl-T (symbols in workspace)
### Examples
* `//` shows all request mappings of all running Spring Boot apps and opens a browser for the selected endpoint
## 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][java-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
### Configuration
You can enable/disable this feature via workspace or user preferences,
using the key: `boot-java.boot-hints.on`.
## Code templates
Write Spring code with templates, available via regular code completion.
### Examples
* `@GetMapping`
* `@PostMapping`
* `@PutMapping`
## Smart code completions
Additional code completions for Spring-specific annotations
![Smart code completion for boot properties][java-code-completion]
### Examples
* `@Value`: code completion for Spring Boot property keys
* `@Scope`: code completion for standard scope names
# Functionality for `.properties` and `.yml`
This extension analyzes your project's classpath and parses and indexes any [Spring Boot
Properties Metadata](https://docs.spring.io/spring-boot/docs/current/reference/html/configuration-metadata.html) it finds. Both Maven and Gradle projects are supported.
The data in the index is used to provide validation, code completions and information
hovers while editing Spring Boot Properties in either `.properties` or `.yml` format.
## Validation
![application-yaml-validation][yaml-validation]
![application-properties-validation][properties-validation]
## Code Completions
![application-yaml-completions][yaml-completion]
![application-properties-completions][properties-completion]
## Information Hovers
![application-yaml-hovers][yaml-hovers]
## Issues and Feature Requests
Please report bugs, issues and feature requests on the [Github STS4 issue tracker](https://github.com/spring-projects/sts4/issues).
# Releases:
Released versions of this extension can be installed directly from npm registry.
[yaml-completion]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-spring-boot/spring-boot/readme-imgs/yaml-ca.png
[properties-completion]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-spring-boot/spring-boot/readme-imgs/properties-ca.png
[yaml-validation]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-spring-boot/spring-boot/readme-imgs/yaml-validation.png
[properties-validation]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-spring-boot/spring-boot/readme-imgs/properties-validation.png
[yaml-hovers]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-spring-boot/spring-boot/readme-imgs/hovers.png
[java-code-completion]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-spring-boot/spring-boot/readme-imgs/smart-ca.png
[java-live-apps-quick-access]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-spring-boot/spring-boot/readme-imgs/live-request-mappings.png
[java-live-hovers]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-spring-boot/spring-boot/readme-imgs/live-hovers.png
[java-navigation]: https://raw.githubusercontent.com/spring-projects/sts4/1bdd6f45aaf779252a2f0203f10da1a67b3c018e/theia-extensions/theia-spring-boot/spring-boot/readme-imgs/workspace-symbol.png