Antonio Scandurra
fd5218858d
Remove delegate support from GPUI
...
We added this because we thought it would save some allocations when
sending operations given that we could move them to the delegate upon
notifying it, but the reality is that we serialize operations and that
only requires a reference.
2022-03-09 10:48:52 +01:00
Antonio Scandurra
b1001b0759
Notify all language servers only when a buffer is saved
...
Other notifications such as opening, closing or changing a document
are still tied to the buffer's language.
2022-03-09 10:44:03 +01:00
Max Brunsfeld
bfc721db27
Assign buffer's completion triggers from LSP capabilities
...
Also, make LanguageServer::new() async. The future resolves
once the server is initialized.
2022-03-08 17:41:52 -08:00
111d5305ea
Remove language servers from buffers
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
Co-Authored-By: Antonio Scandurra <antonio@zed.dev >
Co-Authored-By: Keith Simmons <keith@zed.dev >
2022-03-08 15:16:07 -08:00
Antonio Scandurra
b130318ee7
Move DidSaveTextDocument notification from Buffer to Project
2022-03-08 11:35:54 +01:00
Antonio Scandurra
f752458c55
Remove unused CloseBuffer message
2022-03-08 11:17:20 +01:00
Antonio Scandurra
a26a8fca8a
Send buffer operations via the Project instead of Worktree
2022-03-08 11:11:25 +01:00
1cd9a3244a
Populate environment from shell
...
Co-Authored-By: Keith Simmons <keith@zed.dev >
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-07 16:39:50 -08:00
Max Brunsfeld and Nathan Sobo
8529a10317
Put vector clock serialization logic alongside other serialization logic
...
This way, the `clock` crate doesn't depend on the `rpc` crate.
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-04 13:54:07 -08:00
Nathan Sobo
07a018e001
Merge branch 'main' into disconnected-status
2022-03-04 10:07:26 -07:00
Antonio Scandurra and Nathan Sobo
3390e055b9
Render overlay after remote project becomes read-only
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-04 17:28:18 +01:00
Antonio Scandurra
c51e8eb267
Merge pull request #534 from zed-industries/create-buffers-via-project
...
Open untitled buffers via the `Project`
2022-03-04 16:18:02 +01:00
Antonio Scandurra
a8a5865e56
Open untitled buffers via the Project
...
This allows the registration of such buffers in the project, which is necessary
to correctly support `::save_buffer_as` and opens the door to sharing untitled
buffers with guests in the future.
Note that, for now, this disallows guests to create untitled buffers in the
current window and will create a new window instead. This is because we don't
yet have a global way of allocating a buffer's remote id (nor a way of saving
such buffers in the host's worktree) and we instead rely on the local model ID,
which could clash with the host's buffer IDs.
I think we should revisit this once guests can share their untitled buffers
with the host and other remote peers, as well as once we start keying
operations by entry id.
2022-03-04 15:25:39 +01:00
Antonio Scandurra
aa62426ee8
Support formatting in fake LSP capabilities
2022-03-04 11:24:18 +01:00
Antonio Scandurra
8692e322a3
Use LSP range formatting when document formatting is not available
2022-03-04 10:13:17 +01:00
Antonio Scandurra
3ad7272559
Merge pull request #525 from zed-industries/preserve-worktrees
...
Grow worktrees monotonically when sharing and move most messages to the background
2022-03-04 09:48:18 +01:00
Max Brunsfeld
ee589d9cf7
Avoid infinite loop when a language server fails to start
2022-03-03 18:13:38 -08:00
Max Brunsfeld
3a1a9ecb45
Disable doctests for all libraries
...
We don't use them, and they add a lot of noise to the test output
when running all tests in the workspace.
2022-03-03 16:15:56 -08:00
Max Brunsfeld
9543079660
Wait for LSP capabilities to be initialized before checking them
2022-03-03 15:59:03 -08:00
Max Brunsfeld and Nathan Sobo
c52c48c72e
Avoid sending unhandled LSP requests to JSON language server
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-03 13:39:40 -08:00
Antonio Scandurra
f25602bcab
Maintain remote worktrees correctly when building updates
...
This accidentally regressed in 660aa24 .
2022-03-03 16:13:17 +01:00
Antonio Scandurra
94f4cc2b65
Ignore diagnostics received for invisible worktrees
2022-03-03 13:58:55 +01:00
Antonio Scandurra
e18e172cda
Move several buffer-related messages to the background
2022-03-03 12:18:19 +01:00
Antonio Scandurra
b9a3204b18
Ensure no two worktrees can point to the same root path
...
This could happen because there was a pause between creating the worktree
and adding it to the list of tracked local worktrees, and so we might end
up adding the same worktree twice when calling `create_local_worktree` in
rapid succession.
2022-03-03 10:54:52 +01:00
Antonio Scandurra
9ba036275a
Change the definition of check_invariants
...
- On the host, ensure that only one worktree can exist for a given absolute
path. Asserting about buffers was cool but I think should be tackled in the
context of leaning more on entry ids for collaboration (vs. buffer ids).
- On the guest, ensure that all the opened buffers don't contain deferred
operations.
2022-03-03 10:51:37 +01:00
Antonio Scandurra
660aa24cc4
Ensure worktree is registered/shared synchronously
2022-03-03 10:10:53 +01:00
Max Brunsfeld
a6098a93ce
Check projects' buffers have unique absolute paths in random collab test
2022-03-02 14:38:16 -08:00
Max Brunsfeld
0361877185
Rename strong_worktrees -> visible_worktrees
2022-03-02 14:38:16 -08:00
Antonio Scandurra and Max Brunsfeld
819bf72dfc
Rename weak to visible
...
Co-Authored-By: Max Brunsfeld <max@zed.dev >
2022-03-02 14:38:16 -08:00
Antonio Scandurra and Max Brunsfeld
cc0f11fb08
Convert weak worktree handles into strong handles when sharing
...
Co-Authored-By: Max Brunsfeld <max@zed.dev >
2022-03-02 14:38:16 -08:00
0171bd43fa
Use simulate_random_delay when polling snapshot only in tests
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
Co-Authored-By: Max Brunsfeld <max@zed.dev >
2022-03-01 19:17:38 +01:00
Antonio Scandurra and Nathan Sobo
657b559d01
Revert "Use async_broadcast to emit fake FS events"
...
This reverts commit 9c733bb29b , because
having a bounded broadcast introduces the possibility of waiting forever
when there isn't yet a receiver processing those events.
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-01 17:14:40 +01:00
Antonio Scandurra and Nathan Sobo
a7db99230e
Use a weak handle to poll local worktree snapshot
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-01 17:08:10 +01:00
Antonio Scandurra and Nathan Sobo
9c733bb29b
Use async_broadcast to emit fake FS events
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-01 15:48:15 +01:00
Antonio Scandurra
511fdc869f
Don't block when emitting fs events
...
Blocking could happen while processing events, which would cause the
background scanner to never make any further progress.
2022-03-01 13:08:50 +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
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 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
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
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
Nathan Sobo
e8eeccda88
Remove carriage returns
2022-02-27 07:47:46 -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
Antonio Scandurra
332cd1039c
Allow splitting project find and maintain the searches in sync
2022-02-25 16:20:02 +01:00
Antonio Scandurra
573965cfdf
Don't report a buffer when it doesn't contain any matches
2022-02-25 15:40:19 +01:00
Antonio Scandurra
34b4858a06
Open searched buffers in parallel
2022-02-25 12:29:50 +01:00
Antonio Scandurra
687f680ad9
Avoid extra smol::channel when iterating through snapshot paths
2022-02-25 11:49:33 +01:00
Antonio Scandurra
7a38350567
Add a fast path for when the search query is empty
2022-02-25 10:58:45 +01:00
Antonio Scandurra
f2d7451ca2
Use Project::search in ProjectFind and show search results
2022-02-25 10:32:45 +01:00