Commit Graph

964 Commits

Author SHA1 Message Date
Mikayla Maki
6ef0f70528
Made the map seek target a publicly implementable interface
Integrated remove_range with the existing git code

co-authored-by: Nathan <nathan@zed.dev>
2023-05-12 08:37:32 -07:00
Nathan Sobo
ee3637216e
Add TreeMap::remove_between that can take abstract start and end points
This commit introduces a new adaptor trait for SeekTarget that works around
frustrating issues with lifetimes. It wraps the arguments in a newtype wrapper
that lives on the stack to avoid the lifetime getting extended to the caller
of the method.

This allows us to introduce a PathSuccessor object that can be passed as the
end argument of remove_between to remove a whole subtree.
2023-05-12 08:21:01 -07:00
Mikayla Maki
5fe8b73f04
compile error 😅 2023-05-11 16:07:41 -07:00
Mikayla Maki
d538994c7f
Use more efficient sum tree traversals for removal and improve ergonomics with iter_from
co-authored-by: Nathan <nathan@zed.dev>
2023-05-11 16:06:25 -07:00
Mikayla Maki
72655fc41d
fmt 2023-05-11 13:25:57 -07:00
Mikayla Maki
6f87f9c51f
Don't scan for statuses in files that are ignored 2023-05-11 13:25:07 -07:00
Mikayla Maki
5b2ee63f80
Added status trickle up 2023-05-11 12:01:42 -07:00
Julia
0f34af50a8 Use path list generated during entry reload of a refresh request 2023-05-10 23:37:02 -04:00
Mikayla Maki
9800a149a6
Remove some external context from git status test 2023-05-10 17:59:33 -07:00
Max Brunsfeld
bc5b78198a Define terminal settings in terminal crate 2023-05-10 17:43:10 -07:00
Mikayla Maki
e20eaca595
Got basic replication working :) 2023-05-10 17:37:36 -07:00
Mikayla Maki
2b80dfa81d
Update protos 2023-05-10 17:37:36 -07:00
Mikayla Maki
00b345fdfe
Use sum tree traversal to remove paths 2023-05-10 17:37:36 -07:00
Mikayla Maki
23a19d85b8
Fix bug in status detection when removing a directory 2023-05-10 17:37:36 -07:00
Mikayla Maki
0082d68d4a
Revert "Convert git status calculation to use Entry IDs as the key instead of repo relative paths"
This reverts commit 728c6892c924ebeabb086e308ec4b5f56c4fd72a.
2023-05-10 17:37:36 -07:00
Mikayla Maki
f935047ff2
Convert git status calculation to use Entry IDs as the key instead of repo relative paths 2023-05-10 17:37:36 -07:00
Mikayla Maki
a58a33fc93
WIP: integrate status with collab 2023-05-10 17:37:36 -07:00
Mikayla Maki
18cec8d64f
Format 2023-05-10 17:37:36 -07:00
Mikayla Maki
e98507d8bf
Added git status to the project panel, added worktree test 2023-05-10 17:37:36 -07:00
Mikayla Maki
93f57430da
Track live entry status in repository 2023-05-10 17:37:36 -07:00
Mikayla Maki
bd98f78101
Fix compile error 2023-05-10 17:37:36 -07:00
Mikayla Maki
67491632cb
WIP: Track live entry status in repository
co-authored-by: petros <petros@zed.dev>
2023-05-10 17:37:36 -07:00
Mikayla Maki
7169f5c760
Add git status to the file system abstraction
co-authored-by: petros <petros@zed.dev>
2023-05-10 17:37:36 -07:00
Kirill Bulatov
dfdf7e4866 Test the search inclusions/exclusions 2023-05-10 11:11:31 +03:00
Kirill Bulatov
6fb8679184 Trim glob input 2023-05-10 11:11:31 +03:00
Kirill Bulatov
b5abac6af6 Draft search include/exclude logic 2023-05-10 11:11:31 +03:00
Kirill Bulatov
915154b047 Add initial include/exclude project search UI 2023-05-10 11:11:31 +03:00
Antonio Scandurra
2bc7be9a76 WIP 2023-05-09 17:14:33 +02:00
Antonio Scandurra
48ad3866b7 Randomly mutate worktree in addition to mutating the file-system
This ensures that we test the code path that refreshes entries.

Co-Authored-By: Julia Risley <julia@zed.dev>
2023-05-09 17:01:11 +02:00
Antonio Scandurra
7f27d72b20 Deliver file-system change events in batches in randomized worktree test
Co-Authored-By: Julia Risley <julia@zed.dev>
2023-05-09 16:55:03 +02:00
Julia
5c859da457 Only update changed local worktree buffers
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2023-05-09 15:13:12 +02:00
Mikayla Maki
62e763d0d3
Removed test modifications, added special case to git initialization for when the repository is inside a .git folder 2023-05-08 14:33:59 -07:00
Mikayla Maki
ab952f1b31
Fixed randomized test failures
co-authored-by: Max <max@zed.dev>
2023-05-08 14:33:59 -07:00
Mikayla Maki
d8dac07408
Removed scan ID from repository interfaces
co-authored-by: Max <max@zed.dev>
2023-05-08 14:33:59 -07:00
Mikayla Maki
270147d20c
Finished RepositoryEntry refactoring, smoke tests passing
co-authored-by: Max <max@zed.dev>
2023-05-08 14:33:59 -07:00
Mikayla Maki
53569ece03
WIP: Change RepositoryEntry representation to be keyed off of the work directory
Removes branches button scaffolding
2023-05-08 14:33:59 -07:00
Mikayla Maki
b6d6f5c650
WIP: re-arranging the RepositoryEntry representation
Added branches to the randomized test to check the git branch
Added the remaining database integrations in collab

Co-authored-by: Max <max@zed.dev>
Co-authored-by: Petros <petros@zed.dev>
2023-05-08 14:33:59 -07:00
Mikayla Maki
8301ee43d6
WIP: Add repository entries to collab and synchronize when rejoining the room
co-authored-by: Max <max@zed.dev>
2023-05-08 14:33:59 -07:00
Mikayla Maki
2fe5bf419b
Add proto fields for repository entry maintenance 2023-05-08 14:33:59 -07:00
Petros Amoiridis
e057b0193f
Introduce BrancesButton in title bar
Co-Authored-By: Mikayla Maki <mikayla.c.maki@gmail.com>
2023-05-08 14:33:58 -07:00
Mikayla Maki
8f0aa3c6d9
Add branch name into title 2023-05-08 14:33:58 -07:00
Petros Amoiridis
d34ec462f8
Display branch information per worktree root
Co-Authored-By: Mikayla Maki <mikayla.c.maki@gmail.com>
2023-05-08 14:33:58 -07:00
Mikayla Maki
ffd9d4eb59
Fix bug in repo detection 2023-05-08 14:33:58 -07:00
Mikayla Maki
3570810516
Add API for accessing git branch 2023-05-08 14:33:58 -07:00
Mikayla Maki
26afd592c5
Wire in the branch name 2023-05-08 14:33:58 -07:00
Mikayla Maki
5b4e58d1de
Fix repo_for and clean up repository_entries 2023-05-08 14:33:58 -07:00
Mikayla Maki
ae890212e3
Restored a lost API and got everything compiling 2023-05-08 14:33:58 -07:00
Mikayla Maki
bcf608e9e9
WIP: Refactor existing git code to use new representation.
co-authored-by: petros <petros@zed.dev>
2023-05-08 14:33:58 -07:00
Mikayla Maki
563f13925f
WIP: Convert old git repository vec to new treemap based approach.
co-authored-by: Nathan <nathan@zed.dev>
2023-05-08 14:33:58 -07:00
Mikayla Maki
a58d3d8128
Add a data driven representation of the current git repository state to the worktree snapshots
WIP: Switch git repositories to use SumTrees

Co-authored-by: Nathan <nathan@zed.dev>
2023-05-08 14:33:58 -07:00
Julia
eacea55aaf Fixup cases using buffer model handle id as buffer id 2023-05-04 12:32:31 -04:00
Julia
1883e260ce Offload text::Buffer construction to background worker
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2023-05-04 12:32:31 -04:00
Max Brunsfeld
c485fc86a2 Add copilot.disabled_globs setting 2023-05-01 13:45:47 -07:00
Max Brunsfeld
7258db7a4e
Merge pull request #2417 from zed-industries/hover-markdown
Render markdown more correctly in the editor hover popover
2023-04-27 14:15:04 -07:00
Julia
87539e7b82 Update test to not fail due to absence of diagnostic source 2023-04-27 15:04:48 -04:00
Julia
3f7533a0b4 Show source of diagnostic hovers 2023-04-27 14:35:34 -04:00
Max Brunsfeld
d298ce3fd3 Render more markdown features in hover popover 2023-04-26 15:33:10 -07:00
Antonio Scandurra
7ca412ade3 Merge remote-tracking branch 'origin/main' into fewer-context-traits 2023-04-26 09:54:58 +02:00
Max Brunsfeld
ebbe52e6b0 🎨 Specify more dependencies at the workspace level 2023-04-24 17:41:55 -07:00
Max Brunsfeld
7bd51851c2 🎨
Co-authored-by: Julia Risley <julia@zed.dev>
2023-04-24 13:54:47 -07:00
Max Brunsfeld
a8ddba55d8 Send language server updates via the same task that sends buffer operations
Co-authored-by: Julia Risley <julia@zed.dev>
2023-04-24 13:52:03 -07:00
Max Brunsfeld
a280a93cd8 Start work on a language server log view 2023-04-24 09:43:31 -07:00
Max Brunsfeld
abdccf7393 Use a workspace dependency for the futures crate 2023-04-24 09:43:31 -07:00
Antonio Scandurra
5f500d34b2 Remove UpgradeModelHandle trait
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-04-24 16:40:30 +02:00
Max Brunsfeld
4dd917c123 Introduce a LanguageServerId wrapper type
Clarify the meaning of all the usizes in use in all of these
struct fields an method signatures.
2023-04-20 08:58:41 -07:00
Julia
c5f86bc6af Avoid language servers fighting over diagnostics summaries
Previously each server would stomp all over the existing results

Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-04-20 08:58:41 -07:00
Julia
9e2949e7ba Refactor language server startup
Avoid parallel vecs

Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-04-20 08:58:41 -07:00
Julia
c59204c5e6 Cleanup
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-04-20 08:58:41 -07:00
Julia
df94aee758 Fix failing tests
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-04-20 08:58:41 -07:00
Julia
6156dbced0 Finish getting multiple diagnostics sources building and running 2023-04-20 08:58:41 -07:00
Julia
bb4de47b15 Start getting diagnostics sets to work with multiple servers
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-04-20 08:58:41 -07:00
Julia
2a5c0fa5f8 Get ESLint to launch and provide diagnostics
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2023-04-20 08:58:41 -07:00
Julia
6e68ff5a50 Get it to build with multiple adapters per language! 🎉
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-04-20 08:58:41 -07:00
Julia
ba7233f265 Incomplete refactor to allow for multiple adapters per language 2023-04-20 08:58:39 -07:00
Antonio Scandurra
672cf6b8c7 Relay buffer change events to Copilot 2023-04-20 09:34:20 +02:00
Max Brunsfeld
5934e882b8
Merge pull request #2379 from zed-industries/shebang
Select language based on a file's first content line in addition to its path
2023-04-18 17:31:19 -07:00
Max Brunsfeld
bd7d50f339 Fix 'invalid insertion' panic when following
Wait for the necessary buffer operations to arrive before attempting to
set selections and scroll top.
2023-04-18 16:13:18 -07:00
Antonio Scandurra
1f284408a9 Send buffer operations in batches to reduce latency
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-04-17 10:22:13 -07:00
Max Brunsfeld
1dcd4717b1 Select language based on a file's first content line in addition to its path 2023-04-16 12:28:27 -07:00
Max Brunsfeld
5ea49b3ae3 Fix inconsistent worktree state when renaming entries while scanning 2023-04-13 22:34:34 -07:00
Max Brunsfeld
bb1cfd51b8 Add randomized test for mutating worktree during initial scan 2023-04-13 22:34:03 -07:00
Max Brunsfeld
debb694d97 Always bump scan_id when refreshing an entry
The scan_id needs to be bumped even if a scan is already in progress,
so that worktree updates can detect that entries have changed. This
means that the worktree's completed_scan_id may increase by more than
one at the end of a scan.
2023-04-13 16:51:11 -07:00
Max Brunsfeld
5ca603dbeb Don't process gitignore updates after the initial scan 2023-04-12 18:17:29 -07:00
Max Brunsfeld
3d14bfd90c Prioritize path refresh requests over gitignore status updates 2023-04-12 18:08:00 -07:00
Max Brunsfeld
2d97387f49 Restructure background scanner to handle refresh requests even while scanning 2023-04-12 16:29:51 -07:00
Antonio Scandurra
6d8635fa29
Merge pull request #2349 from zed-industries/randomized-tests-operation-script
Restructure randomized integration test to allow editing and replaying a plan, fix discovered bugs
2023-04-12 11:45:47 +02:00
Antonio Scandurra
12a286ac50 Forget buffered operations when resyncing with the host
Previously, we could end up with a situation where the host did not
see an operation but a guest that didn't have that buffer open would. When
such guest would finally open the buffer, they would apply the operation
without however sending it to the host. The guest wouldn't bother resyncing
it because it wasn't part of its open buffers.
2023-04-12 10:39:01 +02:00
Antonio Scandurra
5eb1719ab8 Re-send worktree if reconnecting while initial scan isn't finished yet
Previously, if the client was disconnected while the initial worktree
state was being sent, it would not see the remaining state after reconnecting.
This was due to `scan_id` and `completed_scan_id` both being initialized to
`0`, so the client would ask for updates since `0` and get nothing.

This commit changes the worktree to initialize `scan_id` to `1` and
`completed_scan_id` to `0`, so that we get the full worktree again on reconnect.
2023-04-11 17:15:43 +02:00
Antonio Scandurra
5e37c893c2 Ensure project is still alive by the time remote LSP request starts 2023-04-11 15:14:32 +02:00
Antonio Scandurra
5898600239 Use LspCommand to handle code actions 2023-04-11 15:12:58 +02:00
Antonio Scandurra
651a83977e 🔥 2023-04-11 14:53:08 +02:00
Antonio Scandurra
ac532cb6fa Use LspCommand to handle completions 2023-04-11 14:52:07 +02:00
Antonio Scandurra
6ba5e06247 Stop waiting for buffers when releasing a remote project 2023-04-11 10:42:43 +02:00
Max Brunsfeld
25e3c4e586 Fix leak when project is unshared while LSP handler waits for edits 2023-04-10 17:03:58 -07:00
Max Brunsfeld
e79815622c Preserve ordering between UpdateProject and CreateBufferForPeer messages
Previously, because UpdateProject messages were sent in a separately-
spawned task, they could be sent after CreateBufferForPeer messages that
were intended to be sent after them.

Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2023-04-10 12:54:25 -07:00
Antonio Scandurra
016343e65d Merge branch 'main' into randomized-tests-operation-script 2023-04-10 08:45:22 +02:00
Antonio Scandurra
7f73ebdab5 Apply BufferReloaded message to incomplete remote buffers 2023-04-10 08:41:31 +02:00
Antonio Scandurra
372e31d54f Don't panic if worktree was dropped before sending path changes
In `refresh_entry`, we send a message to the `self.path_changes_tx` channel
to notify the background thread that a path has changed. However, given that
`refresh_entry` uses `spawn_weak`, the worktree could get dropped before sending
the message, which could cause a panic.

This commit changes the code to return an error instead of panicking.
2023-04-10 08:16:08 +02:00
Max Brunsfeld
acbf9b55d7 Halt UpdateBuffer messages until sync if one errors
Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2023-04-07 17:31:52 -07:00
Max Brunsfeld
e50c48852a Wait for host to acknowledge buffer updates before sending them to other guests 2023-04-07 16:27:48 -07:00