Skip to content

Commit ccf3bcd

Browse files
committed
Update docs with new eclipselsp capabilities
1 parent be54c21 commit ccf3bcd

File tree

2 files changed

+23
-12
lines changed

2 files changed

+23
-12
lines changed

README.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ If you are working in an Android project then set the *g:android_sdk_path* with
2424

2525
Open a java, kotlin or xml source file and this plugin will automatically kick in and perform some tasks:
2626

27-
- Execute a custom vim gradle task to inspect the project and extract dependencies, project names, and android sdk versions.
28-
- Set CLASSPATH environment variable with the JAR dependencies of the project and the Android SDK jar.
27+
- Execute a custom vim gradle task to inspect the project and extract
28+
dependencies, project names, and android sdk versions.
29+
- Set CLASSPATH environment variable with the JAR dependencies of the project
30+
and the Android SDK jar.
2931
- Set SRCPATH environment variables with the project source sets.
3032
- Create Gradle and Android commands that can be used to invoke gradle tasks.
33+
- Send didChangeConfiguration notification with Gradle and Android dependencies to `eclipselsp` (jdtls) or `javalsp` (java-language-server) if you have them configured with [ALE](https://github.com/dense-analysis/ale)
3134

32-
Once the plugin finishes loading the Gradle command becomes available to use:
35+
Once the plugin finishes synchronizing gradle dependencies the Gradle command becomes available to use:
3336

3437
:Gradle <task>
3538

@@ -60,6 +63,10 @@ Combined with the ligthline plugin my status line looks like the following scree
6063
- Improved XML omnicompletion for android resource and manifest files. Thanks to [Donnie West](https://github.com/DonnieWest).
6164
- Customizable status line method that can be integrated with status line plugins (e.g. airline)
6265

66+
## ALE
67+
68+
In addition if you have [ALE](https://github.com/dense-analysis/ale) installed with either `eclipselsp` (recommended) or `javalsp` language servers, this plugin will send a [workspace/didChangeConfiguration](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_didChangeConfigurationmessage) notification to the language server with all gradle and Android dependencies. This enables ALE to auto-complete, auto-import, and go to definition of all dependencies, including Android core and generated classes (e.g. Activity, R, etc).
69+
6370
# Details
6471

6572
Refer to the [doc/vim-android.txt](doc/vim-android.txt) file for details on usage and configuration of this plugin.

doc/vim-android.txt

+13-9
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ ANDROID OMNI-COMPLETION *vim-android-omnicomplete*
210210

211211
This plugin by itself does not provide omni-completion of Android classes
212212
and/or methods. It is highly recommended to install ALE
213-
(https://github.com/w0rp/ale) with the `javalsp` LSP linter to get this
214-
functionality.
213+
(https://github.com/w0rp/ale) with the `eclipselsp` or `javalsp` LSP linter to get
214+
this functionality.
215215

216216

217217
------------------------------------------------------------------------------
@@ -354,25 +354,29 @@ vim to verify your setup:
354354
==============================================================================
355355
5. ALE Integration *vim-android-ale*
356356

357-
This plugin full potential is achieved when used in combination with the super
357+
This plugin full potential is achieved when used in combination with the
358358
ALE (https://github.com/w0rp/ale) plugin. When this plugin is installed and
359359
configured we get additional features:
360360

361-
- ALE with javalsp linter gets support for linting and auto-completing Android
362-
dependencies. No configuration required.
363-
- ALE gains a new `android` linter available for xml, java, kotlin, and groovy
364-
files. You need to add `android` to these file types in your |g:ale_linters|
365-
configuration.
361+
- ALE with eclipselsp (jdtls) or javalsp linter gets support for
362+
linting, auto-completing, import, and go to definition of Android
363+
dependencies.
364+
- ALE gains a new `android` linter available for xml, java, kotlin, and
365+
groovy files. You need to add `android` to these file types in your
366+
|g:ale_linters| configuration.
366367
- vim-android benefits from all linters/fixers available in ALE like
367368
checkstyle, google_format, etc.
368369
- vim-android benefits from ALE auto-completion for java/kotlin files.
369370

370371
Example configuration for best ALE/vim-android combination:
371372
>
373+
let g:gradle_loclist_show = 0
374+
let g:gradle_show_signs = 0
375+
372376
let g:ale_linters = {
373377
\ 'xml': ['android'],
374378
\ 'groovy': ['android'],
375-
\ 'java': ['android', 'checkstyle', 'javalsp'],
379+
\ 'java': ['android', 'checkstyle', 'eclipselsp'],
376380
\ 'kotlin': ['android', 'ktlint', 'languageserver']
377381
\ }
378382
<

0 commit comments

Comments
 (0)