Commit Graph
753 Commits
Author SHA1 Message Date
Max Brunsfeld 0a4662923b Make Project::save_buffer and ::save_buffers into methods 2023-02-20 09:42:44 -08:00
Max Brunsfeld 62b7fc6d0f Only send UpdateBufferFile messages for buffers whose files have changed
Send that message when saving a buffer as a new path.
2023-02-20 09:41:59 -08:00
Max Brunsfeld 2b92a8f06d Unify save and save_as for local worktrees
This fixes state propagation bugs due to missing RPC calls in save_as.
2023-02-17 17:21:48 -08:00
Max Brunsfeld 05e8e2f835 Move the save and save_as code paths close together 2023-02-17 17:21:48 -08:00
Max Brunsfeld 61d5482bd5 Start work on making save and save_as code paths more similar 2023-02-17 15:52:13 -08:00
Max Brunsfeld 022f40820d Refactor: split Project::format logic into local and remote cases 2023-02-17 15:29:54 -08:00
Max BrunsfeldandNathan Sobo 3e76e0fb65 Fix assignment of language to formerly-untitled buffers
When lazy-loading a language, check if it matches plain text buffers.

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2023-02-17 11:12:57 -08:00
Antonio Scandurra d185ae90a3 Simulate disk-based diagnostics finishing 1s after saving buffer
Previously, we would simulate disk-based diagnostics finishing after
saving a buffer. However, the language server may produce diagnostics
right after emitting the event, causing the diagnostics status bar item
to not reflect the latest state of the buffer.

With this change, we will instead simulate disk-based diagnostics finishing
after 1s after saving the buffer (only for language servers that
don't have the concept of disk-based diagnostics, such as TypeScript). This
ensures we always reflect the latest state and doesn't cause the UI to flicker
as a result of the LSP sending us diagnostics after every input.
2023-02-16 16:04:08 +01:00
Mikayla Maki edb2d2cd3f Removed old experiments settings and staff mode flag, added new StaffMode global that is set based on the webserver's staff bit 2023-01-27 15:43:12 -08:00
Max Brunsfeld 278116bc25 Load languages lazily in the background 2023-01-25 17:47:46 -08:00
Max Brunsfeld a27e6ff9da Assign the language registry to all buffers in the project 2023-01-25 10:44:15 -08:00
Antonio Scandurra 1027bdf977 Merge branch 'main' into markdown-fenced-blocks 2023-01-24 15:43:35 +01:00
Antonio Scandurra ae95a0188e Reparse unknown injection ranges in buffer when adding a new language 2023-01-24 15:29:59 +01:00
Mikayla Maki fc7532d74d Added complete scripts for generating third party license files 2023-01-23 12:47:12 -08:00
Antonio Scandurra 89ccd53f33 Merge branch 'main' into optimize-large-multi-buffers 2023-01-19 16:18:21 +01:00
Antonio Scandurra 06e86cbc3f Fix compile errors 2023-01-18 13:58:01 +01:00
Antonio ScandurraandPetros Amoiridis 28e547e774 WIP: Avoid converting RopeFingerprint into a string
Co-Authored-By: Petros Amoiridis <petros@zed.dev>
2023-01-18 12:22:08 +01:00
Max Brunsfeld cd50f04dee Make workspace items expose their underlying models, remove file-related methods 2023-01-17 17:21:06 -08:00
Antonio Scandurra e2ecfdc72d Relay saved version metadata to ensure buffers modified state converges 2023-01-17 16:32:54 +01:00
Max BrunsfeldandAntonio Scandurra e8d1bbada5 Fix crash when restarting a language server after it reports an unknown buffer version
Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2023-01-10 16:27:15 -08:00
Antonio Scandurra c3f98b4bbc Update git diff base when synchronizing a guest's buffers 2023-01-08 09:10:57 -07:00
Antonio ScandurraandNathan Sobo 1ac1bd1838 Share new worktrees when resharing project
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-01-06 12:58:19 -07:00
Antonio ScandurraandNathan Sobo d436aae4ae Match guest's reported buffers on host when synchronizing after reconnect
If the host thinks a guest has a buffer that they don't have, the host won't
send it to them when they attempt to open it the next time. This can happen
if the guest disconnected before they received the host's response to an
initial open buffer request.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-01-06 11:48:34 -07:00
Antonio Scandurra 41e381c23b Only share worktrees when UpdateProject succeeded 2023-01-06 10:41:11 -07:00
Antonio Scandurra 2aedbfec7a Couple worktree sharing with project metadata updates 2023-01-06 10:31:36 -07:00
Antonio Scandurra e2c0fa6254 Ensure initial project metadata is sent when first sharing a project 2023-01-06 10:18:26 -07:00
Nathan Sobo c2ae4edc20 Avoid holding project handle on a call that could hang
This fixes a leaked handle error.
2023-01-05 21:01:27 -07:00
Nathan Sobo 09064d29df Wait for incomplete buffers when handling incoming buffer file updates 2023-01-05 13:50:25 -07:00
c28230fd21 Re-request incomplete remote buffers when syncing buffers
Any buffers we requested but that haven't been fully sent will cause
outstainding open requests to hang. If we re-request them, any
waiting open requests will resume when the requested buffers finish
being created.

Co-authored-by: Max Brunsfeld <max@zed.dev>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2023-01-04 16:00:43 -07:00
Nathan Sobo e3b9adc8f6 Update buffer files when synchronizing buffers
It's possible that the host was disconnected when attempting to notify
guests of a file save, so we need to transmit this in order to correctly
update the file's mtime.

Next failing seed OPERATIONS=200 SEED=6894
2023-01-04 12:33:48 -07:00
Nathan Sobo 01d051d43d Introduce completed_scan_id to worktree
We need to know the most recent scan id we have actually completed. This is to
handle the case where a guest disconnects when we're in the middle of streaming
worktree entries to them. When they reconnect, they need to report a scan_id
from before we started streaming the entries, because we have no record of when
the stream was interrupted.

Next failure:
SEED=5051 ITERATIONS=1 OPERATIONS=200 cargo test --release --package=collab random -- --nocapture
2023-01-03 18:26:57 -07:00
Nathan Sobo e527caa26d WIP 2023-01-03 13:30:14 -07:00
Nathan Sobo fe90759634 Track open buffers when handling sync requests
When a host sends a buffer to a guest for the first time, they record that
they have done so in a set tied to that guest's peer id. When the guest
reconnects and syncs buffers, they do so under a different peer id, so we
need to be sure we track which buffers we have sent them to avoid sending
them the same buffer twice, which violates the guest's assumptions.
2023-01-02 20:27:59 -07:00
Nathan Sobo b512c661c9 Remove printlns, found a failure
Failing seed:
SEED=416 MAX_PEERS=2 ITERATIONS=5000 OPERATIONS=159 cargo +beta test --package=collab random -- --nocapture
2022-12-27 17:01:31 -07:00
Antonio Scandurra 649e7d2eab WIP: failing randomized test
SEED=175 MAX_PEERS=2 ITERATIONS=1 OPERATIONS=159 cargo test --package=collab random -- --nocapture
2022-12-23 15:02:06 +01:00
Antonio Scandurra 5f13eeb06e Avoid hanging waiting for operations when buffer has none 2022-12-23 12:26:48 +01:00
Max BrunsfeldandAntonio Scandurra a0c1217bbc Handle file and diff updates to incomplete buffers
Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2022-12-21 15:39:57 -08:00
Max BrunsfeldandNathan Sobo c07f90cb54 Assert that buffers' file state matches in randomized collab test
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-12-21 15:38:44 -08:00
Antonio Scandurra 55c5989abc Synchronize buffers when either the host or a guest reconnects 2022-12-21 14:20:56 +01:00
Antonio Scandurra 91d2b79aff Remove unused JoinProjectError 2022-12-21 13:10:07 +01:00
Antonio Scandurra 224e642828 Verify removing worktrees while host is offline 2022-12-21 11:47:01 +01:00
Antonio Scandurra bd34a3b262 Handle proto::UpdateProjectCollaborator message in Project 2022-12-21 11:09:27 +01:00
Max Brunsfeld 0f88f651df 💄 Reorder private Project method 2022-12-20 17:32:42 -08:00
Max BrunsfeldandJulia Risley 2dd709e002 Implement rejoining projects as guest when rejoining a room
Co-authored-by: Julia Risley <julia@zed.dev>
2022-12-20 15:02:26 -08:00
Max BrunsfeldandAntonio Scandurra 3470889fb2 Handle unshared projects when rejoining a room
Also, construct remote projects via the room, to guarantee
that the room can manage the projects' sharing lifecycle.

Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2022-12-20 11:10:46 -08:00
Antonio Scandurra fcf2102f6e Remove unused import 2022-12-20 17:47:22 +01:00
Antonio Scandurra e2c8a2cb63 Support adding worktrees to project while host is offline 2022-12-20 17:42:08 +01:00
Antonio Scandurra 458b07bc3a Make host reconnection test pass when mutating worktree while offline 2022-12-20 17:30:58 +01:00
Antonio Scandurra 97e3f2da09 Fix project reconnection test to ensure rooms actually reconnects 2022-12-20 14:51:46 +01:00
Max BrunsfeldandNathan Sobo c9fa0ff03f Start work on rejoining rooms, supplying all project info at once
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-12-19 17:50:43 -08:00