Commit Graph
2595 Commits
Author SHA1 Message Date
Nathan SoboandMax Brunsfeld 1649ac364b Clear shared buffers when unsharing projects
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-01-24 17:24:07 -07:00
Nathan SoboandMax Brunsfeld b3cf3f1378 Get most tests passing when respecting wake order for foreground tasks in Deterministic executor
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-01-24 17:13:56 -07:00
Antonio Scandurra bbe3ca6d43 WIP: Start restructuring executor 2022-01-24 18:49:20 +01:00
Antonio Scandurra 48d0a0df2f Fix race condition when opening a buffer and getting a definition to it 2022-01-24 18:47:55 +01:00
Antonio Scandurra 70a6a9c7ee Remove executor::Foreground::Test
All code paths have already transitioned to `Foreground::Deterministic`.
2022-01-24 16:14:30 +01:00
Antonio Scandurra cc87023fac Verify simultaneously opening buffers via definition and open_buffer
This fails because we don't yet handle this scenario.
2022-01-24 15:08:04 +01:00
Antonio Scandurra 09bf007a4f Add remote worktree to project before it is fully deserialized
This prevents a race condition where the host will send us messages and
responses about a worktree that we have seen but haven't yet finished loading.
2022-01-24 14:00:38 +01:00
Antonio Scandurra be4c6bfaf4 Implement Project::definition when the buffer is remote 2022-01-24 13:10:13 +01:00
Antonio Scandurra 1e5fc5aa27 Fix regression causing guests to miss operations while opening a buffer 2022-01-24 11:28:46 +01:00
Antonio Scandurra 12cd2872e4 Merge pull request #360 from zed-industries/improve-files
Improve remote file handling
2022-01-24 10:27:01 +01:00
Antonio Scandurra 4fd9866e83 Don't show conflict indicator on remote buffer after a reload 2022-01-24 10:17:36 +01:00
Antonio Scandurra 3f3f6ed9f1 Maintain remote buffers via UpdateBufferFile messages sent by host 2022-01-24 09:32:40 +01:00
Nathan Sobo 7b97dde632 Send File protos as part of Buffer protos
Use the File proto to build the File associated with the buffer rather than relying on the local entry.
2022-01-22 22:19:04 -07:00
Nathan Sobo 9155b4a588 Introduce LocalFile trait
If you want to call `abs_path` or `load`, the file needs to be local. You call `as_local` which returns `Option<dyn LocalFile>` with those local-only methods. I think this makes it more explicit what works only locally vs everywhere.
2022-01-22 15:52:14 -07:00
Nathan Sobo fdf5ae0a04 💄 2022-01-22 15:30:38 -07:00
Nathan Sobo bede74dfac Introduce LocalSnapshot
This allows us to remove the absolute path and scan-related state from the Snapshot. None of this data is relevant or valid on guests.
2022-01-22 15:19:14 -07:00
Nathan Sobo 0fb72d41e0 Remove Worktree::abs_path
I'd like to only have methods related to absolute paths on local worktrees, because it's not really possible to implement them on remote worktrees since we don't know the full path being shared and wouldn't have anything to do with it anyway if we did.
2022-01-22 14:44:58 -07:00
Nathan Sobo 84ae1c30d2 Remove worktree_path from File struct 2022-01-22 14:29:36 -07:00
Nathan Sobo 1a104583a1 Merge pull request #359 from zed-industries/defer
Fix panic in ProjectDiagnosticsEditor::open_excerpts by introducing new defer feature to GPUI
2022-01-22 13:44:29 -07:00
Nathan Sobo 59bbb08068 Defer pane interaction when opening excerpts in diagnostics view
Activating a new item causes the current item to be deactivated. We're the current item, but we're on the stack, so we panic if we try to do this synchronously. If we use defer to wait until we're off the stack it works.
2022-01-22 13:23:08 -07:00
Nathan Sobo 00985420cb Add ViewHandle::defer
It's like update, but happens after the current effect instead of synchronously. Also, it doesn't allow the callback to return a value because there would be nothing to do with it.
2022-01-22 13:21:59 -07:00
Nathan Sobo ae9fae29f1 Add a ViewContext::defer
This takes a closure that will be enqueued as an effect to ensure there are no entities on the stack.
2022-01-22 13:14:25 -07:00
Nathan Sobo 54b913ae1a Merge pull request #358 from zed-industries/move-buffers-to-project
Move buffers to project
2022-01-22 12:52:26 -07:00
Nathan Sobo 75cbf5a4c3 Assign diagnostics on buffer even if it doesn't have a language
This shouldn't be necessary in practice but makes testing easier.
2022-01-22 09:54:25 -07:00
Nathan Sobo 4f5c74ae73 Update new buffers with existing diagnostics in Project – after assigning language 2022-01-22 08:46:37 -07:00
Antonio Scandurra 59162ef9fb Simplify opening buffers in the Project and assign language synchronously 2022-01-22 11:34:44 +01:00
Antonio Scandurra 41100c4439 Make add_local_worktree private and use find_or_create_local_worktree
The former always adds a worktree, even if we have one already in the
project and that could be misused. The public API should always search
for a local worktree containing the requested path first so that the
project can uphold invariants about which worktrees it has.
2022-01-22 11:23:00 +01:00
Max BrunsfeldandNathan Sobo 9d088c0b76 Get diagnostics crate's tests passing
Update diagnostics on project instead of on worktree

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-21 18:02:10 -08:00
Max BrunsfeldandNathan Sobo 5528a3043f Get integration tests passing
* Fix misuse of guest buffer's id as its remote id

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-21 17:44:24 -08:00
Max BrunsfeldandNathan Sobo ab44402642 Flush effects after every spawned future completes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-21 17:43:24 -08:00
Max Brunsfeld f0e920274e Remove worktree_id from buffer-related RPC messages 2022-01-21 16:23:39 -08:00
Max Brunsfeld a40c2d866c Move main worktree structs adjacent to each other 2022-01-21 16:10:26 -08:00
Max BrunsfeldandNathan Sobo 8d9db1f304 Move buffers from worktree to project
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-21 15:46:27 -08:00
Max Brunsfeld c34e77f670 Remove UserStore from Worktree 2022-01-21 12:37:44 -08:00
Max Brunsfeld d019b10349 Change integration tests to open buffers via the project 2022-01-21 12:23:17 -08:00
Nathan SoboandMax Brunsfeld 2758bd9d36 v0.13.0
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-01-21 11:26:32 -07:00
Nathan Sobo 2c3d6755fa Merge pull request #354 from zed-industries/go-to-definition
Go to definition
2022-01-21 11:24:19 -07:00
Nathan SoboandMax Brunsfeld be95502ba3 Remove panic when guest attempts to go to definition
We'll implement this soon but want to merge something stable to main.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-01-21 11:24:05 -07:00
Nathan Sobo e9e76ee3ed Merge remote-tracking branch 'origin/main' into go-to-definition 2022-01-21 11:12:38 -07:00
Nathan Sobo 5e45a8f1aa Revert "Replace project_path with project_entry in workspace::{Item, ItemView}"
This reverts commit c5fe187527.
2022-01-21 11:07:10 -07:00
Nathan SoboandAntonio Scandurra b053a7103b Remove source_range from definition
We don't use it now, and plan on dealing with it in a dedicated way when we need mouse hover interactions.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-01-21 07:31:02 -07:00
Antonio ScandurraandNathan Sobo 4b656d7d91 Add unit test for Project::definition
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-21 15:05:25 +01:00
Antonio ScandurraandNathan Sobo 1548886a29 Hide weak worktrees in the file finder
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-21 14:39:35 +01:00
Antonio ScandurraandNathan Sobo e2badda58f Remove weak handles when worktree gets dropped
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-21 14:34:14 +01:00
Antonio ScandurraandNathan Sobo 620b6bd990 Allow observing the release of entities
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-21 14:34:14 +01:00
Antonio Scandurra ba96ca0b1b Remove weak worktrees from project when nobody references them
Also, avoid showing them in the project panel as well as in the
contacts panel.
2022-01-21 14:34:14 +01:00
Antonio Scandurra 6042bf0744 Unregister worktree when its last handle to it gets released 2022-01-21 14:34:14 +01:00
Nathan Sobo a58caa2eb9 Disable the nav history when selecting a definition in a different buffer
When jumping between different buffers, we don't care about the cursor's previous location. When navigating backward, we want to jump directly to the site of the jump.
2022-01-20 21:33:16 -07:00
Nathan Sobo 5963952347 Merge pull request #355 from zed-industries/activate-existing-windows
Move window to the foreground when opening a path in an existing workspace
2022-01-20 21:14:56 -07:00
Nathan Sobo 8daf3ad771 When opening a path in an existing window, move it to the foreground 2022-01-20 20:45:30 -07:00