unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Óscar Fuentes" <ofv@wanadoo.es>
To: help-gnu-emacs@gnu.org
Subject: Re: Questions Regarding LSP Mode For Emacs
Date: Tue, 11 Jan 2022 20:27:19 +0100	[thread overview]
Message-ID: <874k6ankdk.fsf@telefonica.net> (raw)
In-Reply-To: 08c15f07-49ed-4ca2-bfd2-7f49845517eb@www.fastmail.com

"Samuel Banya" <sbanya@fastmail.com> writes:

> I have been trying to incorporate LSP Mode for Emacs to work both on
> my Linux computers, and my work based Macbook Pro.
>
> The problem is that I don't really see any of the related modes
> actually working, so I'm wondering if anyone could provide some
> related advice on how to set up LSP mode easily.

> #+begin_src emacs-lisp
>   (use-package lsp-mode
>     :ensure t
>     ;; Taken from this page:
>     ;; https://www.mattduck.com/lsp-python-getting-started.html
>     :hook
>     ;; List of modes taken from here:
>     ;; https://kb.iu.edu/d/acyg
>     ((js-mode
>       js-jsx-mode
>       typescript-mode
>       web-mode
>       python-mode
>       ruby-mode
>       C++-mode
>       java-mode
>       php-mode
>       elixir-mode
>       go-mode
>       csharp-mode))
>     :config
>     ;; Set 'lsp-idle-delay' to 0.5 seconds for quick autocompletion
>     (setq lsp-idle-delay 0.5)
>     ;; Set the 'lsp-server-install-dir' variable so that lsp servers are installed in ~/.emacs.d: 
>     (setq lsp-server-install-dir (concat user-emacs-directory "lsp-servers")))
> #+end_src

I think your use-package is wrong. lsp-mode has an specific entry point
and use-package needs to be told about that fact. See
https://emacs-lsp.github.io/lsp-mode/page/installation/#use-package

I also suggest trying with something simpler than Java to see check that
lsp-mode works. Python looks like a good candidate.

Also ensure the language server is correctly installed. Follow the link
at the end of that page for instructions.

In this case, copy-&-pasting random code from the 'net is not a good
approach. Lsp-mode is well documented, you will save time by following
its instructions.




      parent reply	other threads:[~2022-01-11 19:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 18:26 Questions Regarding LSP Mode For Emacs Samuel Banya
2022-01-11 19:03 ` Samuel Banya
2022-01-11 19:27 ` Óscar Fuentes [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874k6ankdk.fsf@telefonica.net \
    --to=ofv@wanadoo.es \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).