Commit graph

55 commits

Author SHA1 Message Date
Henrik Lissner
06392a723f refactor: rename orig-fn arg in advice to fn
A minor tweak to our naming conventions for the first argument of an
:around advice.
2021-08-04 01:53:12 -04:00
Henrik Lissner
77f78f0df3 revert: Fix #5215: mix snippets with completion candidates
The sorting of these two backends are counter-intuitive in this
configuration, but I don't want to place the snippets in front of the
more meaningful capf results as suggested in #5215. A better solution is
needed, but for the time being this will do.

Fix #5262
Ref #5215
Revert ba716d69f0
2021-08-03 23:02:11 -04:00
Daanturo
829a44f79c Quickly close the lsp-signature popup by ESC*
Add to `doom-escape-hook` a function that closes the displayed LSP
signature.
2021-07-29 08:59:48 +07:00
Henrik Lissner
480f99c207
Merge pull request #4961 from gagbo/patch-10
Feature-gate :tools lsp company-specific hooks
2021-07-24 18:30:35 -04:00
Henrik Lissner
edc527bb26 tools/lsp: add lsp-racket to lsp-client-packages
Should be PRed upstream.
2021-07-12 20:15:29 -04:00
Henrik Lissner
ba716d69f0 Fix #5125: mix snippets with completion candidates
So snippets aren't all the way at the bottom of the candidate list.

Closes #5220
2021-07-09 13:25:14 -04:00
Cora Sutton
7925759b8e
Set the lsp-ui-sideline-actions-icon to the default
When Emacs 26.x support was in place this was originally:

```elisp
lsp-ui-sideline-actions-icon (if EMACS27+ lsp-ui-sideline-actions-icon-default)
```

But when it was removed it became:

```elisp
lsp-ui-sideline-actions-icon t
```

The docs for lsp-ui-sideline-actions-icon say:

```
Image file for actions.  It must be a png file.
```

Setting this to `t` results in a whole lot of these messages:

```
[lsp-ui-sideline]: Error with actions icon: (error Invalid image specification)
```

So the solution seems to me to be to set it to:

```elisp
lsp-ui-sideline-actions-icon lsp-ui-sideline-actions-icon-default
```

I've set it in my emacs and it seems to work.
2021-07-06 13:46:53 -05:00
Henrik Lissner
044a1a5f2b Drop Emacs 26.x support
Emacs 27.x has been the stable version of Emacs for nearly a year, and
introduces a litany of bugfixes, performance, and quality-of-life
improvements that significantly reduce Doom's maintenance burden (like
XDG support, early-init.el, image manipulation without imagemagick, a
native JSON library, harfbuzz support, pdumper, and others).

With so many big changes on Doom's horizon, I like having one less (big)
thing to worry about.

Also reverts bb677cf7a (#5232) as it is no longer needed.
2021-07-06 02:31:52 -04:00
Henrik Lissner
3a0bf17f2f lsp-ui-doc-enable = nil
Disabling this by default until emacs-lsp/lsp-ui#613 is addressed.
2021-05-23 22:09:07 -04:00
Sam Whitlock
01b3e1d8d8
Noting the lsp-peek handlers as :async
Without this, subsequent handlers registered (e.g. those from other
completion frameworks) will also pop up in addition to the peek UI.
This creates UI lock-up and is generally undesired.
2021-05-20 20:29:08 +02:00
Henrik Lissner
69bd3da195 Don't enable lsp-ui-mode in lsp--auto-configure
Using a hook instead is more sensible (users can trivially configure
it).
2021-05-18 01:06:15 -04:00
Henrik Lissner
d141f39ee7 tools/lsp: remove unneeded lsp-ui-*-enable checks 2021-05-18 00:05:15 -04:00
Henrik Lissner
e2077c823a tools/lsp: minor refactor
And several updates necessary for ff3c9777e.
2021-05-16 21:17:16 -04:00
Eric Dallo
c224e2e771
Move to global-mode-string 2021-05-15 18:30:59 -03:00
Gerry Agbobada
fda382cc86
Feature-gate :tools lsp company-specific hooks
As I’m trying to use [corfu](https://github.com/minad/corfu) for a bit, I found out that this hook prevents lsp-mode from starting if company-mode isn’t used.
2021-05-01 13:03:07 +02:00
Yiming Chen
00de463d10 Indicate that lsp-find-implementation is async as well
- this fixes an issue that when there are multiple implementations, jump
  to one implementation that's in another file fails
2021-04-17 08:54:50 +08:00
Yiming Chen
6563e89bda Indicate that lsp-describe-thing-at-point is async
- otherwise, `+lookup-online-backend-fn` would be called as well
- lsp-describe-thing-at-point was marked as not async in
  d4eb7e31ac
- but `lsp-describe-thing-at-point` calls `lsp--make-request`
  internally (which is async I assume):
  eda51c2166/lsp-mode.el (L4677)
2021-04-17 07:58:50 +08:00
Henrik Lissner
c77cebfef8 Remove trailing slash on lsp-server-install-dir
Fixes some issues with lsp-mode's downloader resolving paths to
downloaded assets. For example, lua-language-server fails to download
when lsp-server-install-dir has a trailing slash (see #4846).

Fix #4846
2021-04-15 01:22:07 -04:00
Henrik Lissner
241e040e4d tools/lsp: remove redundant lsp-clients-lua-language-server-bin
This was already upstreamed.
2021-04-14 23:43:45 -04:00
Henrik Lissner
d4eb7e31ac Fix #4771: give lsp-find-* precedence over fallbacks
LSP lookup handlers should have the highest precedence, but this wasn't
the case due to a regression in 430d628.
2021-03-27 21:45:19 -04:00
Henrik Lissner
e4c4e3f48c Move lsp-intelephense-storage-path to doom-etc-dir
Longer-lived files should live in doom-etc-dir, not doom-cache-dir.
2021-03-27 18:27:19 -04:00
Sævar Berg
12cf59cf73
Prioritize company-capf over company-yasnippet
This ensures that when doing things like completing on `this.` inside classes, the class fields and methods are shown before the yasnippet snippets.
2021-03-08 13:29:28 +01:00
Henrik Lissner
cb194a31b1
Merge pull request #4512 from jsravn/enable-yasnippet-in-lsp-completion
Include snippets in lsp completion
2021-03-05 23:21:07 -05:00
Henrik Lissner
7afe5dc5c3 tools/lsp: fix void-function lsp--require-packages error 2021-03-05 20:09:22 -05:00
Henrik Lissner
430d628b00 tools/lsp: use xref backend as lookup handler
If lsp-find-{definition,references} fails, it will properly fall through
to other lookup handlers (like dumb-jump).

Fix #4662
Fix #4739
2021-03-05 20:09:22 -05:00
Henrik Lissner
de924daf47 Fix #4704: invalid image spec error from lsp-ui
Regression from a3f242d
2021-02-27 10:31:49 -05:00
Henrik Lissner
a3f242d4b6 tools/lsp: only enable sideline icons in 27.x+ 2021-02-25 13:59:43 -05:00
Henrik Lissner
cd083bc059 tools/lsp: fix +lsp-prompt-to-install-server == 'quiet
Wasn't suppressing output because inhibit-message is overridden in
lsp--message.
2021-02-25 12:40:07 -05:00
Henrik Lissner
7f6bcb8616 tools/lsp: allow +lsp-prompt-to-install-server = 'quiet 2021-02-24 18:06:30 -05:00
Henrik Lissner
95a603733a Add +lsp-prompt-to-install-server option
If nil, LSP will quietly fail if no LSP server is available instead of
pestering the user to install a server.
2021-02-05 21:53:06 -05:00
James Ravn
573d14c264
Include snippets in lsp completion
This gives completion of snippets along with normal LSP completion,
similar to how the old company-lsp backend worked.
2021-01-07 11:19:03 +00:00
Henrik Lissner
70e71f3f6d
lsp-headerline-breadcrumb-enable = nil 2021-01-07 01:41:58 -05:00
Henrik Lissner
2849efdf2e
lang/lua: update README & refactor
Mentioned in #4462
2021-01-03 17:07:42 -05:00
Henrik Lissner
b857566239
Minor refactors 2020-10-20 16:52:39 -04:00
Henrik Lissner
88b42caab0
Fix user-defined flycheck-checker in lsp-mode 2020-10-20 16:51:39 -04:00
Henrik Lissner
8297af01a8
tools/lsp: tweak lsp-ui-doc defaults 2020-10-14 18:38:09 -04:00
Henrik Lissner
2491c8ed2c
tools/lsp: add j/k/C-j/C-k keys for lsp-ui-peek 2020-10-14 18:38:05 -04:00
Henrik Lissner
c80d546e55
Don't prompt to kill lsp server on cleanup 2020-10-12 17:36:02 -04:00
Henrik Lissner
ebc1e7092d
tools/lsp: restore flycheck-checker fix #3989
Removed in 22b6eaed0.
2020-10-11 20:31:33 -04:00
Henrik Lissner
22b6eaed03
Rethink lsp defaults
+ Allow LSP to prompt to install servers. All this machinary just adds
more confusion for beginners, and at least LSP asks for your permission
before it does it.
+ Reverts lsp-enable-file-watchers and lsp-enable-indentation to their
default (enabled), hopefully to help lsp-java, lsp-dart, and lsp-clojure
users, for whom file-watchers seems to be necessary.
+ Apply GC/IPC optimizations globally, to ensure their reach. By only
setting them buffer-locally we don't have a guarantee that subprocesses
will be affected when the lsp buffer isn't focused.

Closes #3989

Co-authored-by: Eric Dallo <ercdll1337@gmail.com>
2020-10-11 18:32:42 -04:00
Henrik Lissner
841eacc77d
tools/lsp: lazy load <leader> c l keybind
Fixes a issue where folks would try to rebind <leader> c, only to get a
non-prefix key error about <leader> c l.
2020-08-27 17:44:58 -04:00
Henrik Lissner
018cedf05f
tools/lsp: fix void-function apply-orig-fn
When +lsp-auto-install-servers is non-nil.
2020-08-26 13:22:05 -04:00
Henrik Lissner
4e82ee4397
Refactor doom-debug-mode
+ Add explain-pause-mode
+ Now reloads itself if doom-debug-variables is changed or when one of
  its variables becomes available.
+ doom-debug-variables now supports a cons cell entry where its CAR is
  the name of the variable and CDR is the value it should be set to when
  doom-debug-mode is active.
2020-08-21 01:26:24 -04:00
Henrik Lissner
6cf5d72ff6
Generalize LSP optimizations to include eglot 2020-08-12 00:34:09 -04:00
Henrik Lissner
50f1391e86
Fix #3274: don't chain checkers to LSP
Reverts 8ecec82
2020-08-12 00:34:01 -04:00
Henrik Lissner
358ca9864b
tools/lsp: remove redundant config
lsp-enable-links was re-enabled in edf5249d1, since #2911 is no longer
an issue.
2020-08-09 01:50:41 -04:00
Henrik Lissner
69259093e2
tools/lsp: fix lsp-mode init
3f5cc4c63 introduced some big changes to how Doom starts lsp-mode. I've
deferred much more of the work to upstream, but it:

1. lsp's errors no longer made sense (complaining about servers having
   no automated install routine, despite having one).
2. Broke lsp support in indirect buffers (like org src/capture buffers).

So I half-reverted 3f5cc4c63 and added a +lsp-auto-install-servers
variable to make it optional (albeit opt-in).
2020-08-06 20:45:16 -04:00
Henrik Lissner
3f5cc4c630
Bump :tools lsp debugger
emacs-lsp/dap-mode@8c59b0a -> emacs-lsp/dap-mode@85a6163
emacs-lsp/lsp-mode@0131f1f -> emacs-lsp/lsp-mode@edb8119
realgud/realgud@de31e77 -> realgud/realgud@5b0ed08
tumashu/posframe@b3028b0 -> tumashu/posframe@6d604a7

Also refactors the :tools lsp module. Recent changes upstream have made
a few of our hacks unnecessary (or easier to pull off without advice).

Upstream has also introduced optimizations!
2020-08-06 19:36:22 -04:00
Henrik Lissner
7784c0b6e9
No-op (lsp) if already enabled #3390
`lsp-deferred` calls `lsp` and `lsp` seems to do something expensive
whether or not lsp-mode is already active. Over TRAMP, this is much too
expensive, so we no-op lsp-deferred if lsp-mode is already active.
2020-08-02 16:27:09 -04:00
Henrik Lissner
e852ac0469
Re-introduce +lsp-company-backends
Not a perfect solution, but it'll do while I figure out a better
solution for set-company-backends!'s inflexibility.
2020-08-01 15:18:02 -04:00