]> git.eshelyaron.com Git - emacs.git/log
emacs.git
3 years agoAdd :company-kind to eglot-completion-at-point
Mohsin Kaleem [Mon, 29 Mar 2021 21:32:33 +0000 (22:32 +0100)]
Add :company-kind to eglot-completion-at-point

* eglot.el (eglot-completion-at-point): Add a :company-kind field to the
completion-at-point function so that company can associate completion
candidates with lsp types.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/652

3 years agoAdd support for zls, the zig language server
Johnathan C. Maudlin [Fri, 19 Mar 2021 20:10:43 +0000 (16:10 -0400)]
Add support for zls, the zig language server

* eglot.el (eglot-server-programs): Add zig-mode entry.

* README.md (Connecting to a server): Mention zls.

Copyright-paperwork-exempt: yes
GitHub-reference: close https://github.com/joaotavora/eglot/issues/646

3 years agoAdd new command eglot-shutdown-all
bc² [Mon, 15 Mar 2021 09:49:07 +0000 (06:49 -0300)]
Add new command eglot-shutdown-all

Also closes https://github.com/joaotavora/eglot/issues/644
Co-authored-by: João Távora <joaotavora@gmail.com>
Copyright-paperwork-exempt: yes

* NEWS.md: mention new command

* README.md (Commands and keybindings): mention new command.  Tweak
documentation for eglot-shutdown and eglot-reconnect.

* eglot.el (eglot-shutdown): Tweak docstring.
(eglot-shutdown-all): New command.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/643

3 years agoAutoload eglot-workspace-configuration's safe-l-v spec
João Távora [Sat, 6 Mar 2021 21:20:42 +0000 (21:20 +0000)]
Autoload eglot-workspace-configuration's safe-l-v spec

This is useful for those who edit files in a certain source tree where
this directory-local variable is set, but without having yet loaded
eglot.el.  Those users would be bothered by the usual
risky-local-variable prompt.

* eglot.el (eglot-workspace-configuration): Add autoload cookie.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/555

3 years agoIndicate support for activeparameter
Brian Leung [Sat, 6 Mar 2021 21:17:07 +0000 (13:17 -0800)]
Indicate support for activeparameter

* eglot.el (eglot-client-capabilities): Indicate :activeParameterSupport.

Fixup of commit bdf57d5d4e888a6a7b4066b87497da8a8d9e36de.

GitHub-reference: per https://github.com/joaotavora/eglot/issues/605

3 years agoSimplify eglot--apply-workspace-edit
João Távora [Sat, 6 Mar 2021 21:15:33 +0000 (21:15 +0000)]
Simplify eglot--apply-workspace-edit

Suggested by Brian Leung.

* eglot.el (eglot--apply-workspace-edit): simplify

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/620

3 years agoRemove highlight overlays immediately when symbol edited
Augusto Stoffel [Thu, 25 Feb 2021 14:48:41 +0000 (15:48 +0100)]
Remove highlight overlays immediately when symbol edited

* eglot.el (eglot--highlight-piggyback): Add modification-hooks
property to the created overlays.

Co-authored-by: João Távora <joaotavora@gmail.com>
GitHub-reference: fix https://github.com/joaotavora/eglot/issues/626

3 years agoConvert colon to hex in uri
Theodor Thornhill [Sat, 6 Mar 2021 20:18:48 +0000 (21:18 +0100)]
Convert colon to hex in uri

On windows, in the path portion of the URI, ':' must be hexified to
'%3A'.  In the URL scheme, the ':' stays.

* eglot.el (eglot--uri-path-allowed-chars): define what characters are
allowed in path portion of URI.

* eglot.el (eglot--path-to-uri): ensure colon in 'file://' stays, but
and others are hexified.

Co-authored-by: João Távora
GitHub-reference: fix https://github.com/joaotavora/eglot/issues/638

3 years agoAdd tramp support
Brian Cully [Tue, 2 Mar 2021 21:13:07 +0000 (16:13 -0500)]
Add tramp support

Also close https://github.com/joaotavora/eglot/issues/463, close https://github.com/joaotavora/eglot/issues/84.

Thanks to Brian Cully for the original simple idea.  The basic
technique is to pass :file-handler t to make-process, then tweak
eglot--uri-to-path and eglot--path-to-uri, along with some other
functions, to be aware of "trampy" paths".

Crucially, a "stty hack" was needed.  It has been encapsulated in a
new a new eglot--cmd helper, which contains a comment explaining the
hack.

Co-authored-by: João Távora <joaotavora@gmail.com>
* eglot.el (eglot--executable-find): Shim two-arg executable-find
function only available on Emacs 27.
(eglot--guess-contact): Use eglot--executable-find.
(eglot--cmd): New helper.
(eglot--connect): Use eglot--cmd.  Use :file-handler arg to
make-process.
(eglot--connect, eglot--path-to-uri): Be aware of trampy file
names.

* eglot-tests.el (eglot-tests--auto-detect-running-server-1): New helper.
(eglot--guessing-contact): Better mock for executable-find.
(eglot--tramp-test): New test.

* NEWS.md: mention TRAMP support.

* README.md: mention TRAMP support.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/637

3 years agoCorrectly protect against zero-length completion items
Theodor Thornhill [Wed, 3 Mar 2021 10:08:24 +0000 (11:08 +0100)]
Correctly protect against zero-length completion items

Close https://github.com/joaotavora/eglot/issues/636.

* eglot.el (eglot-completion-at-point): check for zero length string in proxy
rather than the item.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/635

3 years agoProtect against empty uris on windows
Theodor Thornhill [Sat, 27 Feb 2021 10:19:35 +0000 (11:19 +0100)]
Protect against empty uris on windows

Per https://github.com/joaotavora/eglot/issues/630.

* eglot.el (eglot--uri-to-path): Check string length

Co-authored-by: João Távora <joaotavora@gmail.com>
GitHub-reference: fix https://github.com/joaotavora/eglot/issues/610

3 years agoUrify better
João Távora [Fri, 26 Feb 2021 20:11:08 +0000 (20:11 +0000)]
Urify better

See also
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#uri.

* eglot.el (eglot--path-to-uri): use directory-file-name.

GitHub-reference: per https://github.com/joaotavora/eglot/issues/627

3 years agoFixup last commit to fix
João Távora [Fri, 26 Feb 2021 19:30:30 +0000 (19:30 +0000)]
Fixup last commit to fix

* eglot.el (eglot-handle-request): Fixup.  Use let*

GitHub-reference: https://github.com/joaotavora/eglot/issues/627

3 years agoHandle empty actions array in window/showmessagerequest
João Távora [Fri, 26 Feb 2021 18:49:59 +0000 (18:49 +0000)]
Handle empty actions array in window/showmessagerequest

* eglot.el (eglot-handle-request window/showMessageRequest):
Handle empty actions.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/627

3 years agoHandle null reply for textdocument/definition
João Távora [Wed, 24 Feb 2021 11:27:59 +0000 (11:27 +0000)]
Handle null reply for textdocument/definition

* eglot.el (eglot--lsp-xrefs-for-method): Handle null response
from textDocument/definition & friends.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/625

3 years agoSilence messages while formatting markup
Jonathan del Strother [Sun, 21 Feb 2021 10:07:57 +0000 (10:07 +0000)]
Silence messages while formatting markup

Also fix https://github.com/joaotavora/eglot/issues/501.

Prior to this, activating gfm-view-mode could echo messages
like "markdown-mode math support enabled" to the minibuffer.

Message are both silenced from from the minibuffer and the
*Messaages* log.

Co-authored-by: João Távora <joaotavora@gmail.com>
Copyright-paperwork-exempt: yes
GitHub-reference: fix https://github.com/joaotavora/eglot/issues/502

3 years agoSimplify dir-watching strategy of w/didchangewatchedfiles
João Távora [Wed, 3 Feb 2021 10:41:40 +0000 (10:41 +0000)]
Simplify dir-watching strategy of w/didchangewatchedfiles

Instead of massaging the globPattern to match directories instead of
files, which is fragile, gather the list of directoris to watch by
matching the globPattern against every file recursively (except hidden
files and dirs).

This is still not 100% correct, but should do the right thing is most
cases.  Notably, if the correct dirs are being watched, the glob
pattern is matched against all existing and new files in those
directories, which does include hidden files.

* eglot.el (eglot-register-capability): match file globs against
files only.
(eglot--files-recursively): Rename from eglot--directories-recursively.

GitHub-reference: per https://github.com/joaotavora/eglot/issues/602

3 years agoTweak glob-parsing grammar
João Távora [Wed, 3 Feb 2021 00:43:35 +0000 (00:43 +0000)]
Tweak glob-parsing grammar

Alternative groups {} don't bork on forward slash.

* eglot.el (eglot--glob-parse): Tweak {} grammar.

GitHub-reference: per https://github.com/joaotavora/eglot/issues/602

3 years agoMake eglot-ignored-server-capabilites defcustom a set
Philip Kaludercic [Mon, 1 Feb 2021 18:20:37 +0000 (18:20 +0000)]
Make eglot-ignored-server-capabilites defcustom a set

Co-authored-by: João Távora <joaotavora@gmail.com>
* eglot.el (eglot-ignored-server-capabilites): Now a set.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/467

3 years agoSpeed up glob matching 2x
João Távora [Mon, 1 Feb 2021 17:23:07 +0000 (17:23 +0000)]
Speed up glob matching 2x

with-temp-buffer was taking a lot of time, presumably because it kills
the buffer.  Since emacs is single-threaded, we can safely reuse a
single buffer.

* eglot.el (eglot--glob-parse): Simplify grammar.
(eglot--glob-compile): Don't with-temp-buffer.

GitHub-reference: per https://github.com/joaotavora/eglot/issues/602

3 years agoSupport phps-mode
Felicián Németh [Mon, 1 Feb 2021 16:02:58 +0000 (17:02 +0100)]
Support phps-mode

phps-mode is available from ELPA, php-mode isn't.

* eglot.el (eglot-server-programs): Recognize phps-mode as a PHP mode.

Co-authored-by: João Távora <joaotavora@gmail.com>
GitHub-reference: fix https://github.com/joaotavora/eglot/issues/418

3 years agoRemove duplicate entry for "registration" lsp type
Brian Leung [Mon, 1 Feb 2021 15:44:52 +0000 (07:44 -0800)]
Remove duplicate entry for "registration" lsp type

* eglot.el (eglot--lsp-interface-alist): Remove extra Registration entry.

Copyright-paperwork-exempt: yes
GitHub-reference: fix https://github.com/joaotavora/eglot/issues/612

3 years agoPrefer typescript-language-server for js&ts
João Távora [Mon, 1 Feb 2021 15:39:15 +0000 (15:39 +0000)]
Prefer typescript-language-server for js&ts

* README.md (Connecting to a server): Prefer
typescript-language-server.

* eglot.el (eglot-server-programs): Use
typescript-language-server.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/566

3 years agoAlso override global flymake-diagnostic-functions
João Távora [Mon, 1 Feb 2021 14:03:23 +0000 (14:03 +0000)]
Also override global flymake-diagnostic-functions

The global value of the flymake-diagnostic-functions is likely to be
of little use in Eglot-managed buffers, so don't run it.  Likely the
value flymake-proc-legacy-flymake is there which is not only likely of
little uses but also causes trouble in some situations.

The user can easily avert this by leveraging the variable
eglot-stay-out-of.

* eglot.el (eglot--managed-mode): Don't run global
flymake-diagnostic-functions.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/616

3 years agoExplicitly require seq.el
Brian Leung [Mon, 1 Feb 2021 10:44:38 +0000 (02:44 -0800)]
Explicitly require seq.el

`seq-empty-p' is not autoloaded in Emacs >= 26.3, so it must be
explicitly required.

* eglot.el: Require seq.el.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/613

3 years agoSupport activeparameter property for signatureinformation
Brian Leung [Mon, 1 Feb 2021 01:28:49 +0000 (17:28 -0800)]
Support activeparameter property for signatureinformation

SignatureInformation.activeParameter is new in version 3.16.0 of the
protocol.  When non-nil, it is used in place of
SignatureHelp.activeParameter.  The latter was deemed insufficient in
languages where multiple signatures for the same function may exist
with arbitrary order of parameters, like Python.

Co-authored-by: João Távora <joaotavora@gmail.com>
* eglot.el (eglot--lsp-interface-alist): Add
SignatureInformation.activeParameter.

* eglot.el (eglot--sig-info): Prioritize
SignatureInformation.activeParameter over
SignatureHelp.activeParameter.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/605

3 years agoFully handle lsp glob syntax
João Távora [Sun, 31 Jan 2021 18:18:02 +0000 (18:18 +0000)]
Fully handle lsp glob syntax

Thanks to Brian Leung and Dan Peterson for testing and helping me spot
bugs.

* eglot-tests.el (eglot--glob-match): New test.

* eglot.el (eglot--wildcard-to-regexp): Delete.
(eglot-register-capability): Rework.
(eglot--glob-parse, eglot--glob-compile, eglot--glob-emit-self)
(eglot--glob-emit-**, eglot--glob-emit-*, eglot--glob-emit-?)
(eglot--glob-emit-{}, eglot--glob-emit-range)
(eglot--directories-recursively): New helpers.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/602

3 years agoFlush pending changes to server before code actions request
João Távora [Sat, 30 Jan 2021 18:01:19 +0000 (18:01 +0000)]
Flush pending changes to server before code actions request

Otherwise the actions returned by the server might be stale when the
user selects them.

* eglot.el (eglot-code-actions): Issue jsonrpc-request with deferred=t.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/609

3 years ago#fix 608: fix bug in eglot-code-actions
João Távora [Fri, 29 Jan 2021 16:27:55 +0000 (16:27 +0000)]
#fix 608: fix bug in eglot-code-actions

Suggested by GitHub user "vconcat".

* eglot.el (eglot-code-actions): Use a vector for transmitting
action-kind.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/606

3 years ago* eglot.el (eglot): tweak docstring grammar.
João Távora [Thu, 28 Jan 2021 18:56:22 +0000 (18:56 +0000)]
* eglot.el (eglot): tweak docstring grammar.

3 years agoOffer shortcut commands to commonly invoked code actions
Andrii Kolomoiets [Thu, 28 Jan 2021 18:36:11 +0000 (20:36 +0200)]
Offer shortcut commands to commonly invoked code actions

See also https://github.com/joaotavora/eglot/issues/598.

Make eglot-code-actions accept a new action-kind argument.  If there
is only one action of that kind, apply it.  This allows us to create
actions shortcuts like eglot-code-action-organize-imports, etc.

* eglot.el (eglot-code-actions): Accept new argument action-kind.
(eglot--code-action): New function-defining helper macro.
(eglot-code-action-organize-imports)
(eglot-code-action-extract)
(eglot-code-action-inline)
(eglot-code-action-rewrite)
(eglot-code-action-quickfix): New commands.

* README.md: Mention new feature.

* NEWS.md: Mention new feature.

Co-authored-by: João Távora <joaotavora@gmail.com>
GitHub-reference: close https://github.com/joaotavora/eglot/issues/411

3 years agoAdd fortls for fotran (f90-mode)
ssnnoo [Wed, 27 Jan 2021 09:10:07 +0000 (09:10 +0000)]
Add fortls for fotran (f90-mode)

* eglot.el (eglot-server-programs): Add fortls

* README.md: mention fortls

Copyright-paperwork-exempt: yes
GitHub-reference: close https://github.com/joaotavora/eglot/issues/603

3 years agoAdd rnix-lsp server for nix-mode, community suggestion
Brian Leung [Wed, 27 Jan 2021 22:43:15 +0000 (14:43 -0800)]
Add rnix-lsp server for nix-mode, community suggestion

* eglot.el (eglot-server-programs): Add rnix-lsp

* README.md: mention rnix-lsp

Copyright-paperwork-exempt: yes
GitHub-reference: close https://github.com/joaotavora/eglot/issues/599

3 years agoFix eglot-completion-at-point for multiple matches
Felicián Németh [Sat, 11 Jan 2020 19:12:26 +0000 (20:12 +0100)]
Fix eglot-completion-at-point for multiple matches

The test-completion case shouldn't return t when there are multiple
matches.  Similarly, the try-completion should return t only if the
match is exact.  See (info "(elisp)Programmed Completion").

* eglot.el (eglot-completion-at-point): Instead of testing
memberships, use test-completion and try-completion suggested
by (info "(elisp)Programmed Completion").

* eglot-tests.el (non-unique-completions): Add new test.

Co-authored-by: João Távora <joaotavora@gmail.com>
GitHub-reference: fix https://github.com/joaotavora/eglot/issues/365

3 years agoRun exit-function only for finished completion
Andrii Kolomoiets [Sat, 16 Jan 2021 11:42:32 +0000 (13:42 +0200)]
Run exit-function only for finished completion

Per https://github.com/joaotavora/eglot/issues/594.

* eglot.el (eglot-completion-at-point): Respect 'status' argument in
completion's exit function.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/592

3 years agoUse `path-separator', not ":", in eclipse/jdt custom code
Augusto Stoffel [Wed, 13 Jan 2021 18:43:08 +0000 (19:43 +0100)]
Use `path-separator', not ":",  in eclipse/jdt custom code

This is needed on Windows.

* eglot.el (eglot--eclipse-jdt-contact): Replace literal ":" by `path-separator'.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/513

3 years agoDefine a face for symbol highlight
Augusto Stoffel [Wed, 13 Jan 2021 18:41:10 +0000 (19:41 +0100)]
Define a face for symbol highlight

Also per https://github.com/joaotavora/eglot/issues/583.

* eglot.el (eglot-highlight-symbol-face): New face.
(eglot--highlight-piggyback): Use it.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/584

3 years agoUnbreak interactivee eglot--connect for complex contact specs
João Távora [Wed, 13 Jan 2021 15:13:32 +0000 (15:13 +0000)]
Unbreak interactivee eglot--connect for complex contact specs

The previous commit for https://github.com/joaotavora/eglot/issues/526 was completely botched.  One has to check
current-prefix-arg for the presence of C-u, not eglot--guess-contact
INTERACTIVE arg.

* eglot.el (eglot--guess-contact): Be more careful when
processing guess.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/593

3 years agoC-u m-x eglot discards class guessed by eglot--guess-contact
João Távora [Sun, 10 Jan 2021 16:42:59 +0000 (16:42 +0000)]
C-u m-x eglot discards class guessed by eglot--guess-contact

This will prevent C-u M-x eglot RET rust-analyzer from bringing into
play the eglot-rls server class, which is only valid for the default
RLS server.

Found when testing for https://github.com/joaotavora/eglot/issues/526, though this bug might not necessarily be
the problem being reported there.

* eglot.el (eglot--guess-contact): Don't assume guessed class if
INTERACTIVE.

3 years agoFlex completion style is not available on emacs < 27
Jürgen Hötzel [Tue, 5 Jan 2021 10:56:06 +0000 (11:56 +0100)]
Flex completion style is not available on emacs < 27

* eglot.el (eglot--managed-mode): check if flex style available

Copyright-paperwork-exempt: yes
GitHub-reference: fix https://github.com/joaotavora/eglot/issues/582

4 years agoDon't block in eglot-imenu if performing non-essential task
João Távora [Tue, 22 Dec 2020 17:35:08 +0000 (17:35 +0000)]
Don't block in eglot-imenu if performing non-essential task

eglot-imenu is used by imenu which in turn is used by which-func-mode
called from an idle timer.  We don't want it to block in that
situation.  Latest which-func mode now sets "non-essential" when
performing its duties, so we leverage that in eglot-imenu.

* eglot.el (eglot-imenu): Use non-essential.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/212

4 years agoUse flex completion if available by default
João Távora [Tue, 22 Dec 2020 17:31:52 +0000 (17:31 +0000)]
Use flex completion if available by default

* eglot.el (eglot--managed-mode): Set completion-styles.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/575

4 years agoBump eglot version to 1.7
João Távora [Wed, 16 Dec 2020 16:40:41 +0000 (16:40 +0000)]
Bump eglot version to 1.7

* eglot.el (Version): Bump to 1.7.
(Package-Requires): Bump dependency versions.

4 years agoAllow eglot to stay out of xref configuration
João Távora [Wed, 16 Dec 2020 16:37:31 +0000 (16:37 +0000)]
Allow eglot to stay out of xref configuration

* eglot.el (eglot-stay-out-of): Rework docstring.
(eglot--managed-mode): Can now stay out of xref.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/569

4 years agoCosmetic whitespace fix (indentation, long lines, tabs->spaces)
João Távora [Wed, 16 Dec 2020 10:22:56 +0000 (10:22 +0000)]
Cosmetic whitespace fix (indentation, long lines, tabs->spaces)

* eglot.el (eglot-server-programs, for, eglot--after-change)
(eglot-code-actions, eglot-register-capability)
(eglot-register-capability): Fix whitespace.

4 years agoUse haskell-language-server in eglot-server-programs
TANIGUCHI Kohei [Wed, 16 Dec 2020 10:19:30 +0000 (19:19 +0900)]
Use haskell-language-server in eglot-server-programs

Use haskell-language-server instead of deprecated Haskell IDE Engine

https://github.com/haskell/haskell-language-server
https://github.com/haskell/haskell-ide-engine#deprecated

* README.md: Replace Haskell IDE Engine with haskell-language-server

* eglot.el (eglot-server-programs): Replace hie-wrapper with
  haskell-language-server-wrapper

Copyright-paperwork-exempt: yes
GitHub-reference: close https://github.com/joaotavora/eglot/issues/572

4 years agoRobustify previous fix of onchange breakage
João Távora [Tue, 15 Dec 2020 12:24:13 +0000 (12:24 +0000)]
Robustify previous fix of onchange breakage

From the in-code comments:

;; githubhttps://github.com/joaotavora/eglot/issues/259 and githubhttps://github.com/joaotavora/eglot/issues/367: With `capitalize-word' or somesuch,
;; `before-change-functions' always records the whole word's `b-beg'
;; and `b-end'.  Similarly, when coalescing two lines into one,
;; `fill-paragraph' they mark the end of the first line up to the end
;; of the second line.  In both situations, args received here
;; contradict that information: `beg' and `end' will differ by 1 and
;; will likely only encompass the letter that was capitalized or, in
;; the sentence-joining situation, the replacement of the newline with
;; a space.  That's we keep markers _and_ positions so we're able to
;; detect and correct this.  We ignore `beg', `len' and
;; `pre-change-len' and send "fuller" information about the region
;; from the markers.  I've also experimented with doing this
;; unconditionally but it seems to break when newlines are added.

* eglot.el (eglot--after-change): Robustify fix.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/367

4 years agoDon't let m-x fill-paragraph break didchange
João Távora [Mon, 14 Dec 2020 17:08:26 +0000 (17:08 +0000)]
Don't let m-x fill-paragraph break didchange

M-x fill-paragraph represents some paragraph-fillling changes very
summarily.  Filling

    1 // foo
    2 bar

Into

    1 // foo bar

Only makes two changes: a deletion of the "// " and a replacement of a
newline with a space character.  The second change fooled Eglot's fix
for https://github.com/joaotavora/eglot/issues/259, by making a change similar to the one it is made to detect
and correct.  That fix should taget things that happen on the same
line, this not being one of those things.

* eglot.el (eglot--after-change): Only apply fix to https://github.com/joaotavora/eglot/issues/259 if
case-fiddling happens on same line.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/367

4 years agoDon't force eglot-strict-mode completely in eglot--dcase
João Távora [Tue, 3 Nov 2020 10:26:03 +0000 (10:26 +0000)]
Don't force eglot-strict-mode completely in eglot--dcase

Doing so was by design, since there's much ambiguity between the
CodeAction and Command objects.  But 'disallow-non-standard-keys is
not necessary to disambiguate, and proved harmful in this bug.

* eglot.el (eglot--dcase): Don't disallow
(eglot--check-dspec): Fix docstring.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/558

4 years agoHandle lsp 3.15's ispreferred code action property
Damien Merenne [Wed, 28 Oct 2020 20:40:32 +0000 (21:40 +0100)]
Handle lsp 3.15's ispreferred code action property

* eglot.el (eglot--lsp-interface-alist): Add :isPreferred to CodeAction.
(eglot-client-capabilities):  Announce :isPreferredSupport.
(eglot-code-actions): Consider preferred CodeAction item.

Co-authored-by: João Távora <joaotavora@gmail.com>
GitHub-reference: close https://github.com/joaotavora/eglot/issues/558

4 years agoDon't send json null (elisp nil) down the wire
João Távora [Tue, 1 Sep 2020 18:10:55 +0000 (19:10 +0100)]
Don't send json null (elisp nil) down the wire

* eglot.el (eglot-initialization-options)
(eglot-client-capabilities): Use eglot--{}, not nil.

GitHub-reference: per https://github.com/joaotavora/eglot/issues/300

4 years agoUnbreak haskell's hie-wrapper built-in incantation
R Primus [Sun, 30 Aug 2020 12:54:14 +0000 (13:54 +0100)]
Unbreak haskell's hie-wrapper built-in incantation

* eglot.el (eglot-server-programs): Add required argument for hie-wrapper

Copyright-paperwork-exempt: yes
GitHub-reference: fix https://github.com/joaotavora/eglot/issues/528

4 years agoProvide suitable default to m-x eglot-rename
Paul M. Rodriguez [Fri, 21 Aug 2020 22:27:40 +0000 (17:27 -0500)]
Provide suitable default to m-x eglot-rename

Copyright-paperwork-exempt: Yes

* eglot (eglot-rename): Provide a default value.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/524

4 years agoCorrect paren mismatch blunder introduced by earlier commit
João Távora [Sun, 16 Aug 2020 18:10:23 +0000 (19:10 +0100)]
Correct paren mismatch blunder introduced by earlier commit

Per https://github.com/joaotavora/eglot/issues/512.

* eglot.el (eglot-server-programs): properly close parenthesis.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/521

4 years agoAdd built-int support for godot engine
Steven vanZyl [Fri, 14 Aug 2020 14:44:38 +0000 (10:44 -0400)]
Add built-int support for godot engine

Copyright-paperwork-exempt: yes
Co-authored-by: João Távora <joaotavora@gmail.com>
* README.md: mention Godot

* eglot.el (eglot-server-programs): Add godot engine via port

GitHub-reference: close https://github.com/joaotavora/eglot/issues/511

4 years agoEnsure completion terminates in correct buffer
Andrew Schwartzmeyer [Sun, 21 Jun 2020 04:47:04 +0000 (21:47 -0700)]
Ensure completion terminates in correct buffer

To design a completion-in-region-function replacement that leverages
the elements in completion-at-point-functions, we must ensure that
their :exit-function parts execute in the correct buffer.  That is the
buffer where the text to be completed lives, not necessarily the
buffer being used for user interaction.

Later on, this guarantee should be provided by Emacs itself, perhaps
by putting the correct with-current-buffer call in completion--done.

Copyright-paperwork-exempt: yes
Co-authored-by: João Távora <joaotavora@gmail.com>
* eglot.el (eglot-completion-at-point): Ensure :exit-function's
buffer is where the source is.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/505

4 years agoUse a hash-table for storing resolved completions
João Távora [Mon, 13 Jul 2020 22:59:41 +0000 (23:59 +0100)]
Use a hash-table for storing resolved completions

* eglot.el (eglot-completion-at-point): use a hash-table for
storing resolved completions.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/510

4 years agoReload eldoc if needed on emacs < 28
João Távora [Mon, 13 Jul 2020 22:43:35 +0000 (23:43 +0100)]
Reload eldoc if needed on emacs < 28

ElDoc is preloaded in Emacs, so `require`-ing won't guarantee we are
using the latest version from GNU Elpa when we load eglot.el.  Use an
heuristic to see if we need to `load` it in Emacs < 28.

* eglot.el (Package-Requires): Require eldoc 1.5.0
(top): Sometimes load eldoc

4 years agoFix sorting of completion items
João Távora [Fri, 10 Jul 2020 16:41:43 +0000 (00:41 +0800)]
Fix sorting of completion items

This fixes a problem pointed out by Yuwei Tian <ibluefocus@gmail.com>.

* eglot.el (eglot-completion-at-point): Fix getting :sortText content
of the completion item.

GitHub-reference: closes https://github.com/joaotavora/eglot/issues/509

4 years ago* eglot.el (package-requires): require flymake 1.0.9 and eldoc 1.2.0
João Távora [Thu, 9 Jul 2020 23:28:19 +0000 (00:28 +0100)]
* eglot.el (package-requires): require flymake 1.0.9 and eldoc 1.2.0

4 years agoDelegate "hover" and "signature" doc synchronization efforts to eldoc
João Távora [Wed, 3 Jun 2020 17:40:58 +0000 (18:40 +0100)]
Delegate "hover" and "signature" doc synchronization efforts to eldoc

Uses Eldoc's eldoc-documentation-functions variable.  In Eldoc v1.0.0
that variable was already available as a way of handling/composing
multiple docstrings from different sources, but it didn't work
practically with mutiple concurrent async sources.  This was fixed in
1.1.0, which Eglot now requires.

This fixes the synchronization problems reported in https://github.com/joaotavora/eglot/issues/494 and also
issue https://github.com/joaotavora/eglot/issues/439.  It is likely that some of the exact doc-composing
functionality in Eglot, (developed during those issues) was lost, and
has to be remade, quite likely in Eldoc itself.

Flymake is now also an Eldoc producer, and therefore the problems of
github issues https://github.com/joaotavora/eglot/issues/481 and https://github.com/joaotavora/eglot/issues/454 will also soon be fixed as soon as Eglot
starts using the upcoming Flymake 1.0.9.

* NEWS.md: New entry.

* README.md (eglot-put-doc-in-help-buffer)
(eglot-auto-display-help-buffer):  Remove mention to these options.

* eglot.el
(Package-Requires:) Require eldoc.el 1.1.0.
(eglot--when-live-buffer): Rename from eglot--with-live-buffer.
(eglot--when-buffer-window): New macro.
(eglot--after-change, eglot--on-shutdown, eglot-ensure): Use eglot--when-live-buffer.
(eglot--managed-mode): Use eglot-documentation-functions and eldoc-documentation-strategy.
(eglot--highlights): Move down.
(eglot-signature-eldoc-function, eglot-hover-eldoc-function)
(eglot--highlight-piggyback):  New eldoc functions.
(eglot--help-buffer, eglot--update-doc)
(eglot-auto-display-help-buffer, eglot-put-doc-in-help-buffer)
(eglot--truncate-string, eglot-doc-too-large-for-echo-area)
(eglot-help-at-point): Remove all of this.
(eglot--apply-workspace-edit): Call eldoc manually after an edit.
(eglot-mode-map): Remap display-local-help to eldoc-doc-buffer

4 years agoFix small problems around eglot's help buffer
João Távora [Sun, 31 May 2020 10:49:51 +0000 (11:49 +0100)]
Fix small problems around eglot's help buffer

Specifically:

- correctly format the message shown to the user about doc being truncated
- don't show message if the buffer is showing in some frame's window
- correctly name the help buffer switched to with `C-h .'.

This is still not ideal:

- When the `C-h .' suggestion is shown to the user, typing that keybinding
  shouldn't result in a new LSP request to fetch probably the same info;
- All this functionality belongs in eldoc.el.

* eglot.el (eglot-help-at-point): Fix buffer name.
(eglot--update-doc): Provide more help.

4 years agoSimplify eglot-code-actions
Andrii Kolomoiets [Wed, 13 May 2020 07:48:26 +0000 (10:48 +0300)]
Simplify eglot-code-actions

If no region is active, ask for code actions at point, even if there
are no diagnostics at point.

Co-authored-by: João Távora <joaotavora@gmail.com>
* eglot.el (eglot-code-actions): Simplify.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/473

4 years agoUse filter-buffer-substring to get buffer text
Andrii Kolomoiets [Tue, 26 May 2020 20:03:39 +0000 (23:03 +0300)]
Use filter-buffer-substring to get buffer text

This way modes used to represent hover info text, such as
gfm-view-mode can e.g. filter out invisible text by providing own
`filter-buffer-substring-function'.

* eglot.el (eglot--format-markup): Use `filter-buffer-substring'.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/482

4 years agoReplace uses of project-roots with project-root
João Távora [Mon, 25 May 2020 10:18:21 +0000 (11:18 +0100)]
Replace uses of project-roots with project-root

* eglot.el (Package-Requires): Require project 0.3.0.
(eglot--connect, eglot-handle-request)
(eglot-initialization-options, eglot--eclipse-jdt-contact): Use
project-root.

4 years agoAlso consider label of a completionitem for snippets
Gary Oberbrunner [Tue, 26 May 2020 13:13:44 +0000 (14:13 +0100)]
Also consider label of a completionitem for snippets

Copyright-paperwork-exempt: yes

* eglot.el (eglot-completion-at-point): Consider label when
expanding snippets.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/480

4 years agoRework computation of string given to eldoc (again)
Andrii Kolomoiets [Wed, 6 May 2020 19:06:35 +0000 (22:06 +0300)]
Rework computation of string given to eldoc (again)

Co-authored-by: Andreii Kolomoiets <andreyk.mad@gmail.com>
Also do some refactoring to join similar logic in
eglot-doc-too-large-for-echo-area and eglot--truncate-string.

* eglot.el (eglot-doc-too-large-for-echo-area): Now returns the
number of lines available.
(eglot--truncate-string): New helper.
(eglot--first-line-of-doc, eglot--top-lines-of-doc): Remove.
(eglot--update-doc): Use new helpers.

* eglot-tests.el (hover-multiline-doc-locus): New test

GitHub-reference: close https://github.com/joaotavora/eglot/issues/459

4 years agoFix type error in eglot--xref-make-match
Philipp Stephani [Mon, 25 May 2020 09:30:32 +0000 (11:30 +0200)]
Fix type error in eglot--xref-make-match

Its first argument is passed to xref-make-match, which expects a string
as its SUMMARY argument, but symbol-at-point returns a symbol.

Co-authored-by: João Távora <joaotavora@gmail.com>
* eglot.el (eglot--lsp-xrefs-for-method): use symbol-name.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/488

4 years agoAdd support for erlang_ls
Rudolf Schlatte [Thu, 21 May 2020 09:20:41 +0000 (11:20 +0200)]
Add support for erlang_ls

* README.md: Mention erlang_ls

* eglot.el (eglot-server-programs): Add erlang_ls

GitHub-reference: close https://github.com/joaotavora/eglot/issues/471

4 years agoCorrectly place diagnostics in narrowed buffers
João Távora [Mon, 18 May 2020 12:10:13 +0000 (13:10 +0100)]
Correctly place diagnostics in narrowed buffers

* eglot.el (eglot--lsp-position-to-point)
(eglot-handle-notification): save-restriction and widen

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/479

4 years agoRequire xref, project and eldoc from gnu elpa
João Távora [Thu, 14 May 2020 22:10:48 +0000 (23:10 +0100)]
Require xref, project and eldoc from gnu elpa

* Makefile (ELPADEPS): Install Xref, Project and Eldoc.

* eglot.el (Package-Requires): Require Xref, Project and Eldoc
from GNU ELPA.

4 years agoPrompt for executable if supplied name does not exist
Dan Davison [Thu, 14 May 2020 00:06:35 +0000 (20:06 -0400)]
Prompt for executable if supplied name does not exist

* eglot.el (eglot--guess-contact): Interpret a list containing a
  single string as an executable when forming the interactive prompt.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/474
GitHub-reference: fix https://github.com/joaotavora/eglot/issues/478

4 years agoDon't call flymake report function if flymake is disabled
Dan Davison [Tue, 12 May 2020 15:50:56 +0000 (11:50 -0400)]
Don't call flymake report function if flymake is disabled

Also fix https://github.com/joaotavora/eglot/issues/472.

Copyright-paperwork-exempt: yes

* eglot.el (eglot-handle-notification): Check that flymake-mode is
  active before calling flymake report function.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/468

4 years agoFix "free variable" warning
Tobias Rittweiler [Thu, 7 May 2020 22:51:44 +0000 (00:51 +0200)]
Fix "free variable" warning

* eglot.el (eglot-events-buffer): Use `eglot-current-server' instead
  of `eglot--cached-server' because the latter is declared later in
  the file.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/460

4 years agoRemove trailing whitespaces
Andrii Kolomoiets [Wed, 6 May 2020 21:35:48 +0000 (00:35 +0300)]
Remove trailing whitespaces

* eglot.el (defvar company-backends, eglot-code-actions):
Remove trailing whitespace

4 years agoSimplify bug-reporting instructions
João Távora [Sun, 3 May 2020 20:59:29 +0000 (21:59 +0100)]
Simplify bug-reporting instructions

We assume the user has a recent enough jsonrpc.el that consolidates
events and stderr int the same transcript.

* README.md (Reporting bugs): Simplify instructions.

* eglot.el (eglot-events-buffer): Can work with no server.

4 years agoSurvive hover responses with empty markdown strings
João Távora [Sun, 3 May 2020 20:37:42 +0000 (21:37 +0100)]
Survive hover responses with empty markdown strings

* eglot.el (eglot-help-at-point): Protect against null eglot--hover-info

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/433

4 years agoRemap display-local-help (c-h .) to eglot-help-at-point
João Távora [Sun, 3 May 2020 20:10:05 +0000 (21:10 +0100)]
Remap display-local-help (c-h .) to eglot-help-at-point

* eglot.el (eglot-help-at-point): Fallback to display-local-help if no
hover doc
(eglot-mode-map): Remap display-local-help to eglot-help-at-point..

GitHub-reference: per https://github.com/joaotavora/eglot/issues/437

4 years agoTweak handling of eldoc-echo-area-use-multiline-p
Theodor Thornhill [Sun, 3 May 2020 09:20:27 +0000 (11:20 +0200)]
Tweak handling of eldoc-echo-area-use-multiline-p

Also close https://github.com/joaotavora/eglot/issues/453

Co-authored-by: João Távora <joaotavora@gmail.com>
* eglot.el (eglot--first-line-of-doc): New helper.
(eglot--update-doc): Tweak docstring.  Simplify.
(eglot-put-doc-in-help-buffer): Tweak docstring

GitHub-reference: per https://github.com/joaotavora/eglot/issues/443

4 years agoFontify markdown source code blocks by default
João Távora [Sun, 3 May 2020 00:00:04 +0000 (01:00 +0100)]
Fontify markdown source code blocks by default

* eglot.el (eglot--format-markup): Set
markdown-fontify-code-blocks-natively to t locally.

GitHub-reference: per https://github.com/joaotavora/eglot/issues/408

4 years agoDeclare markdown support iff gfm-view-mode installed
Felicián Németh [Sat, 11 Jan 2020 18:08:59 +0000 (19:08 +0100)]
Declare markdown support iff gfm-view-mode installed

* eglot.el (eglot-client-capabilities): Support markdown only when
gfm-view-mode is installed.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/408

4 years agoAlways string-trim markup
Theodor Thornhill [Wed, 29 Apr 2020 08:09:24 +0000 (10:09 +0200)]
Always string-trim markup

Co-authored-by: João Távora <joaotavora@gmail.com>
* eglot.el: (eglot--format-markup): Factor string trim out
so we string-trim for all cases

GitHub-reference: close https://github.com/joaotavora/eglot/issues/450

4 years agoKind of honour eldoc-echo-area-use-multiline-p
João Távora [Sat, 2 May 2020 23:43:00 +0000 (00:43 +0100)]
Kind of honour eldoc-echo-area-use-multiline-p

A reworking of an idea and original implementation by Andrii
Kolomoiets <andreyk.mad@gmail.com>.  It doesn't honor it completely
because the semantics for a non-t, non-nil value are tricky.  And we
don't always exactly know what the symbol prefix reliably.

* eglot.el (eglot--update-doc): Kind of honour
eldoc-echo-area-use-multiline-p.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/443

4 years agoUnbreak eglot--guess-contact for host-and-port case
Dan Davison [Fri, 1 May 2020 00:04:24 +0000 (20:04 -0400)]
Unbreak eglot--guess-contact for host-and-port case

* eglot.el (eglot--guess-contact): Fix bug in (host port) connection
case.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/446

4 years agoTweak docstring of eglot-server-programs
Dan Davison [Sun, 26 Apr 2020 02:26:14 +0000 (22:26 -0400)]
Tweak docstring of eglot-server-programs

Co-authored-by: João Távora <joaotavora@gmail.com>
* eglot.el (eglot-server-programs): Fix typos and phrasing.

4 years agoSupport hierarchical documentsymbol in eglot-imenu
Ingo Lohmar [Fri, 20 Sep 2019 16:39:23 +0000 (18:39 +0200)]
Support hierarchical documentsymbol in eglot-imenu

A reworking of an original implementation by Ingo Lohmar
<ingo.lohmar@github.com>

* eglot.el (eglot-client-capabilities, defvar): Add
DocumentSymbol.
(eglot-client-capabilities): Add
:hierarchicalDocumentSymbolSupport.
(eglot--parse-DocumentSymbol): Remove.
(eglot-imenu): Rewrite.

* NEWS.md (1.7): Mention new feature

GitHub-reference: close https://github.com/joaotavora/eglot/issues/303

4 years agoAlso check types when destructuring lsp objects
João Távora [Sat, 2 May 2020 09:30:28 +0000 (10:30 +0100)]
Also check types when destructuring lsp objects

The problem in this issue is that the disambiguation between Command
and CodeAction objects can only be performed by checking the types of
the keys involved.  So we added that to the spec and check it at
runtime.

* eglot.el (eglot--lsp-interface-alist): Add types to
Command. Tweak docstring.
(eglot--check-object): Renamed from eglot--call-with-interface.
(eglot--ensure-type): New helper.
(eglot--interface): New helper.
(eglot--check-dspec): Renamed from eglot--check-interface.
(eglot--dbind): Simplify.
(eglot-code-actions): Adjust indentation.

* eglot-tests.el (eglot-dcase-issue-452): New test.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/452

4 years agoHide eldoc-message on empty hover info
Andrii Kolomoiets [Thu, 23 Apr 2020 07:44:12 +0000 (10:44 +0300)]
Hide eldoc-message on empty hover info

Co-authored-by: João Távora <joaotavora@gmail.com>
* eglot.el (eglot-eldoc-function): Pass nil to eglot--update-doc
on empty hover info.
(eglot--update-doc): Skip update eglot help buffer if string
is nil.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/439

4 years agoTests: print contents of *eglot ...* buffers in batch mode.
Tobias Rittweiler [Sun, 26 Apr 2020 15:30:11 +0000 (17:30 +0200)]
Tests: print contents of *eglot ...* buffers in batch mode.

Useful for the CI on github. To be able to see more of the context of
a failure.

* eglot.el (eglot-server-initialized-hook): Changed semantics. Now
called when an instance of `eglot-lsp-server' is created as part of
the "connect to server" flow. Previously, there was no difference
between this hook and `eglot-connect-hook' which continues to be run
once a connection was successfully established. The
`eglot-server-initialized-hook' will now capture ALL server instances
including those that failed to be started. This change was necessary
to make the test suite be able to dump the output of processes that
fail to start when running the test suite in batch mode ("make check"
and the CI.) In PR https://github.com/joaotavora/eglot/issues/448 it was decided that it is ok to change the
semantics of this hook rather than introducing a new hook.
(eglot--connect): Change place of where the hook is run.
(eglot-connect-hook): Initialized now with
`eglot-signal-didChangeConfiguration' which was kept in
`eglot-server-initialized-hook' before.

* eglot-tests.el (eglot--call-with-fixture): Use
`eglot-server-initialized-hook' rather than `eglot-connect-hook'. And
dump the contents of the *EGLOT ...* buffers when run in
`noninteractive' (i.e. batch) mode.
(eglot--cleanup-after-test): New auxiliary function. Extracted
verbatim out of `eglot--call-with-fixture` in order to lower the
latter's LOC.

4 years agoCreate match xrefs when possible
Trevor Murphy [Fri, 24 Apr 2020 18:52:01 +0000 (11:52 -0700)]
Create match xrefs when possible

"Match xrefs" are created with `xref-make-match' instead of
`xref-make'.  Match xrefs support `xref-query-replace-in-results' from
the results buffer.

* eglot.el (eglot--xref-make-match): Calculate xref match length from
  the eglot range.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/435

4 years ago* eglot.el (eglot-put-doc-in-help-buffer): tiny docstring fix.
João Távora [Fri, 24 Apr 2020 15:33:36 +0000 (16:33 +0100)]
* eglot.el (eglot-put-doc-in-help-buffer): tiny docstring fix.

4 years agoDon't reupdate help buffer if already rendered
João Távora [Fri, 24 Apr 2020 14:39:16 +0000 (15:39 +0100)]
Don't reupdate help buffer if already rendered

* eglot.el (eglot--update-doc): Don't reupdate if doc buffer
already exists.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/445

4 years agoUse text-mode for plaintext markup
Andrii Kolomoiets [Thu, 23 Apr 2020 20:41:22 +0000 (23:41 +0300)]
Use text-mode for plaintext markup

* eglot.el (eglot--format-markup): Use text-mode for
plaintext markup.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/444

4 years agoUpdate dependencies and copyright years
Felicián Németh [Tue, 21 Jan 2020 18:35:34 +0000 (19:35 +0100)]
Update dependencies and copyright years

* eglot.el: Update dependencies and copyright years.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/413

4 years agoSimplify a bit of code
Theodor Thornhill [Fri, 3 Jan 2020 20:42:08 +0000 (21:42 +0100)]
Simplify a bit of code

Co-authored-by: João Távora <joaotavora@gmail.com>
* eglot.el (eglot-move-to-lsp-abiding-column): use
already existing function to refer to lsp-abiding-column

GitHub-reference: close https://github.com/joaotavora/eglot/issues/397

4 years ago* eglot.el (version): bump to 1.6
João Távora [Thu, 16 Apr 2020 09:31:01 +0000 (10:31 +0100)]
* eglot.el (version): bump to 1.6

* NEWS.md: Bump to 1.6

4 years agoAbide by lsp when reporting and moving to columns
Felicián Németh [Sun, 19 Jan 2020 10:13:20 +0000 (11:13 +0100)]
Abide by lsp when reporting and moving to columns

* eglot.el (eglot-current-column-function): Set to
eglot-lsp-abiding-column.
(eglot-move-to-column-function): Set to
eglot-move-to-lsp-abiding-column.

* NEWS.md: Log the change here as well.

Co-authored-by: João Távora <joaotavora@gmail.com>
GitHub-reference: fix https://github.com/joaotavora/eglot/issues/361

4 years agoFix eglot-move-to-lsp-abiding-column ()
João Távora [Sun, 19 Jan 2020 10:02:55 +0000 (11:02 +0100)]
Fix eglot-move-to-lsp-abiding-column ()

Ensure conformance with the this part of the specification: "if the
character value is greater than the line length it defaults back to
the line length."

* eglot.el: (eglot-move-to-lsp-abiding-column): Don't move beyond
line-end.

GitHub-reference: https://github.com/joaotavora/eglot/issues/361

4 years agoSend shutdown and exit messages without arguments
Felicián Németh [Thu, 16 Apr 2020 07:38:31 +0000 (09:38 +0200)]
Send shutdown and exit messages without arguments

Fix regression introduced in 70e6157b (https://github.com/joaotavora/eglot/issues/315).  According to the
LSP specification the exit notification and the shutdown request
shouldn't have arguments ("params: void").  Note that jsonrpc.el
send nil as null on the wire.

* eglot.el (eglot-shutdown): Change back the arguments of
:shutdown and :exit to nil.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/430

4 years agoIgnore empty hover info
Felicián Németh [Fri, 20 Mar 2020 08:42:44 +0000 (09:42 +0100)]
Ignore empty hover info

This just mimics a similar check in `eglot-help-at-point'.

* eglot.el (eglot-eldoc-function): Check emptiness of `contents' more
carefully.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/425