2

I have managed to install lsp-java according to their git Readme (https://github.com/emacs-lsp/lsp-java) and created my workspace.

Is there a better way (eg. in form of a documentation or tutorial) to get to known with lsp-java or do I have to try out every single possible command and see what is going to happen?

topkek
  • 79
  • 1
  • 7
  • Are you already familiar with Emacs? It looks like the package assumes that you are. If you're not, do `C-h t` for the Emacs tutorial. If you already are, and the README doesn't give you the information you need, it's a good idea to start with `C-h m` or `describe-mode`. That should tell you the relevant bindings. From there use `C-h f`, `describe-function`. It's convention to name Emacs packages with a prefix. For `lsp-java`, it's `lsp-`. Do a `C-h f lsp-`. If the package is any good, the functions should be intuitive and the docstrings helpful. – Lorem Ipsum Feb 20 '19 at 14:59
  • If you find the package useful, yet the documentation lacking, write up the documentation you would have liked to see (using your hard-won knowledge). Your input is valuable! https://stackoverflow.com/questions/14680711/how-to-do-a-github-pull-request – Lorem Ipsum Feb 20 '19 at 15:01
  • Does googling for `"lsp-java" tutorial` help? – Drew Feb 20 '19 at 21:29
  • 1
    If it helped, I would not have asked here :) I even disabled looking for Liskov's Substitution. – topkek Feb 20 '19 at 21:48

2 Answers2

1

I'm using configure of prelude and install lsp-java recently without much configures:

  1. require lsp-mode, company-lsp, lsp-ui, lsp-java;
  2. add code for hook:
(add-hook 'java-mode-hook #'lsp)
(add-hook 'java-mode-hook 'flycheck-mode)
(add-hook 'java-mode-hook 'company-mode)
  1. create a test java project with git and HelloWorld.java;
  2. restart emacs and open HelloWorld.java by step3, emacs will auto download jdt(you may download it manually);
  3. when everything ready, you should see message like "LSP :: Connected to [jdtls:12693 status:starting]." when you open HelloWorld.java by step 3.

all my configure can find at: https://github.com/RezoChiang/prelude/tree/rezo-lsp/modules

1

In the github page for lsp-java, there is a wordpress page that runs through an example workflow utilising lsp-java. This could be a good starting point.

Tian
  • 288
  • 1
  • 8