Max Brunsfeld
c79f033b5c
Avoid retaining executor in the FakeFs
...
This probably isn't the *root* cause of why an executor is leaked,
but by cutting off this cyclic references, it may make it a bit easier
to track down leaks of an executor.
2022-02-28 22:40:04 -08:00
Max Brunsfeld and Nathan Sobo
29edf2691a
Clean up guest connection states correctly when a collaborator disconnects
...
This bug was caught by running the executor until parked after tests.
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-02-28 22:21:32 -08:00
Max Brunsfeld
45e85d6010
Clear the executor at the end of a test by running until it is parked
2022-02-28 22:20:03 -08:00
Max Brunsfeld
c25017e61f
Flush effects when dropping a TestAppContext
...
This way, at the end of a test, dropped entities will be removed, and will drop
the handles that they hold.
2022-02-28 22:17:20 -08:00
Max Brunsfeld and Nathan Sobo
fe6bc5e188
Start work on detecting leaked handles in tests
...
For now, just track models. Tests fail because we don't
yet clear the app contexts at the right time.
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-02-28 22:02:43 -08:00
Max Brunsfeld and Antonio Scandurra
912613a5a1
Never close buffers when sharing
...
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
2022-02-28 11:36:43 -08:00
Antonio Scandurra and Nathan Sobo
294165e748
Make SearchProject a Foreground message
...
However, the randomized integration test is still failing:
```
ITERATIONS=100000 SEED=3027 OPERATIONS=200 cargo test --release test_random --package=zed-server -- --nocapture
```
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-02-28 16:19:34 +01:00
Antonio Scandurra
24970776cf
Don't use a bounded channel for signaling that buffers have been opened
...
Blocking the sender could halt deserialization for no reason if nobody
is consuming the notifications.
2022-02-28 15:26:10 +01:00
Antonio Scandurra
1cc27466f8
Don't delete buffer state when calling get_open_buffer
...
...as we might be in the process of completing a request that could
open a buffer. This was causing a failure in the randomized integration
test.
2022-02-28 14:27:31 +01:00
Antonio Scandurra
145c465796
Add project-wide search to randomized integration test
2022-02-28 14:22:31 +01:00
Antonio Scandurra
77d4c68f87
Include buffer's deferred ops when computing has_buffered_operations
2022-02-28 14:22:24 +01:00
Antonio Scandurra
501f06154f
Add unit test for project search
2022-02-28 11:10:22 +01:00
Antonio Scandurra
1a59cfc89a
Extract a common match_index_for_direction and active_match_index
2022-02-28 10:34:11 +01:00
Nathan Sobo
7cfe2c22ec
Fix warning
2022-02-27 18:17:15 -07:00
Nathan Sobo
874b1c1537
Re-activate the most recently-activated project search on cmd-shift-F
...
This commits adds the beginnings of an application state facility as a non-static place to store the most recently-activated search for each project.
I also store workspace items by descending order of their entity id so that we always fetch the newest item of a given type when calling `Workspace::item_of_type`.
2022-02-27 18:07:46 -07:00
Nathan Sobo
bf5783cb62
Focus the project find results editor on a tab in the query editor
2022-02-27 16:15:06 -07:00
Nathan Sobo
c61f84196e
Add capture phase for action dispatch
...
Just like the DOM, we now bubble events down the tree during a capture phase before bubbling them back up.
2022-02-27 16:14:40 -07:00
Nathan Sobo
d1523063ae
Select first match when results are ready
2022-02-27 14:24:06 -07:00
Nathan Sobo
76ac710d21
Fix warning
2022-02-27 14:21:28 -07:00
Nathan Sobo
d672aa41eb
Implement navigation between project search matches
2022-02-27 14:18:04 -07:00
Nathan Sobo
5f24a95e7e
Make versions oldest_selection and newest_selection that don't require snapshots
...
I thought I needed this but actually didn't, but I still kinda think it's a good change for the public interface of Editor.
2022-02-27 13:02:09 -07:00
Nathan Sobo
daa9b0fb75
Introduce ProjectSearchView constructor
...
We had some duplication when cloning on split, so this is to unify that before we add any more complexity to construction.
2022-02-27 09:49:16 -07:00
Nathan Sobo
d66a460a8d
Clone editor's searchable state on split
2022-02-27 09:48:46 -07:00
Nathan Sobo
dbd1a23841
Add log dependency in search crate
2022-02-27 09:25:40 -07:00
Nathan Sobo
3d3922e18e
💄
2022-02-27 09:25:27 -07:00
Nathan Sobo
0ab1b65d1c
Limit project search tab label to 24 characters
...
I'd love to fade the text out, but for now I just append an ellipsis.
2022-02-27 08:27:02 -07:00
Nathan Sobo
9fef8b069d
Rename "find" to "search"
...
Search is both a verb and a noun, which makes it more natural to use in situations where we need to name a thing rather than a process.
2022-02-27 08:15:38 -07:00
Nathan Sobo
e8eeccda88
Remove carriage returns
2022-02-27 07:47:46 -07:00
Nathan Sobo
d5c19f641f
Select query when focusing query editor
...
Also: Clear the selection when we focus the results editor because we continue to render the selection even when the editor isn't focused and it looks awkward. Another approach we could take is to not render selections for non-focused editors, either always or with an option. But considering that we select all anyways next time we return focus to the query editor, I think this is ok for now.
2022-02-26 14:12:31 -07:00
Nathan Sobo
a4ba94d506
Activate the *newest* existing project find view on cmd-shift-F
2022-02-26 14:03:14 -07:00
Nathan Sobo
08409a57ed
Allow a new search to be created with cmd-enter
...
This replaces the `cmd-alt-shift-F` binding to open a new search. Instead, you can preserve the existing search results by entering a query and then hitting `cmd-enter` instead of `enter`. This opens a new project find view and restores the previous view to whatever query it was previously displaying. It's a bit strange, but I don't want to rely on splitting as the only way of creating multiple sets of search results.
2022-02-26 13:23:05 -07:00
Nathan Sobo
e9a05aebb2
Render a magnifier icon and the query in project search tab
...
Also: Wire up events so the modified status updates correctly.
2022-02-26 08:21:38 -07:00
Antonio Scandurra
f3de2f2385
Don't focus results editor on cmd-shift-f when there are no results
2022-02-26 14:43:02 +01:00
Antonio Scandurra
c311f59dca
🎨
2022-02-26 14:31:36 +01:00
Nathan Sobo
31c9e9be24
Always open a new project find on alt-cmd-shift-F
2022-02-25 19:48:43 -07:00
Nathan Sobo
47088e9bf4
Only store one nav history entry when opening excerpts
...
Also: Introduce the ability to disable and enable the nav history directly. This allows us to explicitly push an entry when opening excerpts and then disable all pushes as we open individual buffers.
2022-02-25 19:26:15 -07:00
Nathan Sobo and Max Brunsfeld
b212b31d0a
Open excerpts on alt-enter
...
Also: Remove special handling for alt-shift-D binding in diagnostics view that opens excerpts. Rely on alt-enter in all multi-buffers instead.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2022-02-25 16:49:28 -07:00
Nathan Sobo and Max Brunsfeld
1b9c112890
Don't show buffer search UI on ProjectSearchView
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2022-02-25 16:14:45 -07:00
Nathan Sobo and Max Brunsfeld
54ef82a002
Allow actions to be propagated from nested ViewContexts
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2022-02-25 16:14:16 -07:00
Nathan Sobo and Max Brunsfeld
a000ddfb96
Implement Debug for keymap::MatchResult
...
Helpful when debugging issues with keystroke dispatch.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2022-02-25 16:13:53 -07:00
Nathan Sobo and Max Brunsfeld
288da2114c
Extract generic forward_project_request function on server
...
All these methods did the same thing with different message types.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2022-02-25 15:20:42 -07:00
Nathan Sobo and Max Brunsfeld
d25da1a985
Handle project-wide search on guests
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2022-02-25 15:09:47 -07:00
Max Brunsfeld
44feb71b99
Add project search RPC messages
2022-02-25 12:38:31 -08:00
Max Brunsfeld
97d044e1a0
Upgrade time crates to silence warning on Rust 1.59
2022-02-25 10:39:44 -08:00
Max Brunsfeld and Antonio Scandurra
868e66f385
Eliminate RwLock around LanguageServer's outbound message channel
...
We observed a deadlock when quitting zed. The main thread was attempting
to acquire a write lock to this outbound message sender. We weren't able
to understand exactly how this occurred, but we removed the use of a
lock there, so this shouldn't happen anymore.
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
2022-02-25 10:04:57 -08:00
Antonio Scandurra and Max Brunsfeld
c9b3061f85
Reuse a previous project find whenever possible
...
Co-Authored-By: Max Brunsfeld <max@zed.dev >
2022-02-25 18:30:28 +01:00
Antonio Scandurra and Max Brunsfeld
55ec98b42c
Don't assume that cloning on split will reuse the same underlying model
...
Co-Authored-By: Max Brunsfeld <max@zed.dev >
2022-02-25 18:30:04 +01:00
Antonio Scandurra and Nathan Sobo
15852294ea
Don't share query editor state after project find has been split
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-02-25 18:10:48 +01:00
Antonio Scandurra
4a781d0ef5
Don't focus query editor if there are matches on tab switch
2022-02-25 17:23:03 +01:00
Antonio Scandurra
d15fb9c3dc
Use the new split pane's navigation history when cloning an item
2022-02-25 17:22:30 +01:00