From 8c0f5ae4abe05b6a4d5cf508a28ab800a00f3425 Mon Sep 17 00:00:00 2001 From: Jeffrey Tse Date: Mon, 19 Feb 2024 20:33:10 +0800 Subject: [PATCH] fix: `coc-java` doesn't work * The error message TypeError: Cannot read properties of null (reading '0') Adding the version number of lombok to the actual lombok jar filename. For example changing "lombok.jar" to "lombok-1.18.30.jar". Make sure to follow to format precisely. * The running environment doesn't satisfy accordingly The tooling JDK will be used to launch the Language Server for Java. And by default, will also be used to compile your projects. Java 17 is the minimum required version. --- ansible/playbooks/nvim.yml | 4 ++-- nvim/coc-settings.json | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ansible/playbooks/nvim.yml b/ansible/playbooks/nvim.yml index aa9ee77..975327b 100644 --- a/ansible/playbooks/nvim.yml +++ b/ansible/playbooks/nvim.yml @@ -52,8 +52,8 @@ - name: Download the latest lombok.jar (https://projectlombok.org/) when: not ansible_check_mode ansible.builtin.get_url: - url: 'https://projectlombok.org/downloads/lombok.jar' - dest: '/usr/local/share/lombok/lombok.jar' + url: 'https://projectlombok.org/downloads/lombok-1.18.30.jar' + dest: '/usr/local/share/lombok/lombok-1.18.30.jar' mode: 0770 - name: Install pynvim (support `pyx` command) diff --git a/nvim/coc-settings.json b/nvim/coc-settings.json index 0b32e73..1bb5c5c 100755 --- a/nvim/coc-settings.json +++ b/nvim/coc-settings.json @@ -10,5 +10,7 @@ "java.format.enabled": true, "java.import.maven.enabled": true, "java.maven.downloadSources": true, - "java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m -javaagent:/usr/local/share/lombok/lombok.jar" + "java.jdt.ls.java.home": "~/.asdf/installs/java/openjdk-17.0.2", + "java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m -javaagent:/usr/local/share/lombok/lombok-1.18.30.jar", + "snippets.ultisnips.pythonPrompt": false }