Giter Club home page Giter Club logo

coc-java's Introduction

Neoclide

Neoclide is a rework of Nyaovim, the reason is I want it have best user experience.

Neoclide is an editor built with web technologies while emebed with neovim.

Neoclide is in early development, which means it could break easily, and you should not take it seriously.

Since I use Mac only, something could break on other platform, I need your help!

What have done

  • Global session save and restore
  • Fixed copy/paste behaviour
  • Fixed drag and click position calculate
  • Fixed trigger of VimLeave event
  • Background transparent support
  • Improved input method support
  • Improved cursor support
  • Accessable editor state object
  • Automatic resize handler, no screen blink

How to use

Since it's in early age, no prebuild currently avaiable, you have to use it from souce code.

  • Clone this repository

  • Run following commands to install dependencies and build code

    npm run dep
    npm run build
    
  • To start the app, use:

    npm run app
    

LICENSE

Copyright 2016 [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

coc-java's People

Contributors

adamansky avatar cbb330 avatar chemzqm avatar dansomething avatar dob9601 avatar fannheyward avatar frederick888 avatar gagara avatar idanarye avatar jackielii avatar kiancross avatar kovetskiy avatar milind-shakya-sp avatar mrcjkb avatar msbatarce avatar ontonator avatar p10q avatar patrickpichler avatar smhc avatar taz03 avatar uzxmx avatar xodder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

coc-java's Issues

Javadoc is not displayed when calling CocAction('doHover')

I am using OpenJDK 11 on Debian and have the corresponding doc package installed. Previously, I was getting javadoc info from the OpenJDK doc package when calling CocAction('doHover'). Now when I call CocAction('doHover') (using a keymapping or the command prompt) with the cursor on a keyword like String, I do not get the javadoc info from the doc package in the preview window like I did before. Instead I get this:
image

This is the information I was seeing before I installed the doc package.

I don't know if it's related, but I started having this problem after I applied the fix for #15. Before that, I was getting the correct documentation.

I updated the server from jdt-language-server-0.36.0-201903201910 to jdt-language-server-0.36.1-201904020132 by running :CocCommand java.updateLanguageServer to see if that would fix the issue, but it did not.

This is the trace I get when i try to get the hover info:

[Trace - 3:45:08 PM] Sending request 'textDocument/hover - (5)'.
Params: {
    "textDocument": {
        "uri": "file:///home/user/udemy/maven/mb2g-lombok/src/main/java/guru/springframework/model/User.java"
    },
    "position": {
        "line": 12,
        "character": 14
    }
}


[Trace - 3:45:08 PM] Received response 'textDocument/hover - (5)' in 56ms.
Result: {
    "contents": {
        "language": "java",
        "value": "java.lang.String"
    }
}

The import com.foo.bar.baz cannot be resolved

I am getting module resolution errors from coc.nvim in my projects when the imports reference external modules. When I open the same project using VSCode, Eclipse, or IntelliJ, I do not get the resolution errors. I'm trying to root-cause why coc-java is having the issue with the language server when VSCode is not. Do you have any tips regarding configuration that might be helpful?

jdt.ls crashes with this plugin, works with vim-lsp

When I've tried to use coc-java, the server seems to never start up, and I end up with a number of log files in my working directory indicating errors.

The same versions of jdt.ls working with vim-lsp with the configuration below:

autocmd User lsp_setup call lsp#register_server({
    \ 'name': 'eclipse.jdt.ls',
    \ 'cmd': {server_info->[
    \   'java',
    \   '-Declipse.application=org.eclipse.jdt.ls.core.id1',
    \   '-Dosgi.bundles.defaultStartLevel=4',
    \   '-Declipse.product=org.eclipse.jdt.ls.core.product',
    \   '-Dlog.level=ALL',
    \   '-noverify',
    \   '-Dfile.encoding=UTF-8',
    \   '-Xmx1G',
    \   '-jar',
    \   expand('~/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/plugins/org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar'),
    \   '-configuration',
    \   expand('~/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/config_linux'),
    \   '-data',
    \   expand('~/eclipse.jdt.ls/workspace')
    \ ]},
    \ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'build.gradle'))},
    \ 'whitelist': ['java'],
    \ })

Error logs that appear in the working directories with coc-java:
hs_err_pid1726.log
hs_err_pid1748.log
hs_err_pid1776.log
hs_err_pid1805.log
hs_err_pid1832.log

These errors were produced with the same jdt.ls. Before that I was using the default config / jdt.ls downloaded by the plugin with the same effect.

my coc-settings.json:

{
  "languageserver": {
    "clangd": {
      "command": "clangd",
      "args": ["--background-index"],
      "rootPatterns": ["compile_flags.txt", "compile_commands.json", ".vim/", ".git/", ".hg/"],
      "filetypes": ["c", "cpp", "objc", "objcpp"]
    }
  },
  "java.jdt.ls.home": "/home/stephen/eclipse.jdt.ls",
  "java.trace.server": "verbose",
  "java.import.gradle.wrapper.enabled": true
}

Operating System: ArchLinux ARM
Arch: aarch64

Error starting jdt language server downloaded by coc-java

I am using nvim v0.3.4. I have installed coc.nvim using nvim's builtin package manager and running :call coc#util#install() in nvim and the installation completed successfully. Yarn was installed automatically during the installation, so I opened nvim in a new terminal to install coc-java. When I ran :CocInstall coc-java. The installation stopped without installing coc-java and gave a message complaining that yarn was already installed and that I should remove it (I don't think that should have happened). I removed yarn and reran :CocInstall coc-java which then succeeded and resulted in jdt ls being downloaded. I closed nvim and ran nvim hello.java from the terminal to create a new java file to try out the plugin. Nvim immediatley gave me this error message:

[coc.nvim] JDT Language Server starting at /home/user/java
[coc.nvim] Error output from java: Connection to server is erroring. Shutting down server.
[coc.nvim] Error output from java: Connection to server is erroring. Shutting down server.
[coc.nvim] Error output from java: Connection to server is erroring. Shutting down server.
[vim-node-coc]: Uncaught exception: TypeError: Cannot convert object to primitive value
at ChildProcess.client_1.BaseLanguageClient.createMessageTransports.serverProcess.on.code (/snapshot/coc.nvim/lib/language-client/index.js:348:39)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)

I am just trying to create a single "hello world" java file; I am not creating a project of any kind. I saw that someone had this error when trying to use their own separate jdt ls installation, but I am using the server installed by coc-java. Have I missed something?

Can't properly uninstall

Hello there!

I have an issue regarding uninstalling coc-java.

I am using a neovim configuration which got Coc and coc-java included. I also raised an issue there but this might be related to coc-java.

So Coc is installed over Plug. And various coc extensioned are installed:

All extensions ```vim let g:coc_global_extensions = [ \'coc-html', \'coc-xml', \'coc-java', \'coc-ccls', \'coc-powershell', \'coc-r-lsp', \'coc-vimlsp', \'coc-lua', \'coc-sql', \'coc-go', \'coc-css', \'coc-sh', \'coc-snippets', \'coc-prettier', \'coc-eslint', \'coc-emmet', \'coc-tsserver', \'coc-translator', \'coc-fish', \'coc-docker', \'coc-pairs', \'coc-json', \'coc-python', \'coc-imselect', \'coc-highlight', \'coc-git', \'coc-github', \'coc-gitignore', \'coc-emoji', \'coc-lists', \'coc-post', \'coc-stylelint', \'coc-yaml', \'coc-template', \'coc-tabnine', \'coc-utils' \] ```

I was always getting an interactive message output, because I do not have the java jdk installed.

The java.home variable defined in settings does not point to a JDK., Get the Java Development Kit?:
1. Yes
2. No

However, as I do not need the java part I simply uninstalled the coc-java package, removed it from the extenionlist and rebuild it.

Steps taken:

  • Remove coc-java from plugin-settings.vim
  • Uninstall coc-java plugin CocUninstall coc-java
  • Remove java.home from coc-settings.json
  • Delete .config/coc/extensions
  • Run :CocRebuild

However, I am still getting the propmt (now slightly different)

Java runtime could not be located, Get the Java Development Kit?:
1. Yes
2. No

Which I guess comes from coc-java, which should be uninstalled?

Second proposal

I have encountered the same problem ๐Ÿ˜ฅ

But there is a little different thing, I am using Linux.
I did a few tests, it seems that JDT will scan my root directory, some files will fail to scan when there are insufficient permissions or other files themselves.
At the same time, a new problem has arisen. The initialization time of the plugin is very long. Many friends around me are complaining about this matter.

  • Some information flashed past my status bar, I tried to intercept this several times.

It may be that you are collecting information about the problem.

So.Please solve the problem in time ๐Ÿ˜ƒ


@chemzqm But WSL works well, Windows got invalid root path

If I use gvim open project on Windows, the messages like this:

D:\Work\ops
"src\main\java\com\xxx\controller\BlockIpController.java" [unix] 60L, 2198C
[coc.nvim] Using java from d:\Program Files\Java\jdk1.8.0_161, version: 8
[coc.nvim] JDT Language Server starting at ops
[coc.nvim] JDT Language Server error Failed to scan D:\ops

Seems the JDT not work on the right workspace, that cause complete not works well

If chdir to project folder in vim, still got JDT Language Server error Failed to scan D:\ops

Finally, I solved this problem by these steps:

  1. use teminal chdir to project folder, open gvim
  2. open source files then JDT can scan for whole project correctly, then can complete for 3rd party class

The problem is I cannot use chdir in vim, otherwise will cause JDT scan failed error, so the rootPath detect mechanism and JDT parameter should be improved to support open project directly in vim when I need to change current workspace

Originally posted by @rickywu in #40 (comment)

Can not use java.jdt.ls.home

When I set java.jdt.ls.home to a jdtls folder, coc-java gives the following error:

[coc.nvim] JDT Language Server starting at /home/luiz/Documents/learning/java/FirstApp
[coc.nvim] Error output from java: Connection to server is erroring. Shutting down server.
[coc.nvim] Error output from java: Connection to server is erroring. Shutting down server.
[coc.nvim] Error output from java: Connection to server is erroring. Shutting down server.
[vim-node-coc]: Uncaught exception: TypeError: Cannot convert object to primitive value
at ChildProcess.client_1.BaseLanguageClient.createMessageTransports.serverProcess.on.code (/snapshot/coc.nvim/lib/language-client/index.js:347:35)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)

Steps:

  1. install coc-java (:CocInstall coc-java)
  2. download the lastest snapshot of jdtls on http://download.eclipse.org/jdtls/snapshots/jdt-language-server-latest.tar.gz
  3. decompress the tar.gz to a local folder (/home/luiz/jdtls in my case)
  4. add java.jdt.ls.home in coc-settings.json ("java.jdt.ls.home" : "/home/luiz/jdtls" in my case)
  5. open some java file

Additional directories with build-helper-maven-plugin are ignored

I've a project where code is generated and the location is defined with build-helper-maven-plugin. It's currently not recognized and therefore leads to errors for those imports.

pom.xml

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generated-folder</id>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${basedir}/src-gen/main/java</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Related

redhat-developer/vscode-java#177

Add option to disable automatic comment completion

Typing /* in a .java file with this plugin installed automatically completes the */. I tried various plugin settings that look relevant but couldn't find a way to turn this of.

Can you add a setting to disable this automatic completion?

Extract to variable and function

I've tried to extract to a variable or method and it seem this capabilities are not yet supported, would be great to have these

http-timer package not found when installing/updating plugin

Hello,
Used to use coc-json without any problem but today I tried to update the plugin and I got an error:

CocInstall coc-java

yarn add v1.10.1
warning package.json: No license field
warning No license field
[1/4] ๐Ÿ”  Resolving packages...
error Couldn't find package "@szmarczak/http-timer@^1.1.2" required by "got@^9.6.0" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

I have the same result if I do a yarn add coc-java.
Do you have any idea how I can fix that?
Thanks

Error: /usr/lib/jvm/java-11-openjdk/bin/java exited with code: 13

After opening a file in a small project I get the following errors:

## versions

vim version: NVIM v0.3.4
node version: v11.7.0
coc.nvim version: 0.0.65
term: xterm-256color
platform: linux

## Error messages

## Output channel: prettier

## Output channel: highlight
[Info  - 00:56:10] Highlight server running in node v11.7.0

## Output channel: java
[Info  - 00:56:12] Connection to server got closed. Server will restart.
[Error  - 00:56:12] /usr/lib/jvm/java-11-openjdk/bin/java exited with code: 13
[Info  - 00:56:14] Connection to server got closed. Server will restart.
[Error  - 00:56:14] /usr/lib/jvm/java-11-openjdk/bin/java exited with code: 13

The odd thing is that if I create a testfile Test.java in its own directory and open it, JDT Language Server starts just fine.

Doesn't recognize JDK from JDK_HOME

Seems Coc doesn't recognize the JDK from the JDK_HOME when it point to a symlink.

For example:

$ echo $JAVA_HOME
/etc/java-config-2/current-system-vm
$ ls -l /etc/java-config-2/current-system-vm
lrwxrwxrwx 1 root root 32 19 nov  2017 /etc/java-config-2/current-system-vm -> /usr/lib/jvm/oracle-jre-bin-1.8/

Coc doesn't recognize the JDK

If I change $JAVA_HOME so:

$ export JDK_HOME=/usr/lib/jvm/oracle-jdk-bin-1.8/

Coc works fine!

SO: Gentoo Linux
coc-java: 1.4.2

test.java does not resolve to a ICompilationUnit

Coc-java does not provide any completion or syntax checking in .java files. The JDT language server seems to start fine but nothing works. Upon saving the file CocInfo reports a does not resolve to a ICompilationUnit error.

[Info  - 1:57:18 PM] JDT Language Server started
[object Object]
[Error  - 1:57:22 PM] Oct. 6, 2019, 1:57:21 p.m. file:///home/Azeez/tmp/test.java does not resolve to a ICompilationUnit
[Error  - 2:02:10 PM] Oct. 6, 2019, 2:02:10 p.m. file:///home/Azeez/tmp/test.java does not resolve to a ICompilationUnit

I'm using vim8 on Cygwin with coc.nvim. I was able to get c++ completion and syntax checking working, so coc.nvim should be working fine.

echo $JAVA_HOME                                                                                                                                                            
C:\Program Files\OpenJDK\jdk-12.0.2

java.open.serverLog:

!SESSION 2019-10-06 13:55:54.082 -----------------------------------------------
eclipse.buildId=unknown
java.version=12.0.2
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_CA
Command-line arguments:  -data C:\home\Azeez\.config\coc\extensions\coc-java-data\jdt_ws_2987ba7a0b84d3737abf1a0a28a03f35

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:55:58.973
!MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:55:59.337
!MESSAGE Main thread is waiting

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:55:59.400
!MESSAGE >> initialize

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:55:59.404
!MESSAGE Initializing Java Language Server 0.45.0.201910051807

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:55:59.440
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:55:59.444
!MESSAGE Non-Static Commands: [java.edit.organizeImports, java.project.updateSourceAttachment, java.project.removeFromSourcePath, java.project.listSourcePaths, java.project.resolveSourceAttachment, java.project.addToSourcePath]

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:55:59.501
!MESSAGE >> initialized

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:55:59.581
!MESSAGE Creating the Java project jdt.ls-java-project

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:56:00.506
!MESSAGE Finished creating the Java project jdt.ls-java-project

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:18.993
!MESSAGE Workspace initialized in 79540ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:19.093
!MESSAGE >> initialization job finished

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:19.111
!MESSAGE >> workspace/didChangeConfiguration

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:19.165
!MESSAGE >>New configuration: {java={jdt={ls={vmargs=-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication}}, errors={incompleteClasspath={severity=warning}}, configuration={checkProjectSettingsExclusions=true, updateBuildConfiguration=interactive}, trace={server=off}, import={gradle={enabled=true, wrapper={enabled=true}}, maven={enabled=true}, exclusions=[**/node_modules/**, **/.metadata/**, **/archetype-resources/**, **/META-INF/maven/**]}, referencesCodeLens={enabled=false}, signatureHelp={enabled=false}, implementationsCodeLens={enabled=false}, format={enabled=true, comments={enabled=true}, onType={enabled=true, fixComment={enabled=true}}}, autobuild={enabled=true}, maxConcurrentBuilds=1.0, completion={enabled=true, overwrite=true, guessMethodArguments=false, favoriteStaticMembers=[org.junit.Assert.*, org.junit.Assume.*, org.junit.jupiter.api.Assertions.*, org.junit.jupiter.api.Assumptions.*, org.junit.jupiter.api.DynamicContainer.*, org.junit.jupiter.api.DynamicTest.*, org.mockito.Mockito.*, org.mockito.ArgumentMatchers.*, org.mockito.Answers.*], importOrder=[java, javax, com, org]}, progressReports={enabled=true}, foldingRange={enabled=true}, maven={downloadSources=false}, codeGeneration={hashCodeEquals={useJava7Objects=false, useInstanceof=false}, useBlocks=false, generateComments=false, toString={template=${object.className} [${member.name()}=${member.value}, ${otherMembers}], codeStyle=STRING_CONCATENATION, skipNullValues=false, listArrayContents=true, limitElements=0.0}}}}

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:19.172
!MESSAGE >> document/didOpen

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:21.519
!MESSAGE >> document/didChange

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:21.688
!MESSAGE >> document/didChange

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:21.701
!MESSAGE >> document/didChange

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:21.710
!MESSAGE >> document/didChange

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:21.720
!MESSAGE >> document/didChange

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:21.728
!MESSAGE >> document/didChange

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:21.735
!MESSAGE >> build jobs finished

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:21.739
!MESSAGE >> document/didChange

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:21.742
!MESSAGE >> registerFeature 'workspace/didChangeWatchedFiles'

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:21.746
!MESSAGE >> document/didChange

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:21.752
!MESSAGE >> registerFeature 'workspace/didChangeWatchedFiles'

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:21.762
!MESSAGE >> watchers registered

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:21.766
!MESSAGE >> document/willSaveWaitUntil

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 13:57:21.782
!MESSAGE >> document/didSave

!ENTRY org.eclipse.jdt.ls.core 4 0 2019-10-06 13:57:21.791
!MESSAGE file:///home/Azeez/tmp/test.java does not resolve to a ICompilationUnit

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 14:01:49.888
!MESSAGE >> java/buildWorkspace (incremental)

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 14:02:08.431
!MESSAGE >> document/willSaveWaitUntil

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 14:02:08.488
!MESSAGE >> document/didSave

!ENTRY org.eclipse.jdt.ls.core 4 0 2019-10-06 14:02:10.769
!MESSAGE file:///home/Azeez/tmp/test.java does not resolve to a ICompilationUnit

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-10-06 14:06:18.770
!MESSAGE >> document/didClose

Reinstall coc-java including jdt?

Iโ€™m experiencing some errors from jdt after using the CocCommand to download the latest. Iโ€™d like to uninstall Coc-java along with the jdt language server, and then reinstall it all. I used CocUninstall but that doesnโ€™t seem to have uninstalled jdt. What would you recommend here? Is there a supported way to uninstall jdt as well? Where does it get installed to? Thanks!

Yarn install leads to compile errors

When I try to install this plugin with vim-plug or run yarn install --frozen-lockfile by hand in it's directory, I get a bunch of compiler errors from typescript:

>>> yarn install --frozen-lockfile                                                                                                                                                                                              
yarn install v1.15.2
[1/5] Validating package.json...
warning [email protected]: The engine "coc" appears to be invalid.
[2/5] Resolving packages...
success Already up-to-date.
$ npx npm-run-all clean build
npx: installed 58 in 3.378s
yarn run v1.15.2
$ rimraf lib
Done in 0.13s.
yarn run v1.15.2
$ tsc -p tsconfig.json
src/index.ts:46:65 - error TS2339: Property 'catch' does not exist on type 'void'.

46       commands.executeCommand(Commands.OPEN_BROWSER, e.openUrl).catch(_e => {
                                                                   ~~~~~

src/index.ts:126:35 - error TS2551: Property 'workspaceFolders' does not exist on type 'Workspace'. Did you mean 'workspaceFolder'?

126       workspaceFolders: workspace.workspaceFolders ? workspace.workspaceFolders.map(f => f.uri) : null,
                                      ~~~~~~~~~~~~~~~~

  node_modules/coc.nvim/lib/workspace.d.ts:69:14
    69     readonly workspaceFolder: WorkspaceFolder;
                    ~~~~~~~~~~~~~~~
    'workspaceFolder' is declared here.

src/index.ts:126:64 - error TS2551: Property 'workspaceFolders' does not exist on type 'Workspace'. Did you mean 'workspaceFolder'?

126       workspaceFolders: workspace.workspaceFolders ? workspace.workspaceFolders.map(f => f.uri) : null,
                                                                   ~~~~~~~~~~~~~~~~

  node_modules/coc.nvim/lib/workspace.d.ts:69:14
    69     readonly workspaceFolder: WorkspaceFolder;
                    ~~~~~~~~~~~~~~~
    'workspaceFolder' is declared here.

src/index.ts:343:53 - error TS2352: Conversion of type 'void' to type 'SourceAttachmentResult' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.

343       const resolveResult: SourceAttachmentResult = await commands.executeCommand(Commands.EXECUTE_WORKSPACE_COMMAND, Commands.RESOLVE_SOURCE_ATTACHMENT, JSON.stringify(resolveRequest)) as SourceAttachmentResult
                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/index.ts:362:54 - error TS2352: Conversion of type 'void' to type 'SourceAttachmentResult' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.

362         const updateResult: SourceAttachmentResult = await commands.executeCommand(Commands.EXECUTE_WORKSPACE_COMMAND, Commands.UPDATE_SOURCE_ATTACHMENT, JSON.stringify(updateRequest)) as SourceAttachmentResult
                                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/index.ts:508:79 - error TS2339: Property 'catch' does not exist on type 'void'.

508       commands.executeCommand(Commands.OPEN_BROWSER, Uri.parse(formatterUrl)).catch(_e => {
                                                                                  ~~~~~


Found 6 errors.

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "build" exited with 2.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Some specs:

>>> node --version
v12.1.0

organize imports formats the code

When I do add import or organize imports action my code gets reformatted. I think that this shouldn't happen.

Also with this setting

setlocal formatexpr=CocAction('formatSelected')

It reformats the whole file intstead of selected or current line using gqq for example.

java.edit.organizeImports does not work

When I see the list of available commands with Denite coc-command, java.edit.optimizeImports is available. If I remove some of the imports that are used in code, executing java.edit.optimizeImports does nothing.Expected result would be to see the missing imports added.

Class path cannot be resolved

Description: On opening a java file in any maven project, the error Classpath is incomplete. Only syntax errors will be reported: is presented. Tested in multiple maven projects with valid pom.xml in project root.

Relevant jdtls log snippet:

  !ENTRY org.eclipse.jdt.ls.core 1 0 2019-02-19 18:03:55.049
 45 !MESSAGE Classpath is incomplete. Only syntax errors will be reported for file:///home/azae/Dev/misc/heapSort/src/main/java/paroxayte/HeapSort.java

relevant ls output: ls -l /home/azae/Dev/misc/heapSort/pom.xml --> -rw-rw-r-- 1 azae azae 1914 Dec 15 14:12 /home/azae/Dev/misc/heapSort/pom.xml

Coc.nvim source: tag: v0.0.55

edit: I have also tried :CocCommand java.projectConfiguration.update with pom.xml as the active buffer. No change.

edit 2: I can get the plugin to work if and only if the first java project file I open is the pom.xml either by opening the pom first or :CocRestart when pom is the active buffer.

Completing /** should generate Javadoc with params

Hi,
I try to auto-complete the javadoc of methods or classes but the javadoc completion item doesn't appear.
It's been implemented in eclipse.jdt.ls there eclipse-jdtls/eclipse.jdt.ls#744 and the autocompletion of /** will expand the javadoc.
It works in visual source code.

how to reproduce

  • Create a java method
  • A line before the method type /** then manually trigger the completion
  • I get nothing. The auto-completion doesn't pop up:
    image

Note that it works If the comment is closed:

/**<carret>
*/

I get the javadoc item.
image
and it can be expanded:
image

settings

  • default coc-settings.json
  • use <c-space> to auto-complete: inoremap <silent><expr> <c-space> coc#refresh()

Complete for imported java class

Works well for the method in the same project

image

But if import com.github.pagehelper.PageHelper,
then I want to complete method for PageHelper, works well in IDEA, but not popup in coc-java

image

This is IDEA
image

Getting exception when opening a java file

I'm getting the following exception when I open a .java file.

## versions

vim version: NVIM v0.3.4
node version: v10.15.3
coc.nvim version: 0.0.59
term: iTerm.app
platform: darwin

## Error messages

## Output channel: java
[Error  - 2:32:56 PM] Mar 11, 2019 2:32:56 PM An internal error occurred during: "Initialize Workspace".
Java heap space
java.lang.OutOfMemoryError: Java heap space
	at java.util.Arrays.copyOf(Arrays.java:3332)
	at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
	at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)
	at java.lang.StringBuilder.append(StringBuilder.java:136)
	at org.apache.maven.model.Dependency.getManagementKey(Dependency.java:612)
	at org.apache.maven.model.merge.MavenModelMerger.getDependencyKey(MavenModelMerger.java:629)
	at org.apache.maven.model.merge.ModelMerger.mergeDependencyManagement_Dependencies(ModelMerger.java:1472)
	at org.apache.maven.model.merge.ModelMerger.mergeDependencyManagement(ModelMerger.java:1452)
	at org.apache.maven.model.merge.ModelMerger.mergeModelBase_DependencyManagement(ModelMerger.java:682)
	at org.apache.maven.model.merge.ModelMerger.mergeModelBase(ModelMerger.java:536)
	at org.apache.maven.model.merge.ModelMerger.mergeModel(ModelMerger.java:126)
	at org.apache.maven.model.merge.MavenModelMerger.mergeModel(MavenModelMerger.java:76)
	at org.apache.maven.model.merge.ModelMerger.merge(ModelMerger.java:121)
	at org.apache.maven.model.inheritance.DefaultInheritanceAssembler.assembleModelInheritance(DefaultInheritanceAssembler.java:67)
	at org.apache.maven.model.building.DefaultModelBuilder.assembleInheritance(DefaultModelBuilder.java:724)
	at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:380)
	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:158)
	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:116)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.readMavenProject(MavenImpl.java:628)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.lambda$2(ProjectRegistryManager.java:698)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager$$Lambda$63/409249940.call(Unknown Source)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.execute(ProjectRegistryManager.java:958)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.readMavenProjectFacade(ProjectRegistryManager.java:694)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:396)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:349)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:296)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.configureNewMavenProjects(ProjectConfigurationManager.java:259)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$1.call(ProjectConfigurationManager.java:175)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$1.call(ProjectConfigurationManager.java:1)

Ignoring java.codeGeneration.toString.limitElements as java.codeGeneration.toString is undefined

Hi everyone!
I'm facing this error message since yesterday with coc-java extension. It show up in status bar as soon as nvim start even if it is not a java project folder.

My coc.vim output :

## versions
vim version: NVIM v0.4.0-674-g8342b4486
node version: v9.11.2
coc.nvim version: 0.0.66-ad629df759
term: rxvt-unicode-256color
platform: linux

## Error messages
Ignoring java.codeGeneration.toString.template as java.codeGeneration.toString is undefined
Ignoring java.codeGeneration.toString.codeStyle as java.codeGeneration.toString is undefined
Ignoring java.codeGeneration.toString.skipNullValues as java.codeGeneration.toString is undefined
Ignoring java.codeGeneration.toString.listArrayContents as java.codeGeneration.toString is undefined
Ignoring java.codeGeneration.toString.limitElements as java.codeGeneration.toString is undefined
## Output channel: prettier
## Output channel: snippets

[Error 17:35:38] Convert regex error for: li(st)? (?<num>\d+)$
[Error 17:35:38] Convert regex error for: ol(st)? (?<num>\d+)$

I've tried to install and uninstall coc-java extension with these openjdk version

openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

then I tried

java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

It seems to be ok with oracle-jdk.

Does coc-java only working with oracle-jdk and not openjdk?

Best Regard!

Candidates missing from autocomplete and automatic importing not working

vim version: NVIM v0.3.4
node version: v10.16.0
coc.nvim version: 0.0.72-20462895da
term: xterm-256color
platform: linux

After updating to the latest commit on the coc release branch and updating coc-java and the language server, some candidates are missing from the completion option list that were available before. For example, I now only see the hibernate Entity annotation offered, but before the javax.persistence.Entity annotation (the one I want) had been available as well. However, I still get the option of importing javax.persistence.Entity when I get available code actions. Autocompletion is also not triggering imports on completions anymore.

I see the following error in the trace when I try autocompletion:

[Trace - 1:27:51 PM] Sending request 'completionItem/resolve - (14)'.
Params: {
    "label": "Entity - org.hibernate.annotations",
    "kind": 8,
    "sortText": "999998748",
    "filterText": "Entity",
    "insertText": "Entity",
    "data": {
        "decl_signature": "Lorg.hibernate.annotations.Entity;",
        "pid": "1",
        "rid": "4",
        "uri": "file:///home/user/udemy/spring5/spring5webapp/src/main/java/guru/springframework/spring5webapp/model/Publisher.java"
    }
}


[Trace - 1:27:51 PM] Received response 'completionItem/resolve - (14)' in 51ms. Request failed: Internal error. (-32603).
Error data: "java.lang.RuntimeException: java.lang.reflect.InvocationTargetException\n\tat org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67)\n\tat org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)\n\tat org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261)\n\tat org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190)\n\tat org.eclipse.jdt.ls.core.internal.ParentProcessWatcher.lambda$0(ParentProcessWatcher.java:121)\n\tat org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)\n\tat org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)\n\tat org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)\n\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.base/java.lang.Thread.run(Thread.java:834)\nCaused by: java.lang.reflect.InvocationTargetException\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:566)\n\tat org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)\n\t... 12 more\nCaused by: java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Property must not be null: value\n\tat java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)\n\tat java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)\n\tat java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:645)\n\tat java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)\n\tat java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)\n\tat java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)\n\tat java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)\n\tat java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)\n\tat java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)\nCaused by: java.lang.IllegalArgumentException: Property must not be null: value\n\tat org.eclipse.lsp4j.MarkupContent.setValue(MarkupContent.java:84)\n\tat org.eclipse.jdt.ls.core.internal.handlers.CompletionResolveHandler.resolve(CompletionResolveHandler.java:178)\n\tat org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$5(JDTLanguageServer.java:490)\n\tat org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$40(JDTLanguageServer.java:892)\n\tat java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)\n\t... 6 more\n"


[Error  - 1:27:51 PM] Request completionItem/resolve failed.
  Message: Internal error.
  Code: -32603 
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190)
	at org.eclipse.jdt.ls.core.internal.ParentProcessWatcher.lambda$0(ParentProcessWatcher.java:121)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	... 12 more
Caused by: java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Property must not be null: value
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:645)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Caused by: java.lang.IllegalArgumentException: Property must not be null: value
	at org.eclipse.lsp4j.MarkupContent.setValue(MarkupContent.java:84)
	at org.eclipse.jdt.ls.core.internal.handlers.CompletionResolveHandler.resolve(CompletionResolveHandler.java:178)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$5(JDTLanguageServer.java:490)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$40(JDTLanguageServer.java:892)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
	... 6 more

Add import on autocomplete as in vscode.

In vscode when I autocomplete some type say List and it isn't imported yet it automatically imports it (and I can choose between ambiguous names right in autocomplete menu).

Can you make your extension to work as vscode in this regard?

[Question] Project growth schema

Hello,

Thank you for this great plugin. I was wondering if you would be open to implementing a project growth schema? Something like a "critical features" milestone and another milestone for "nice-to-haves", attaching issues for the things you don't have time to implement yourself with help_wanted. Then just refer folks to a CONTRIBUTING.md, or something like that.

The reason I ask is because I can see myself wanting to get involved with this in my free time, and I think something along those lines would be really helpful.

Coc-java not working on windows 10

Hi,

I'm having problems in getting coc-java working on windows 10. Even when installed on an otherwise untouched windows 10 sandbox with only neovim, git, java 11 (adoptopenjdk), nodejs 12.8 installed, coc.nvim added with vim-plug and coc-java added as the only additional plugin, I get the following error message (in the language server output) when opening a Java file:

[Error  - 12:41:30] Starting client failed: 
TypeError: Cannot read property 'reader' of undefined
    at C:\Users\djell\.vim\plugged\coc.nvim\lib\language-client\client.js:2187:48

When trying the same on a comparable Ubuntu VM, everything works as expected. To the best of my knowledge, the environment (java, node) is set up correcly, JAVA_HOME points to the correct directory etc.

Kind regards,
Daniel

Accepting completion of import statement with CTRL-Y deletes the entire line

When I try to use CTRL-Y to accept completion while typing import org.apache.commons.lang3.StringUtils; the entire line gets deleted immediately after the insertion. This happens if I try CTRL-Y at any point after org. Sometimes pressing CTRL-Y partway through the statement will cause completion as a star import like import org.apache.*; or import org.apache.commons.*;, but this happens randomly and I can't tell what is causing it to happen. Most of the time the entire line just disappears when I press CTRL-Y. I see no errors from coc#status() or :CocInfo. I should add that while trying to add the import to my file, I do not have the lang3 jar on the classpath yet, but it is offered by the completion anyway. I know that the program won't compile until I make the lang3 package available, but I don't think that I should be prevented from adding an import statement to a file because of this.

Failed to add class: Cannot nest

Hello, and thanks for the amazing job here!
I have the following problem in java projects.
When I open them i get the following error

[coc.nvim] Error output from java: Feb 22, 2019 7:13:25 PM Failed to add class
Cannot nest '/target/generated-sources/annotations' inside '/target/gene
rated-sources'. To enable the nesting exclude 'annotations/' from '/target/
generated-sources'

Can you please guide me to fix it somehow?
Thanks!

Some extra info:

## versions

vim version: NVIM v0.3.4
node version: v8.14.1
coc.nvim version: 0.0.55
term: screen-256color
platform: linux

Format ignores (indent) settings.

Situation

Indent is set in org.eclipse.jdt.core.prefs to 4.
Indent is set in init.vim to 4

setl shiftwidth=4
setl tabstop=4

Formatting with Eclipse gives an indent of 4.
Formatting with vim-lsp gave an indent of 4.

Problem

When formatting with coc-java indent is set to 2.

(documentation) explain how to customize compiler warnings

Hi,

Maybe it could be cool to add in the README.md a short paragraph that explain how to customize compiler warnings / errors.

It's a server side LSP customization, but for newbies it could be very very cool to have this documentation in the README.md of the current project.

Simply say that we should add customization under root_project/.settings/org.eclipse.jdt.core.prefs with values presented at https://help.eclipse.org/neon/topic/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/core/JavaCore.html ?

Thanks in advance !

Select multiple fields when generating getters/setters, constructors, etc..

I have been trying this plugin to replace JavaComplete2, but I have found a strange limitation on the method generation actions.When I try to generate a constructor, for examples, I can only select of the Class fields at a time. The same goes for generating getters and setters. Would it be possible to implement a way to select multiple field just like JavaComplete2 does? In a related matter, would be possible to separate setter and getter generation options? Sometimes I just need to create one or the other, not both.

Left extra text when confirm completion condidates

just write a simple String
image
and fininally I get
image
nvim version :NVIM v0.5.0-23-gafd576ee9
confirm config:
image

the problem only happend for java language server candidates, it's fine for snippet,file,around condidates.

Bundled jdt.ls will be removed.

coc-java will download jdt.ls for you instead of use bundled jdt.ls.

The reason is the bundled jdt.ls is too big that I can't publish new version of coc-java.

Will also add java.updateLanguageServer command to download latest jdt.ls.

Constructors generated by AutoValue cannot be found

Hello,
I get the following error for using constructors that were generated by AutoValue: [Java 16777218] [E] AutoValue_XXX cannot be resolved to a type. The classes get generated into a folder called generated somewhere in the project directory. Can we somehow point the language server to those files, so that it can resolve the classes?

Send command across different workspace folders

Hello there,

Thanks for your awesome work. coc-java works great!
I am wondering if it is possible to specify another workspace when issuing a command with Coc plugin? Or is there anyway of changing temporarily the workspace folder in use?

The workflow I try to do is:
Given that workspaceA and workspaceB are loaded as workspace folders. From workspaceA, I want to goto the definition of a class Foo, but its definition is only available inside workspaceB. I would like to issue the command temporarily on workspaceB instead of workspaceA from a file contained in workspaceA.

Why?
jdtls tries to decompile the jar instead of jumping to the code. Even if I configure the thing properly via eclipse, I can see the code of Foo, but it does not point at the source file in workspaceB (it generates a new source file). Which I find annoying, I want to jump inside the other workspace instead.

java process is not killed after quiting nvim

Seems the java process does not exit after vim quit. Is there any lifecycle hooks to ensure the resource getting released?

/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/java -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -Dfile.encoding=utf-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /Users/myUser/.gradle/wrapper/dists/gradle-3.5-bin/a9dfgtj5kwo69rnsu3ha320bn/gradle-3.5/lib/gradle-launcher-3.5.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 3.5

System: MacOS Mojave
nvim: v0.4.2
Screen Shot 2019-10-16 at 1 12 27 PM

Thanks for the awesome coc.vim!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.