Commit Graph

26 Commits

Author SHA1 Message Date
Horacio Sanson c984daa0ec
Fix 4141 - Stop press enter prompt on long diagnostic messages (#4144)
* Fix 4141 - Stop press enter prompt on long diagnostic messages

* Fix 4139 - Check for array before join truncated_echo
2022-04-06 10:51:07 +09:00
Amadeus Demarzi b3d1d6eecf
Use echon over echom for cursor echo (#3888)
* Problem messages no longer clutter `:messages`
* Messages are truncated better
2022-04-01 13:54:23 +01:00
Amadeus Demarzi 35d0bd1519
Fix truncated echo (#3889)
* Fix truncated echo

In typescript, when putting the cursor on a `>` character of an arrow
function, the displayString body comes back as an empty string, and
means the split operation has 0 items, causing a failure when attempting
to call TruncatedEcho.

Even if there's a better fix, I'd assume this is a good safety since we
are injesting external data.

* Convert to use `empty()`
2021-09-06 11:26:32 +09:00
Kevin Clark 39f393ef07
Add nvim floating window support (replaces #3314) (#3470)
* Add nvim floating window hover support
* Add configuration for float to replace preview
* preview#ShowFloating: qualify local variables
* Configure floating preview usecases individually

Also:
  * Extract floating preview to its own file.
  * Ignore 'stay_here' option. Moving into the floating preview window
    seems confusing at best.
  * Re-use existing floating preview window if it's still up.
  * Flush out floating preview documentation.

* Watch cursor position changes per window

Floating previews open a new window, so when that window is written to,
it moves briefly there at a different position than the original window.
This makes repeated positions detected when positions are tracked at a
s: level. Instead, we change the variable to window scoped, which only
fires a message if the cursor has changed from the last position in
*that window*.

* g:ale_floating_preview cleanup
* floating_preview: add ALEDetail tests
* Fix fecs test missing runtime call
* Add ALEHover floating preview tests

Co-authored-by: Jan-Grimo Sobez <jan-grimo.sobez@phys.chem.ethz.ch>
2021-01-14 18:06:20 +00:00
w0rp a139599d39
Close #2727 - Add a hover-only setting for balloons 2020-11-21 20:12:09 +00:00
w0rp 4df352eee5
Fix #3294 - Fix hover off by 1, handle LSP server crashes 2020-08-18 01:48:07 +01:00
w0rp 64d4c951ae
Fix #3281 - Stop CursorHold flickering 2020-08-13 02:22:21 +01:00
w0rp 7c4b1d8444
Close #3274 - Handle basic LSP markdown formatting 2020-08-12 22:11:45 +01:00
w0rp f741245f11
Fix #3273 - Handle missing keys in hover information 2020-08-07 12:34:45 +01:00
w0rp cdd8d38e2f
Fix #3266 Part 2: Fix Harder 2020-08-06 09:36:00 +01:00
w0rp fa3a927ca3
Fix #3266 - Truncate hover messages for LSP too 2020-08-05 13:46:08 +01:00
w0rp acf892c4d1
#1532 - Display hover information on CursorHold 2020-08-04 20:11:49 +01:00
Ildar Akhmetgaleev 31d6f72abf Add option to show hover messages in preview.
Add new option 'ale_hover_to_preview' to show hover messages
in preview window.
2019-10-12 16:45:12 +07:00
w0rp 5505f2323d
Fix #2330 - Do not use getcurpos() to avoid changing curswant 2019-03-07 12:28:42 +00:00
w0rp 1ee56713b8
#2132 Use an on-init callback for all LSP logic 2019-02-13 17:26:37 +00:00
w0rp 3e11cbd18d
Update syntax checking
* Line continuation characters should be on the same lines.
* .vim file line indentation should be a multiple of 4.
2019-02-06 18:05:13 +00:00
w0rp 39c892eff4
#1520 - Add an :ALEDocumentation for tsserver 2018-12-10 20:08:28 +00:00
w0rp c4eca7c417
Use one LSP connection per project 2018-08-24 13:16:58 +01:00
w0rp 9cdd8b67b2
Stop creating closure function in global scope by using partials instead 2018-08-15 00:20:47 +01:00
w0rp 06132954b1
Switch to v:t_ variables for type checks 2018-07-25 01:27:28 +01:00
w0rp 6dc737cda1
Check LSP capabilities before using them 2018-07-22 19:04:55 +01:00
w0rp bda89506ba
Lazy-load LSP linters, and check b:changedtick before notifying about changes 2018-06-15 10:01:28 +01:00
Gerry Agbobada 3a3c244723 TUI / GUI tooltip with content from ALEHover (#1556)
* Guard the ballooneval settings

* Mark main objectives to do to get nice Hover

* Make tweaks to make the tooltip work - See " XXX: comments

* Guard balloon_show call

* Use return instead of finish for functions

* ale#hover#show : Add optional arguments to specify arbtirary position

This change is requested to be able to call the function with mouse
position to enable hover information in vim's balloon

* ale#ballon#Disable : Remove feature guards

* ale#balloon : Show 'ALEHover' output on balloon if no diagnostic found

* ale#hover#HandleLSPResponse : remove the check for cursor position

This check prevented the 'ALEHover in balloon' feature, since mouse
position is almost never cursor position.

* ale#balloon#MessageForPos : Change the return of balloonexpr

balloonexpr evaluation now works even without balloon_show for basic
diagnostics, leaving the balloon_show call to ale#hover#Show, which can
then feature guard the call to avoid errors

* ale#hover#Response : Feature guard balloon_show calls

* ale#hover : always display 'Hover' information in messages

Also add a small comment to warn readers the different outputs the
ale#hover#Show will write to

* {LSP,TS}Response : use only variables from the Response

It is clearer that we only rely on l:options to get the relevant data to
build the LSP Response string

* hover#ShowDetails : fix an issue where not having focus broke balloons

The issue was caused by not using a buffer-specific version of getline()
to cap the value of the column sent in the message to LSP. Therefore a
cursor on column 10 in an inactive window could send a message with
column=0, if the active window had a buffer with too few lines

* {LSP,TS}Response : Remove redundant checks for balloon_show call

With the upcoming change in ale_set_balloons default value (see Pull
Request w0rp/ale#1565), this check will be useless

* balloonexpr? : Add a flag to separate hover#Show() calls

The goal of this flag is to make `:ALEHover` calls not pop a balloon
under the cursor, since the user has probably no interest in their
cursor while typing the command

The flag is a default argument which is overridden only in ballonexpr
call of ale#hover#Show, and stays set in the hover_map until the
callback for the LSP handles it.

There are no automated tests for this feature right now, and the nature
of the addition (one optional argument in the API) should make it
transparent to existing tests.

Since the differentiation is now possible, the check for moved cursor
has been put back in ale#hover#HandleLSPResponse

* ale#hover#hover_map : Protect accesses to hover_map

Using get() is safer than trying to access directly with ., as the tests
show.

* Raise timeout to try to get Appveyor happy

* Review : Fix comments

* Review : pass the optional argument 'called_from_balloonexpr' in a Dict

This optional dictionary has documentation just before the function
using it, ale#hover#Show, and allows easier extension in the future.
2018-05-16 21:23:48 +01:00
w0rp d8d09c2048
Close #1428 Implement LSP hover-like functionality for tsserver too 2018-04-26 21:54:11 +01:00
w0rp ebbf7d0353
#1428 Show multiline hover messages, and document the new command 2018-04-24 21:03:06 +01:00
w0rp ef130c4428
#1428 Start implementing LSP hover support 2018-04-22 22:00:25 +01:00