Skip to content

Commit 2c8693d

Browse files
committed
Merge branch 'master' into docker
Add docker configuration to Travis deployments and use Maven publish plugin to deploy to the GitHub package repo
2 parents b14272c + 38ede38 commit 2c8693d

File tree

235 files changed

+6800
-13076
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

235 files changed

+6800
-13076
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root=true
2+
3+
[*]
4+
charset=utf-8
5+
end_of_line=lf
6+
insert_final_newline=true
7+
indent_style=space
8+
indent_size=4
9+
trim_trailing_whitespace=true
10+
11+
[.travis.yml]
12+
indent_size=2

.gitignore

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
.settings/
1+
.settings
22
.classpath
33
.project
44
.factorypath
55
.gradle
66

7-
.idea/
7+
.idea
88
*.iml
99

10-
lib-kotlin/
11-
bin/
12-
build/
13-
target/
14-
out/
10+
lib-kotlin
11+
bin
12+
build
13+
target
14+
out
15+
__pycache__
1516
*.vsix
1617

17-
node_modules/
18-
.vscode-test/
18+
node_modules
19+
.vscode-test
1920

20-
.DS_STORE
21+
.DS_Store

.travis.yml

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,47 @@
11
language: java
2+
dist: trusty
23

34
services:
45
- docker
56

7+
jdk:
8+
- openjdk8
9+
- oraclejdk11
10+
11+
env: NODE_VERSION=10.2.1
12+
before_install: nvm install $NODE_VERSION
613
script:
7-
- ./gradlew build
8-
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
9-
- docker build ./ -t donniewest/kotlinlanguageserver:latest
10-
- docker push donniewest/kotlinlanguageserver:latest
14+
- ./gradlew :shared:test -i
15+
- ./gradlew :server:test -i
16+
17+
jobs:
18+
include:
19+
- stage: "Deploy"
20+
before_deploy:
21+
- ./gradlew :server:distZip
22+
- ./gradlew :grammars:distZip
23+
- docker login docker.pkg.github.com -u fwcd -p "$DOCKER_PASSWORD"
24+
- docker build -t docker.pkg.github.com/fwcd/kotlin-language-server:latest .
25+
- docker push fwcd/kotlin-language-server:latest
26+
deploy:
27+
- provider: releases
28+
api_key:
29+
secure: "DQLsAAtr2u2X494FOR1Q3P181M+dWbT7jLkxJRxrgRQdGipeYcUp0c9/+uyEF7o4N3i4uCAWSh4yHJ0hGtOir/L9vd/EljftIU8d/qxDduuw9mmt6/7tVOzuQ3I8+Zap5XVXgDDSO0fsiwEBEShTbqCEdhzNJ2ZVbgd/C1N8dOfObmcRHtGuxox35TmbLlOoPCXEqsnirQFxxyH5e/G2DTnrUBpZ5ZeCJJsPzVxZzvTOMPwW4EeuOk9vYPPYQqfpQdJYiSwrlN+s6ELHHs7rJQhXUAzjiaJN5C/JxEPeCcFGZ9kak168tFp8ud6l+TGaT2ViuvChWIbKb3rJvHfIIKRtDGXi6vSR55Zj0p+EelIStRsUarru/Mhewocawmlwh4RPWvefD27FntHvzCW8tC2WoBo1VMYZdQ1Qcla/QN5psyLSr8XlaeFfBZgo66rctwb0opDtDROZ0oqlYq+CMcWEj0/TtRpQxWyzlNj2r4AomGKoqtaQWXfErMKbr3m24NhSq+4IWb7m8dx6WhcFOpTaWMmGyGoGDu8RNBQerigj2qd8hoIeC9U0VJNSh3DzF12jj3cYoIT4PVwAibQHIz9dhIMjdgwDgRKFGH/PFtKSPXVAtQGhfJA6gP/6qCMMEKHRYeFExhlCJtko0zBxeBToqJoEqKVojb72dclFG5o="
30+
file_glob: true
31+
file:
32+
- "server/build/distributions/*.zip"
33+
- "grammars/build/distributions/*.zip"
34+
skip_cleanup: true
35+
name: "Version $TRAVIS_TAG"
36+
on:
37+
tags: true
38+
repo: fwcd/kotlin-language-server
39+
- provider: script
40+
script:
41+
- ./gradlew :shared:publish
42+
skip_cleanup: true
43+
- provider: script
44+
script:
45+
- docker login docker.pkg.github.com -u fwcd -p "$DOCKER_PASSWORD"
46+
- docker build -t docker.pkg.github.com/fwcd/kotlin-language-server:latest .
47+
- docker push fwcd/kotlin-language-server:latest

.vscode/launch.json

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,26 @@
1-
// A launch configuration that compiles the extension and then opens it inside a new window
2-
// Use IntelliSense to learn about possible attributes.
3-
// Hover to view descriptions of existing attributes.
4-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
51
{
6-
"version": "0.2.0",
2+
"version": "0.2.0",
73
"configurations": [
84
{
9-
"name": "Extension",
10-
"type": "extensionHost",
5+
"type": "kotlin",
116
"request": "launch",
12-
"runtimeExecutable": "${execPath}",
13-
"args": [
14-
"--extensionDevelopmentPath=${workspaceFolder}"
15-
],
16-
"outFiles": [
17-
"${workspaceFolder}/out/**/*.js"
18-
],
19-
"preLaunchTask": "npm: watch"
7+
"name": "Kotlin Launch",
8+
"projectRoot": "${workspaceFolder}/server",
9+
"mainClass": "org.javacs.kt.MainKt"
2010
},
2111
{
22-
"name": "Extension Tests",
23-
"type": "extensionHost",
24-
"request": "launch",
25-
"runtimeExecutable": "${execPath}",
26-
"args": [
27-
"--extensionDevelopmentPath=${workspaceFolder}",
28-
"--extensionTestsPath=${workspaceFolder}/out/test"
29-
],
30-
"outFiles": [
31-
"${workspaceFolder}/out/test/**/*.js"
32-
],
33-
"preLaunchTask": "npm: watch"
12+
"type": "java",
13+
"name": "Attach Kotlin Language Server",
14+
"request": "attach",
15+
"hostName": "localhost",
16+
"port": 8000
17+
},
18+
{
19+
"type": "java",
20+
"name": "Debug Tests",
21+
"request": "attach",
22+
"hostName": "localhost",
23+
"port": 5005
3424
}
3525
]
3626
}

.vscode/settings.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

.vscode/tasks.json

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,15 @@
33
{
44
"version": "2.0.0",
55
"tasks": [
6-
{
7-
"type": "npm",
8-
"script": "watch",
9-
"problemMatcher": "$tsc-watch",
10-
"isBackground": true,
11-
"presentation": {
12-
"reveal": "never"
13-
}
14-
},
156
{
167
"label": "Build with Gradle",
178
"type": "shell",
18-
"command": "gradle build -x test",
9+
"command": "gradle build",
1910
"problemMatcher": [],
2011
"group": {
2112
"kind": "build",
2213
"isDefault": true
2314
}
2415
}
2516
]
26-
}
17+
}

.vscodeignore

Lines changed: 0 additions & 17 deletions
This file was deleted.

BUILDING.md

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,51 @@
11
# Building
2-
Contains the commands require to build this project. Note that you might need to use `gradlew` instead of `./gradlew` when running on `cmd.exe`.
2+
Describes how to build and run the language server and the editor extensions.
33

4-
## Setting up the development environment
5-
* Java should be installed and located under JAVA_HOME or PATH
4+
## Setup
5+
* Java 8+ should be installed and located under `JAVA_HOME` or `PATH`.
6+
* Note that you might need to use `gradlew` instead of `./gradlew` for the commands on Windows.
67

7-
### For language server development
8-
* `./gradlew install`
8+
## Language Server
99

10-
### For extension development
11-
* VSCode is required
12-
* `npm install`
13-
* `npm install -g vsce`
10+
### Building
11+
If you just want to build the language server and use its binaries in your client of choice, run:
1412

15-
## Building the Language Server
16-
* With Testing:
17-
* `./gradlew build`
18-
* Without Testing:
19-
* `./gradlew build -x test`
20-
* Start scripts for the language server are located under `build/install/kotlin-language-server/bin/`
13+
>`./gradlew :server:installDist`
2114
22-
## Testing the Language Server
23-
* `./gradlew test`
15+
The language server executable is now located under `server/build/install/server/bin/kotlin-language-server`. (Depending on your language client, you might want to add it to your `PATH`)
2416

25-
## Running/Debugging the VSCode extension
26-
* Open the debug tab in VSCode
27-
* Run the `Extension` launch configuration
17+
Note that there are external dependent libraries, so if you want to put the server somewhere else, you have to move the entire `install`-directory.
2818

29-
## Packaging the VSCode extension
30-
* `vsce package -o build.vsix`
31-
* The extension is located as `build.vsix` in the repository folder
19+
### Packaging
20+
To create a ZIP-archive of the language server, run:
21+
22+
>`./gradlew :server:distZip`
23+
24+
## Grammars
25+
26+
### Packaging
27+
To create a ZIP-archive of the grammars, run:
28+
29+
>`./gradlew :grammars:distZip`
30+
31+
## Gradle Tasks
32+
This paragraph assumes that you are familiar with Gradle's [task system](https://docs.gradle.org/current/userguide/build_lifecycle.html). In short: Every task describes an atomic piece of work and may depend on other tasks. Task dependencies will automatically be executed. The following subsections describe the available tasks for each module of this project.
33+
34+
### Language Server (:server)
35+
36+
| Task | Command | Description |
37+
| ---- | ------- | ----------- |
38+
| Package | `./gradlew :server:installDist` | Packages the language server as a bundle of JAR files (e.g. for use with an editor extension) |
39+
| Package for Debugging | `./gradlew :server:installDebugDist` | Packages the language server with a debug launch configuration |
40+
| Test | `./gradlew :server:test` | Executes all unit tests |
41+
| Run | `./gradlew :server:run` | Runs the standalone language server from the command line |
42+
| Debug | `./gradlew :server:debugRun` | Launches the standalone language server from the command line using a debug configuration |
43+
| Build | `./gradlew :server:build` | Builds, tests and packages the language server |
44+
| Package for Release | `./gradlew :server:distZip` | Creates a release zip in `server/build/distributions`. If any dependencies have changed since the last release, a new license report should be generated and placed in `src/main/dist` before creating the distribution. |
45+
| Generate License Report | `./gradlew :server:licenseReport` | Generates a license report from the dependencies in `server/build/reports/licenses` |
46+
47+
### Grammars (:grammars)
48+
49+
| Task | Command | Description |
50+
| ---- | ------- | ----------- |
51+
| Package for Release | `./gradlew :grammars:distZip` | Creates a zip of the grammars in `grammars/build/distributions` |

CHANGELOG.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,58 @@
11
# Change Log
2-
All notable changes to the "kotlin" extension will be documented in this file.
2+
All notable changes to the language server will be documented in this file.
33

44
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
55

6+
## [0.4.0]
7+
- Add support for Kotlin DSL buildscripts
8+
- Add support for non-Maven/Gradle projects
9+
- Improve Java-to-Kotlin converter
10+
- Use the Field icon instead of Property icon in completion lists
11+
- Add experimental support for multiplatform projects
12+
- Introduce the 'kls' URI scheme
13+
14+
## [0.3.0]
15+
- Improve trailing lambda completions
16+
- Provide completions for generic extension methods
17+
18+
## [0.2.9]
19+
- Include a grammar ZIP in the release assets
20+
21+
## [0.2.8]
22+
- Include grammars distribution in release
23+
24+
## [0.2.7]
25+
- Improve release naming
26+
27+
## [0.2.6]
28+
- Remove version postfix from ZIP distributions
29+
30+
## [0.2.5]
31+
- Move editor extensions into separate repositories
32+
33+
## [0.2.0]
34+
- Rewrite Java-to-Kotlin converter from scratch
35+
- Implement Kotlin formatter
36+
- Add keyword completions
37+
- Make completions more reliable
38+
39+
## [0.1.13]
40+
- Kotlin 1.3.11 support
41+
- Detailed completion signatures for overloaded methods
42+
- Updated to VSCode ^1.30.2
43+
- Improved dependency resolution logs
44+
45+
## [0.1.12]
46+
- Kotlin 1.2.70 support
47+
48+
## [0.1.11]
49+
- Improved keyword syntax highlighting
50+
51+
## [0.1.10]
52+
- More compact distribution
53+
- Security fixes
54+
- Fixed decompiler
55+
656
## [0.1.6]
757
- Bugfixes related to Gradle dependency resolution in combination with Android projects
858

EDITORS.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Editor Integration
2+
3+
## Visual Studio Code
4+
See [vscode-kotlin-ide](https://github.com/fwcd/vscode-kotlin-ide) or install the extension from the [marketplace](https://marketplace.visualstudio.com/items?itemName=fwcd.kotlin).
5+
6+
## Atom
7+
See [atom-ide-kotlin](https://github.com/fwcd/atom-ide-kotlin).
8+
9+
## Emacs
10+
_using [`lsp-mode`](https://github.com/emacs-lsp/lsp-mode)_
11+
12+
Add the language server executable to your `PATH`.
13+
14+
## Vim
15+
_using [`LanguageClient-neovim`](https://github.com/autozimu/LanguageClient-neovim)_
16+
17+
Add the language server to your `PATH` and include the following configuration in your `.vimrc`:
18+
19+
```vim
20+
autocmd BufReadPost *.kt setlocal filetype=kotlin
21+
22+
let g:LanguageClient_serverCommands = {
23+
\ 'kotlin': ["kotlin-language-server"],
24+
\ }
25+
```
26+
27+
_using [`coc.nvim`](https://github.com/neoclide/coc.nvim)_
28+
29+
Add the following to your coc-settings.json file:
30+
31+
```json
32+
{
33+
"languageserver": {
34+
"kotlin": {
35+
"command": "[path to cloned language server]/server/build/install/server/bin/kotlin-language-server",
36+
"filetypes": ["kotlin"]
37+
}
38+
}
39+
}
40+
```
41+
42+
Note that you may need to substitute `kotlin-language-server` with `kotlin-language-server.bat` on Windows.
43+
44+
## Other Editors
45+
Install a [Language Server Protocol client](https://microsoft.github.io/language-server-protocol/implementors/tools/) for your tool. Then invoke the language server executable in a client-specific way. The server uses `stdio` to send and receive `JSON-RPC` messages.

0 commit comments

Comments
 (0)