{"action":"created","issue":{"url":"https://api.github.com/repos/neoclide/coc.nvim/issues/112","repository_url":"https://api.github.com/repos/neoclide/coc.nvim","labels_url":"https://api.github.com/repos/neoclide/coc.nvim/issues/112/labels{/name}","comments_url":"https://api.github.com/repos/neoclide/coc.nvim/issues/112/comments","events_url":"https://api.github.com/repos/neoclide/coc.nvim/issues/112/events","html_url":"https://github.com/neoclide/coc.nvim/issues/112","id":367456322,"node_id":"MDU6SXNzdWUzNjc0NTYzMjI=","number":112,"title":"eclipse.jdt.ls support","user":{"login":"tbo","id":264745,"node_id":"MDQ6VXNlcjI2NDc0NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/264745?v=4","gravatar_id":"","url":"https://api.github.com/users/tbo","html_url":"https://github.com/tbo","followers_url":"https://api.github.com/users/tbo/followers","following_url":"https://api.github.com/users/tbo/following{/other_user}","gists_url":"https://api.github.com/users/tbo/gists{/gist_id}","starred_url":"https://api.github.com/users/tbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbo/subscriptions","organizations_url":"https://api.github.com/users/tbo/orgs","repos_url":"https://api.github.com/users/tbo/repos","events_url":"https://api.github.com/users/tbo/events{/privacy}","received_events_url":"https://api.github.com/users/tbo/received_events","type":"User","site_admin":false},"labels":[{"id":919769354,"node_id":"MDU6TGFiZWw5MTk3NjkzNTQ=","url":"https://api.github.com/repos/neoclide/coc.nvim/labels/enhancement","name":"enhancement","color":"a2eeef","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":46,"created_at":"2018-10-06T13:17:49Z","updated_at":"2018-10-31T07:46:26Z","closed_at":"2018-10-28T18:12:30Z","author_association":"NONE","body":"I've been testing [eclipse.jdt.ls](https://github.com/eclipse/eclipse.jdt.ls) to add support for Java. Most things work pretty well. The only major feature, that doesn't work is the resolution of external dependencies. eclipse.jdt.ls represents external resources by prefixing them with `jdt://`. Example:\r\n\r\n```\r\njdt://contents/slf4j-api-1.7.10.jar/org.slf4j/Logger.class?=linkedgeodata-core/%5C/home%5C/someone%5C/.m2%5C/repository%5C/org%5C/slf4j%5C/slf4j-api%5C/1.7.10%5C/slf4j-api-1.7.10.jar%3Corg.slf4j(Logger.class\r\n```\r\n\r\nIn order to resolve those URIs, eclipse.jdt.ls provides an additional LSP-Method: `java/classFileContents`. See [here](https://github.com/eclipse/eclipse.jdt.ls) to get a complete list of eclipse.jdt.ls' LSP extensions.\r\n\r\n**Possible Solutions**\r\n\r\nAdd a handler for `jdt://`-URIs, that passes them to `java/classFileContents` and show the response in a new readonly buffer. It could look like this:\r\n\r\n```\r\nau BufReadCmd,FileReadCmd,SourceCmd jdt://* call retrieveJdtAndShowInNewBuffer(expand(\"<amatch>\"))\r\n```\r\nKeep in mind, that jdt buffers are still valid java files, which can contain additional references.\r\n\r\nMost LSP-Clients use this approach:\r\n\r\n - https://github.com/autozimu/LanguageClient-neovim/issues/392\r\n - https://github.com/atom/ide-java/issues/42\r\n - https://github.com/emacs-lsp/lsp-java\r\n\r\n\\- OR - \r\n\r\nIntegrate [vscode-java](https://github.com/redhat-developer/vscode-java). \r\n\r\n**My Configuration**\r\n\r\ncoc-settings.json:\r\n```json\r\n{\r\n    \"languageserver\": {\r\n        \"java\": {\r\n            \"command\": \"javalsp\",\r\n            \"filetypes\": [\"java\"],\r\n            \"initializationOptions\": {\r\n                \"extendedClientCapabilities\": {\r\n                    \"classFileContentsSupport\": true\r\n                }\r\n            },\r\n            \"settings\": {\r\n            }\r\n        }\r\n    }\r\n}\r\n```\r\nWithout declaring the `classFileContentsSupport` eclipse.jdt.ls won't send jdt references.\r\n\r\nMy launcher (`javalsp`):\r\n\r\n```sh\r\n#!/bin/sh\r\nexport JAVA_HOME=$(/usr/libexec/java_home -v 1.8)\r\nWORKSPACE_DIR=/Users/tbo/git \r\nPLATFORM=mac # win, linux, mac\r\nJDT_DIR=~/git/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository\r\n\r\ncd ${JDT_DIR}\r\nLAUNCHER=`ls ${JDT_DIR}/plugins/org.eclipse.equinox.launcher_*`\r\njava -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Dlog.level=ALL -noverify -Xmx1G -jar ${LAUNCHER} -configuration ./config_mac -data ${WORKSPACE_DIR}\r\n```\r\n\r\nYou'll have to update the settings depending on your own system. I would have put everything into the `coc-settings.file`, but I didn't know how to change into the directory of the language server before the command execution.\r\n\r\nBTW: vscode-java already includes the installation of the LSP server.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/neoclide/coc.nvim/issues/comments/434591399","html_url":"https://github.com/neoclide/coc.nvim/issues/112#issuecomment-434591399","issue_url":"https://api.github.com/repos/neoclide/coc.nvim/issues/112","id":434591399,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDU5MTM5OQ==","user":{"login":"chemzqm","id":251450,"node_id":"MDQ6VXNlcjI1MTQ1MA==","avatar_url":"https://avatars3.githubusercontent.com/u/251450?v=4","gravatar_id":"","url":"https://api.github.com/users/chemzqm","html_url":"https://github.com/chemzqm","followers_url":"https://api.github.com/users/chemzqm/followers","following_url":"https://api.github.com/users/chemzqm/following{/other_user}","gists_url":"https://api.github.com/users/chemzqm/gists{/gist_id}","starred_url":"https://api.github.com/users/chemzqm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chemzqm/subscriptions","organizations_url":"https://api.github.com/users/chemzqm/orgs","repos_url":"https://api.github.com/users/chemzqm/repos","events_url":"https://api.github.com/users/chemzqm/events{/privacy}","received_events_url":"https://api.github.com/users/chemzqm/received_events","type":"User","site_admin":false},"created_at":"2018-10-31T07:46:26Z","updated_at":"2018-10-31T07:46:26Z","author_association":"CONTRIBUTOR","body":"`nnoremap` and `vnoremap ` would never works with keymap starts with `<Plug>` since `<Plug>` needs to be remapped."}}
{"actor":{"display_login":"chemzqm"}}