coc-springboot 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +10 -0
- package/.gitattributes +1 -0
- package/.gitmodules +3 -0
- package/.ignore +1 -0
- package/LICENSE +674 -0
- package/README.md +76 -0
- package/build.sh +72 -0
- package/esbuild.mjs +24 -0
- package/lib/index.js +3857 -0
- package/package.json +1063 -0
- package/sts4/eclipse-distribution/.mvn/wrapper/maven-wrapper.jar +0 -0
- package/sts4/eclipse-extensions/org.springframework.ide.eclipse.docker.client/docker-client-wrapper/.mvn/wrapper/maven-wrapper.jar +0 -0
- package/sts4/eclipse-language-servers/.mvn/wrapper/maven-wrapper.jar +0 -0
- package/sts4/headless-services/.mvn/wrapper/maven-wrapper.jar +0 -0
- package/sts4/headless-services/commons/commons-maven/src/test/resources/empty-boot-project-with-classpath-file/.mvn/wrapper/maven-wrapper.jar +0 -0
- package/sts4/headless-services/commons/commons-maven/src/test/resources/gs-rest-service-cors-boot-1.4.1-with-classpath-file/.mvn/wrapper/maven-wrapper.jar +0 -0
- package/sts4/headless-services/commons/commons-rewrite/src/test/resources/test-projects/test-maven-project-parser/.mvn/wrapper/maven-wrapper.jar +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Coc Language Server for Spring Boot
|
|
2
|
+
|
|
3
|
+
Coc spring boot extension and Language Server providing support for working with Spring Boot
|
|
4
|
+
`application.properties`, `application.yml` and `.java` files.
|
|
5
|
+
|
|
6
|
+
# Usage
|
|
7
|
+
|
|
8
|
+
The extension will automatically activate when you edit files with the following
|
|
9
|
+
name patterns:
|
|
10
|
+
|
|
11
|
+
This extension also provides a custom root directory where the spring boot binaries are to be found, in case you do not desire to use the one bundled with this extension
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"spring-boot.ls.directly": "/home/yourname/springboot"
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
You can also define your own patterns and map them to the language-ids
|
|
20
|
+
`spring-boot-properties` or `spring-boot-properties-yaml`
|
|
21
|
+
|
|
22
|
+
- `*.java` => activates Spring Boot specific support editing `.java` files.
|
|
23
|
+
- `application*.properties` => activates support for Spring Boot properties in `.properties`format.
|
|
24
|
+
- `application*.yml` => activates support for Spring Boot properties in `.yml` format.
|
|
25
|
+
|
|
26
|
+
# Functionality for `.java`
|
|
27
|
+
|
|
28
|
+
## Navigating the source code - Go to symbol in file/workspace
|
|
29
|
+
Easy navigation to Spring-specific elements of your source code.
|
|
30
|
+
|
|
31
|
+
* `@/` shows all defined request mappings (mapped path, request method, source location)
|
|
32
|
+
* `@+` shows all defined beans (bean name, bean type, source location)
|
|
33
|
+
* `@>` shows all functions (prototype implementation)
|
|
34
|
+
* `@` shows all Spring annotations in the code
|
|
35
|
+
* `//` shows all request mappings of all running Spring Boot apps and opens a browser for the selected endpoint
|
|
36
|
+
|
|
37
|
+
Easy navigation to Spring-specific elements of your source code.
|
|
38
|
+
* `@Prpofile`: shows information about the active profiles on the running apps
|
|
39
|
+
* `@Component`, `@Bean`, `@Autowired`: shows detailed information about the beans and their wiring from the live app
|
|
40
|
+
* `@ConditionalOn...`: shows information about the conditions and their evaluation at runtime
|
|
41
|
+
|
|
42
|
+
## Code templates
|
|
43
|
+
|
|
44
|
+
Write Spring code with templates, available via regular code completion.
|
|
45
|
+
|
|
46
|
+
* `@GetMapping`
|
|
47
|
+
* `@PostMapping`
|
|
48
|
+
* `@PutMapping`
|
|
49
|
+
|
|
50
|
+
## Smart code completions
|
|
51
|
+
Additional code completions for Spring-specific annotations
|
|
52
|
+
|
|
53
|
+
![Smart code completion for boot properties][java-code-completion]
|
|
54
|
+
|
|
55
|
+
### Examples
|
|
56
|
+
* `@Value`: code completion for Spring Boot property keys
|
|
57
|
+
* `@Scope`: code completion for standard scope names
|
|
58
|
+
|
|
59
|
+
# Functionality for `.properties` and `.yml`
|
|
60
|
+
|
|
61
|
+
This extension analyzes your project's classpath and parses and indexes any [Spring Boot
|
|
62
|
+
Properties Metadata](https://docs.spring.io/spring-boot/docs/current/reference/html/configuration-metadata.html) it finds. Both Maven and Gradle projects are supported.
|
|
63
|
+
|
|
64
|
+
The data in the index is used to provide validation, code completions and information
|
|
65
|
+
hovers while editing Spring Boot Properties in either `.properties` or `.yml` format.
|
|
66
|
+
|
|
67
|
+
## Validation
|
|
68
|
+
|
|
69
|
+
![application-yaml-validation][yaml-validation]
|
|
70
|
+
![application-properties-validation][properties-validation]
|
|
71
|
+
|
|
72
|
+
## Code Completions
|
|
73
|
+
|
|
74
|
+
![application-yaml-completions][yaml-completion]
|
|
75
|
+
|
|
76
|
+
![application-properties-completions][properties-completion]
|
package/build.sh
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
workdir=$(pwd)
|
|
5
|
+
|
|
6
|
+
rm -fr "${workdir}"/jars
|
|
7
|
+
mkdir -p "${workdir}"/jars
|
|
8
|
+
|
|
9
|
+
rm -fr "${workdir}"/language-server
|
|
10
|
+
mkdir -p "${workdir}"/language-server
|
|
11
|
+
|
|
12
|
+
modules=spring-boot-language-server,sts-gradle-model-plugin,:org.springframework.tooling.gradle,:org.springframework.tooling.jdt.ls.extension,:org.springframework.tooling.jdt.ls.commons,:org.springframework.tooling.jdt.ls.commons.test
|
|
13
|
+
cd "${workdir}"/sts4/headless-services/spring-boot-language-server
|
|
14
|
+
|
|
15
|
+
if command -v xvfb-run; then
|
|
16
|
+
echo "Using xvfb to run in headless environment..."
|
|
17
|
+
xvfb-run ../mvnw \
|
|
18
|
+
-DskipTests=true \
|
|
19
|
+
-DtrimStackTrace=false \
|
|
20
|
+
-f ../pom.xml \
|
|
21
|
+
-pl $modules \
|
|
22
|
+
-am \
|
|
23
|
+
-B \
|
|
24
|
+
clean install
|
|
25
|
+
else
|
|
26
|
+
../mvnw \
|
|
27
|
+
-DskipTests=true \
|
|
28
|
+
-DtrimStackTrace=false \
|
|
29
|
+
-f ../pom.xml \
|
|
30
|
+
-pl $modules \
|
|
31
|
+
-am \
|
|
32
|
+
-B \
|
|
33
|
+
clean install
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
cd ../xml-ls-extension
|
|
37
|
+
../mvnw \
|
|
38
|
+
-DskipTests=true \
|
|
39
|
+
-DtrimStackTrace=false \
|
|
40
|
+
-f ../pom.xml \
|
|
41
|
+
-pl xml-ls-extension \
|
|
42
|
+
-am \
|
|
43
|
+
-B \
|
|
44
|
+
clean install
|
|
45
|
+
|
|
46
|
+
cd ../jdt-ls-extension
|
|
47
|
+
../mvnw \
|
|
48
|
+
-DskipTests=true \
|
|
49
|
+
-DtrimStackTrace=false \
|
|
50
|
+
-f ../pom.xml \
|
|
51
|
+
-pl xml-ls-extension \
|
|
52
|
+
-am \
|
|
53
|
+
-B \
|
|
54
|
+
clean install
|
|
55
|
+
|
|
56
|
+
cd "${workdir}"/sts4/headless-services/spring-boot-language-server/target
|
|
57
|
+
server_jar_file=$(find . -name '*-exec.jar')
|
|
58
|
+
java -Djarmode=tools -jar "$server_jar_file" extract --destination "${workdir}"/language-server
|
|
59
|
+
|
|
60
|
+
cd "${workdir}"/sts4/headless-services/xml-ls-extension
|
|
61
|
+
find . -name "*-sources.jar" -delete
|
|
62
|
+
cp target/*.jar "${workdir}"/jars/xml-ls-extension.jar
|
|
63
|
+
cp target/dependencies/commons-lsp-extensions.jar "${workdir}"/jars/
|
|
64
|
+
|
|
65
|
+
cd "${workdir}"/sts4/headless-services/jdt-ls-extension
|
|
66
|
+
find . -name "*-sources.jar" -delete
|
|
67
|
+
cp org.springframework.tooling.jdt.ls.extension/target/*.jar "${workdir}"/jars/jdt-ls-extension.jar
|
|
68
|
+
cp org.springframework.tooling.jdt.ls.commons/target/*.jar "${workdir}"/jars/jdt-ls-commons.jar
|
|
69
|
+
cp org.springframework.tooling.gradle/target/*.jar "${workdir}"/jars/sts-gradle-tooling.jar
|
|
70
|
+
|
|
71
|
+
cp org.springframework.tooling.jdt.ls.commons/target/dependencies/io.projectreactor.reactor-core.jar "${workdir}"/jars/
|
|
72
|
+
cp org.springframework.tooling.jdt.ls.commons/target/dependencies/org.reactivestreams.reactive-streams.jar "${workdir}"/jars/
|
package/esbuild.mjs
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as esbuild from 'esbuild';
|
|
2
|
+
|
|
3
|
+
const options = {
|
|
4
|
+
entryPoints: ['src/index.ts'],
|
|
5
|
+
bundle: true,
|
|
6
|
+
minify: process.env.NODE_ENV === 'production',
|
|
7
|
+
sourcemap: process.env.NODE_ENV === 'development',
|
|
8
|
+
mainFields: ['module', 'main'],
|
|
9
|
+
external: ['coc.nvim'],
|
|
10
|
+
platform: 'node',
|
|
11
|
+
target: 'node18',
|
|
12
|
+
outfile: 'lib/index.js',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
if (process.argv.length > 2 && process.argv[2] === '--watch') {
|
|
16
|
+
const ctx = await esbuild.context(options);
|
|
17
|
+
await ctx.watch();
|
|
18
|
+
console.log('watching...');
|
|
19
|
+
} else {
|
|
20
|
+
const result = await esbuild.build(options);
|
|
21
|
+
if (result.errors.length) {
|
|
22
|
+
console.error(result.errors);
|
|
23
|
+
}
|
|
24
|
+
}
|