Commit Graph
123 Commits
Author SHA1 Message Date
Antonio Scandurra acb9d5158a Fix warnings 2022-03-02 12:45:49 +01:00
Antonio Scandurra ef7bccfa76 Make dhat optional 2022-03-02 11:02:10 +01:00
Antonio Scandurra 3ae035a9ad Advance clock when simulating random delay 2022-03-02 10:39:46 +01:00
Antonio Scandurra 694ea5ca74 Delete timer state when the future that's awaiting it gets dropped 2022-03-02 10:08:38 +01:00
Max Brunsfeld 4a6b77de77 Avoid storing type name string on AnyViewHandle
It won't be needed for leak error messages, because the typed
view handle will typically be created first. And this avoids
increasing the size of the handle used in production.
2022-03-01 18:22:09 -08:00
d19e8f03af Remove debug_elements_callbacks from App
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-03-01 19:16:58 +01:00
Antonio Scandurra d2041fda05 Fix Presenter leak when removing windows 2022-03-01 18:50:05 +01:00
Antonio ScandurraandNathan Sobo 9a3147043a Make TestAppContext and its dependencies available only in tests
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-01 17:01:52 +01:00
Antonio ScandurraandNathan Sobo 6c3b6bca75 Detect when view handles are leaked
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-01 16:11:12 +01:00
Antonio ScandurraandNathan Sobo 668f791a8b Enable leak backtraces by setting LEAK_BACKTRACE=1
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-01 16:00:40 +01:00
Antonio Scandurra 79568c471a Pass a reference to TestAppContext in tests
This allows us to drop the context *after* we ran all futures to
completion and that's crucial otherwise we'll never drop entities
and/or flush effects.
2022-03-01 12:01:02 +01:00
Antonio Scandurra 51f111880b Allow capturing references in the future passed to Deterministic::run 2022-03-01 11:59:58 +01:00
Antonio Scandurra bfb04b57ec Remove all windows on dropping TestAppContext
This allows us to remove the dropped entities and flush effects as
necessary.
2022-03-01 10:55:12 +01:00
Antonio Scandurra 6955c5d781 Avoid reference cycle between Client and its models 2022-03-01 10:55:05 +01:00
Max Brunsfeld 45cc78730d WIP - include dhat for memory profiling tests 2022-02-28 22:52:21 -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 BrunsfeldandNathan 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
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 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 SoboandMax 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 SoboandMax 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 3ddad9b085 Don't insert input in editor when control keys are pressed 2022-02-21 18:21:27 -07:00
Antonio Scandurra 099f4fab72 Replace Inconsolata with Zed Mono and Zed Sans 2022-02-18 14:55:11 +01:00
Max Brunsfeld 0da0b2611e Automatically include current view id in element state ids 2022-02-17 13:44:46 -08:00
Antonio Scandurra 6016d827f2 Randomly detach requests on guest to let them race with other local ops 2022-02-17 09:05:06 +01:00
Antonio Scandurra 1eb9f1d773 Print the correct seed on randomized test failure 2022-02-16 16:29:45 +01:00
Antonio Scandurra 1ea3c507de Clean db pool on drop only if assertions fail or it's the last iteration 2022-02-16 15:07:41 +01:00
Max BrunsfeldandNathan Sobo 0abb37d63a Add AnyWeakModelHandle
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-15 17:56:50 -08:00
Max Brunsfeld 5cdf498001 In random collaboration test, add failing assertion for worktree convergence 2022-02-15 14:55:38 -08:00
Antonio Scandurra fade2ba0c9 Start on a randomized integration test 2022-02-15 17:33:43 +01:00
Antonio Scandurra 36574d1941 Don't render sample item twice in UniformList 2022-02-15 12:02:58 +01:00
Max BrunsfeldandNathan Sobo 6de4302266 Panic if element state is used twice in the same frame
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-14 14:04:27 -08:00
Antonio Scandurra 04e0b7f5fc Add integration test for code actions 2022-02-14 11:42:56 +01:00
Antonio Scandurra 9579835699 Ensure response barrier is always dropped, even if request is canceled 2022-02-12 10:23:50 +01:00
Antonio ScandurraandNathan Sobo 85cdfddb31 Fetch code actions on cursor movement instead of on-demand
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-11 14:41:19 +01:00
Max Brunsfeld 1e18742c9d Merge branch 'main' into assists 2022-02-08 12:41:57 -08:00
Max BrunsfeldandNathan Sobo 656fee96e6 Use a pool of databases to speed up integration tests
Also, use env_logger consistently in the tests for each crate.
Only initiallize the logger at all if some RUST_LOG env var is set.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-07 15:00:00 -08:00
Nathan Sobo c834a274db Start on code action confirmation 2022-02-05 12:37:34 -07:00
Max Brunsfeld 1f4a53a4a5 Handle appkit's cancelOperation: message to allow binding cmd-. 2022-02-04 17:33:09 -08:00
Antonio ScandurraandNathan Sobo 997d9048d9 Finish writing test for the new autocompletion behavior
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-04 15:47:19 +01:00
Antonio Scandurra b0792751c8 Fix flaky test_highlighted_ranges due to random TypeId ordering 2022-02-02 10:09:12 +01:00
Antonio ScandurraandNathan Sobo e150081fa1 Filter and sort suggestions in autocomplete
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-01 15:11:20 +01:00
Max BrunsfeldandNathan Sobo e737c6fdfe Derive autocomplete menu's width from the width of its largest item
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-31 13:01:20 -08:00
Nathan SoboandAntonio Scandurra e8094adae4 Bind autocomplete to ctrl-space
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-01-31 11:34:19 -07:00
Antonio ScandurraandNathan Sobo 3adb1789b3 Maintain search results as query and active editor changes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-28 15:19:58 +01:00
b485554e64 Take an Into<AnyViewHandle> in ChildView::new
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-27 17:54:45 +01:00
Max BrunsfeldandNathan Sobo 4b081bd128 Use Rust 2021 edition in all crates
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-26 12:50:31 -08:00
Antonio ScandurraandMax Brunsfeld 3506c564d9 Alpha-blend borders with backgrounds in quad SDF
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-26 19:16:26 +01:00
Antonio ScandurraandNathan Sobo 506b462d53 Fix blending of quad's border with background
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-26 17:06:20 +01:00