You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Oct 22 2024 20:01:46)
macOS version - arm64
Operating System:
Mac OS Sequoia 15.0.1 (24A348)
What went wrong
I am NOT a Java expert and I am trying to setup Java development in vim. I set up javalsp via Ale.
Completed the setup instructions for java-language-server and put together a very very simple java project. java-tutorial-main.zip
Adding the zip file of the java project in the attachment.
Then I try to jump to the definition of a class that is in an external dependency, ALE cannot process the uri in the language-server's response.
For example in the code ( Word.java from the java-tutorial-main.zip file)
package com.ahakanbaba.java_tutorial;
import lombok.Data;
@Data
public class Word {
private String value;
public Word(String value) {
this.value = value;
}
}
When I do :ALEGoToDefinition on lombok.Data, the java-language-server request-response looks like this
Then through ALE, vim tries to open this file
"jar:file:///Users/hakanbaba/.gradle/caches/modules-2/files-2.1/org.projectlombok/lombok/1.18.34/861d5074b9a04a7f1c1e128584a66b2b815fc3d4/lombok-1.18.34-sources.jar!/lombok/Data.java" [New DIRECTORY]
Instead of finding the file lombok/Data.java file inside the given jar archive.
Reproducing the bug
Install a Java-Runtime
Unzip the java-tutorial-main.zip.
Run ./gradlew build idea at the project root directory
Navigate to Word.java.
Call :ALEGoToDefinition at the lombok.Data import.
:ALEInfo
Current Filetype: java
Available Linters: ['checkstyle', 'cspell', 'eclipselsp', 'javac', 'javalsp', 'pmd']
Linter Aliases:
'javalsp' -> ['java_language_server']
Enabled Linters: ['javalsp']
Ignored Linters: []
Suggested Fixers:
'clang-format' - Fix C, C++, C#, CUDA, Java, JavaScript, JSON, ObjectiveC and Protobuf files with clang-format.
'google_java_format' - Fix Java files with google-java-format.
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
'uncrustify' - Fix C, C++, C#, ObjectiveC, ObjectiveC++, D, Java, Pawn, and VALA files with uncrustify.
Linter Variables:
let g:ale_java_javalsp_config = {'java': {'externalDependencies': ['org.projectlombok:lombok:1.18.34', 'junit:junit:4.13.2'], 'classPath': []}}
let g:ale_java_javalsp_executable = 'java-language-server'
Global Variables:
let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
let g:ale_disable_lsp = 'auto'
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 1
let g:ale_fixers = {'*': ['remove_trailing_lines', 'trim_whitespace']}
let b:ale_fixers = ['google_java_format']
let g:ale_history_enabled = 1
let g:ale_info_default_mode = 'preview'
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'never'
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let b:ale_linters = ['javalsp']
let g:ale_linters_explicit = 0
let g:ale_linters_ignore = {}
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_root = {}
let g:ale_set_balloons = 0
let g:ale_set_highlights = 0
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = 'E'
let g:ale_sign_info = 'I'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = 'E'
let g:ale_sign_style_warning = 'W'
let g:ale_sign_warning = 'W'
let g:ale_sign_highlight_linenrs = 0
let g:ale_type_map = {}
let g:ale_use_neovim_diagnostics_api = 0
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 'all'
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
Command History:
(started) ['/bin/bash', '-c', '''java-language-server''']
The java-language-server executable is merely this
#!/bin/bash
pid=$$
tee /Users/hakanbaba/misc/java-language-server_in_${pid}.log | /Users/hakanbaba/src/georgewfraser/java-language-server/dist/lang_server_mac.sh | tee /Users/hakanbaba/misc/java-language-server_out_${pid}.log
The text was updated successfully, but these errors were encountered:
Information
VIM version
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Oct 22 2024 20:01:46)
macOS version - arm64
Operating System:
Mac OS Sequoia 15.0.1 (24A348)
What went wrong
I am NOT a Java expert and I am trying to setup Java development in vim. I set up javalsp via Ale.
Completed the setup instructions for java-language-server and put together a very very simple java project.
java-tutorial-main.zip
Adding the zip file of the java project in the attachment.
Then I try to jump to the definition of a class that is in an external dependency, ALE cannot process the uri in the language-server's response.
For example in the code (
Word.java
from the java-tutorial-main.zip file)When I do
:ALEGoToDefinition
on lombok.Data, the java-language-server request-response looks like thisThe location in the language-server's response looks correct to me.
That is the jar file from the gradle cache. When I extract the tar file and find the lombok/Data.java, the contents looks correct to me.
The LSP defintion.vim handler in Ale cannot handle this response.
The result here looks like this
Then the item_list here looks like this
Then through ALE, vim tries to open this file
"jar:file:///Users/hakanbaba/.gradle/caches/modules-2/files-2.1/org.projectlombok/lombok/1.18.34/861d5074b9a04a7f1c1e128584a66b2b815fc3d4/lombok-1.18.34-sources.jar!/lombok/Data.java" [New DIRECTORY]
Instead of finding the file
lombok/Data.java
file inside the given jar archive.Reproducing the bug
./gradlew build idea
at the project root directoryWord.java
.lombok.Data
import.:ALEInfo
The
java-language-server
executable is merely thisThe text was updated successfully, but these errors were encountered: