497626e
Re-filter existing completions on selection update
Click to expand commit body
We still request new completions, but this ensures results are up-to-date in the meantime.
Also: Cancel any pending completions task when we dismiss the completions dialog or start a new completions request.
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Nathan Sobo
and
Antonio Scandurra
created
b89a39b
Filter and sort suggestions in autocomplete
Click to expand commit body
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Antonio Scandurra
and
Nathan Sobo
created
bcbd265
Dismiss autocomplete when moving outside of a word
Antonio Scandurra
created
92f0491
Don't assign completion_state when completions are empty
Nathan Sobo
created
327ddbe
Always issue a new completions request when typing a trigger character
Click to expand commit body
We'll interpolate the anchor range of original request, but it's still a good idea to be up-to-date in case the language server is influenced by the content preceding the location. This doesn't *seem* to be the case with rust-analyzer so far, but it's how VS Code works so let's do it this way.
Nathan Sobo
created
ae0237c
Create anchors with latest snapshot when completions are ready
Click to expand commit body
Using the previous snapshot was panicking.
Nathan Sobo
created
fde03b1
Make the anchor range inclusive on completions
Click to expand commit body
This will help us to correctly interpolate the replacement range when we confirm before receiving new completions after typing with a completion open.
Nathan Sobo
created
1d1f8df
Trigger completion when typing words or trigger characters
611538f
Clear highlighted matches when dismissing `FindBar`
Antonio Scandurra
created
b1639e5
Add cmd-g and cmd-shift-g to jump to next / previous result
Click to expand commit body
I added the action handler on Pane so we can use these bindings when the find bar isn't focused.
Nathan Sobo
created
f90193b
Populate query and select it only if find bar isn't already deployed
Antonio Scandurra
created
83423a4
Use cmd-f to move focus back to the editor when find bar is focused
Antonio Scandurra
created
9ce1eda
Bind `cmd-e` to deploy `FindBar` without focusing it
Antonio Scandurra
created
ce52704
Propagate `Cancel` when editor is not in full mode
Click to expand commit body
This is consistent with what VS Code and Sublime Text do and allows the user to
perform only one keybinding to e.g. dismiss the find bar when the query is
(partially) selected.
Antonio Scandurra
created
c53b6b9
Populate query with text under selection when hitting `cmd-f`
Antonio Scandurra
created
2a1b1ad
Bind `enter` and `shift-enter` in `FindBar`
a284e71
Always return valid locations when refreshing anchors
Click to expand commit body
Specifically, with this commit:
- We will now refresh the anchor if it escapes the boundaries of the excerpt by
using the `Excerpt::contains` method. This was not the case before, as we were
just checking if the excerpt id and buffer id of the anchors matched the ones
stored on the excerpt.
- We fixed a bug that was causing the anchor to be outside of the excerpt when
resetting it to one of the excerpt's endpoints after we couldn't keep its
position. This would happen because we were using `anchor_at`, which resolved
the anchor to an offset first and then converted it back into an anchor with
the given bias, which is a lossy operation. We now use `Anchor::bias` to
achieve the same goal: note that this could still lead to the anchor escaping
the excerpt's boundary when the bias doesn't match the endpoint's bias, so we
take extra care to avoid that and `min`/`max` the newly-produced anchor with
the other endpoint.
Antonio Scandurra
created
2d6e348
Prevent anchors from escaping their excerpt's range when resolving them
Click to expand commit body
This could happen if an anchor was created on an excerpt with a larger range.
Then, if the excerpt was removed and added back at the same position and with
the same buffer but a smaller range, resolving the anchor could overshoot
the excerpt's boundaries.