This is useful for resetting multiple changes at once. For example you
might use 'maf' or even '%' to select a larger region and reset all
changes within.
The original behavior of resetting the change on the current line is
retained when the primary selection is 1-width since we look for chunks
in the line range of each selection.
It can be convenient to define project specific debugger templates, some of
which might not necessitate prompting the user to define completion.
This commit makes completion optional for debugger templates and starts the
dap immediately if undefined or empty.
some LSPs does update the active signature and some not. To make both
worlds happy, make the active signature more intelligent.
1. SignatureHelp store now the suggested lsp_signature
2. if the lsp_signature changes then use it
3. otherwise use the last signature from the old popup
4. in case the old signature doesn't exist anymore, show the last signature
Signed-off-by: Ben Fekih, Hichem <hichem.f@live.de>
Trunctation should always be handled by the parent. Returning None is
only supposed to indicate a missing implementation
Co-authored-by: Ben Fekih, Hichem" <hichem.f@live.de>
While moving completion resolve to the event system in #9668 we introduced what
is essentially a "DOS attack" on slow LSPs. Completion resolve requests were
made in the render loop and debounced with a timeout. Once the timeout expired
the resolve request was made. The problem is the next frame would immediately
request a new completion resolve request (and mark the old one as obsolete but
because LSP has no notion of cancelation the server would still process it). So
we were in essence sending one completion request to the server every 150ms and
only stopped if the server managed to respond before we rendered a new frame.
This caused overload on slower machines/with slower LS.
In this PR I revamped the resolve handler so that a request is only ever
resolved once. Both by checking if a request is already in-flight and by marking
failed resolve requests as resolved.
Make the popup positions more consistent.
Improvements:
1. if the signature popup content is bigger than the available space,
then the popup is always shown under the cursor, even if there more
space above the cursor than below
2. There is no mutation anymore inside required_size. Maybe in the future
we can update all widgets to have no mutations and change the trait
Signed-off-by: Ben Fekih, Hichem <hichem.f@live.de>
Currently the editor mode has no effect on the behavior of `search` and
`rsearch`. We can pass in the right movement for the editor mode to make
the behavior or `search` and `rsearch` match `search_next` and
`search_prev` in select mode.
implement handle_event to cycle through the function signatures.
To change the signature press alt+p/n .
Signed-off-by: Ben Fekih, Hichem <hichem.f@live.de>
when the available height for the popup is low/small, then it is not
possible to scroll until the end
Signed-off-by: Ben Fekih, Hichem <hichem.f@live.de>
Previously unnecessary/deprecated diagnostic tags replaced the highlight
for the severity of a diagnostic. This could cause either the severity
or unnecessary/deprecated scopes to disappear when diagnostic ranges
overlapped though. Plus the severity highlight can be interesting in
addition to the unnecessary/deprecated highlight.
So this change separates the unnecessary and deprecated highlights from
the severity highlights, so each is merged separately and when they
overlap, the highlights are combined.
This reverts commit 0dc67ff885.
See the post-merge discussion in #9828. The old behavior was less
surprising and we have other ways to abort from a prompt, so let's
revert the behavior change.
This uses the new TreeCursor type from the parent commit to reimplement
the tree-sitter motions (`A-p/o/i/n`). Other tree-sitter related
features like textobjects are not touched with this change and will
need a different, unrelated approach to solve.