Commit Graph

1651 Commits

Author SHA1 Message Date
Julia
a8acf28989 Remove now-unnecessary complexity 2023-06-22 20:19:07 -04:00
Max Brunsfeld
ffb0a215ea Fix randomized worktree test failures
* Distinguish between unloaded and pending directories via separate entry kind.
* Scan directories before updating ignore statuses after fs events.
2023-06-22 16:52:04 -07:00
Max Brunsfeld
5350164db9 Get integration test passing. Wait for expand entry on remote projects. 2023-06-22 10:34:28 -07:00
Max Brunsfeld
400e3cda32 Scan directories when they stop being ignored 2023-06-22 10:34:28 -07:00
Max Brunsfeld
bfc90f4502 Add failing test for changing a gitignore so a pending dir is no longer ignored 2023-06-22 10:34:28 -07:00
Max Brunsfeld
d3477f75ac Fix reloading of git repositories
Also, clean up logic for reloading git repositories.
2023-06-22 10:34:28 -07:00
Max Brunsfeld
4424dafcd7 Fix expansion of ancestor directories when refreshing a path 2023-06-22 10:34:28 -07:00
Max Brunsfeld
3e6aedfc69 Expand dirs on-demand when opening buffers inside unloaded dirs 2023-06-22 10:34:28 -07:00
Max Brunsfeld
cd823ede4d Add a bit to each entry indicating if it's outside of the worktree root 2023-06-22 10:34:28 -07:00
Max Brunsfeld
1b71589514 Fix confusion between canonical vs non-canonical paths when rescanning, expanding paths 2023-06-22 10:34:28 -07:00
Max Brunsfeld
3c06bd056a Load git repositories when inserting the entry for the .git
Don't wait until populating that directory entry, for two reasons:
* In the case of submodules, .git is not a directory
* We don't eagerly populate .git directories, since their contents
  are automatically ignored.
2023-06-22 10:34:28 -07:00
Max Brunsfeld
6fe74602ac Fix detection of when refreshed paths are outside of worktree root 2023-06-22 10:34:28 -07:00
Max Brunsfeld
205c758e4e Wait for ignored directory to be expanded in descendant entries test 2023-06-22 10:34:28 -07:00
Max Brunsfeld
aa6f2f1816 Remove logic for marking worktree entries as collapsed 2023-06-22 10:34:28 -07:00
Max Brunsfeld
f910d8fe3e Only scan ignored or externals paths if expanded in a project panel 2023-06-22 10:34:28 -07:00
Max Brunsfeld
4c03231863 Maintain on the background scanner a set of expanded directories 2023-06-22 10:34:28 -07:00
Julia
0abda54d3c Remove individual location's request error handling 2023-06-22 11:43:26 -04:00
Julia
e1cd6cebb9 Revert "Route language server requests through wrapper object"
This reverts commit 9b63d6f832.
2023-06-22 10:45:08 -04:00
Julia
9b63d6f832 Route language server requests through wrapper object 2023-06-21 23:05:37 -04:00
Julia
e15be61ded The log-ification 2023-06-21 14:02:21 -04:00
Julia
f91e95f24a Merge branch 'main' into fix-broken-lsp-installations 2023-06-20 17:23:34 -04:00
Nathan Sobo
03993ea719
Rename SumTree::push_tree to ::append (#2626)
This is something I've been meaning to rename in SumTree. Was looking at
the code and figure why not now.
2023-06-20 08:37:55 -06:00
Nathan Sobo
8c298a9da5 Rename SumTree::push_tree to ::append 2023-06-19 19:49:33 -06:00
Max Brunsfeld
57c2d85c66 Show a notification that gopls can't be installed without go 2023-06-19 18:05:12 -07:00
Max Brunsfeld
360bbebbd9 Introduce LspAdapterDelegate trait, passed to LspDelegates 2023-06-19 16:12:25 -07:00
Julia
7e70e24bfc Remove server from both hashmaps 2023-06-19 18:02:57 -04:00
Julia
afa1434aa9 Get further reinstalling a server which died on startup 2023-06-19 17:45:27 -04:00
Julia
da2ee55013 Route some more information for reinstall after startup failure
Doesn't actually reinstall on that particular failure due to wrong
variant in hashmap
2023-06-19 15:18:12 -04:00
Julia
abe5ecc5ec Actually fully start reinstalled language server 2023-06-15 13:56:07 -04:00
Julia
f81ccbd652 Setup C adapter with test binary 2023-06-15 12:18:34 -04:00
Julia
4d24eae901 Actually check and reinstall broken server 2023-06-15 12:18:34 -04:00
Julia
bca625a197 Many steps toward validating and reinstalling server after failure 2023-06-15 12:18:34 -04:00
Julia
ec0409a3d1 Detect LSP startup failure 2023-06-15 12:18:34 -04:00
Max Brunsfeld
5b6d1a27ff Flatten worktree tests module structure 2023-06-13 10:31:29 -07:00
Max Brunsfeld
c17dbab6f1 Move worktree tests to their own file 2023-06-13 10:22:14 -07:00
Max Brunsfeld
11dbbcc9dd Respect LSP goToTypeDefinition server capability 2023-06-08 11:33:09 -07:00
Max Brunsfeld
afaff7f9a9 Merge branch 'main' into lsp-log-messages 2023-06-08 08:49:08 -07:00
Mikayla Maki
fc1f8c5657
Fixed ci 2023-06-07 16:58:55 -07:00
Mikayla Maki
8ca1a7d43d
add scan_complete await 2023-06-07 16:51:54 -07:00
Max Brunsfeld
66f215cd13 Restructure LSP log view to show log messages in addition to RPC trace 2023-06-07 16:51:09 -07:00
Mikayla Maki
9e9d8e3a7b
add mroe dbg 2023-06-07 16:50:15 -07:00
Mikayla Maki
9d58c4526d
Fix warning 2023-06-07 16:45:36 -07:00
Mikayla Maki
5f143f689f
Attempting to debug on ci... 2023-06-07 16:44:13 -07:00
Mikayla Maki
572d40381a
Add track caller 2023-06-07 16:39:10 -07:00
Mikayla Maki
2c5e83bf72
Fixed a bug where buffer saved clocks would desynchronize in rare execution paths
co-authored-by: Max <max@zed.dev>
2023-06-07 16:10:45 -07:00
Max Brunsfeld
78f9642ac2 Emit project event when a language server sends a logMessage notification 2023-06-07 14:46:08 -07:00
Mikayla Maki
28ba27c9c5
Merge branch 'main' into stream-git-statuses 2023-06-07 14:12:58 -07:00
Mikayla Maki
34e134fafb
Fix several randomized test failures with the new git status implementation 2023-06-07 14:10:17 -07:00
Max Brunsfeld
72372ddf0e Highlight hover code blocks as LSP's own language by default
The elixir LSP does not include a language name on its elixir code blocks.
2023-06-07 10:01:19 -07:00
Max Brunsfeld
fccbac4887 Handle LSP codeActions capability set to false 2023-06-06 17:13:59 -07:00
Max Brunsfeld
7bfb51ee76 Live-reload tree-sitter queries in development 2023-06-06 14:20:21 -07:00
Mikayla Maki
a2d58068a7
Improve test generation and implement status propogation
co-authored-by: max <max@zed.dev>
2023-06-05 17:30:12 -07:00
Mikayla Maki
9a13a2ba2c
WIP: Add status bubbling to project panel 2023-06-05 12:53:04 -07:00
Mikayla Maki
e56fcd69b5
Track git status changes with the changed_paths system 2023-06-05 11:50:23 -07:00
Joseph Lyons
7c60f636d5 Fix typos 2023-06-02 22:02:19 -04:00
Mikayla Maki
ca077408d7
Fix bug where git statuses would not be initialized on startup
move git status queries to be on entry creation

co-authored-by: max <max@zed.dev>
2023-06-02 17:38:39 -07:00
Mikayla Maki
2f97c7a4f1
Remove stale comments
Implement status bubbling query with sum tree traversals

co-authored-by: max <max@zed.dev>
2023-06-02 16:41:01 -07:00
Mikayla Maki
e377459948
Remove stateful bubbling
co-authored-by: max <max@zed.dev>
2023-06-02 15:07:49 -07:00
Mikayla Maki
99a0e11e70
Abandoning stateful bubbling approach
co-authored-by: max <max@zed.dev>
2023-06-02 14:51:40 -07:00
Mikayla Maki
3768851799
WIP: Git statuses 2023-06-01 23:27:49 -07:00
Mikayla Maki
5e43dcaab8
WIP: Add stateful status bubbling to worktree 2023-06-01 16:51:34 -07:00
Max Brunsfeld
788f97ec68
Add support for folder-specific settings (#2537)
This PR allows you to customize Zed's settings within a particular
folder by creating a `.zed/settings.json` file within that folder.

Todo

* [x] respect folder-specific settings for local projects
* [x] respect folder-specific settings in remote projects
* [x] pass a path when retrieving editor/language settings
* [x] pass a path when retrieving copilot settings
* [ ] update the `Setting` trait to make it clear which types of
settings are locally overridable

Release Notes:

* Added support for folder-specific settings. You can customize Zed's
settings within a particular folder by creating a `.zed` directory and a
`.zed/settings.json` file within that folder.
2023-05-31 16:27:08 -07:00
Max Brunsfeld
0dd7694ff5 Make language_settings take a language, not a language name 2023-05-31 15:10:30 -07:00
Max Brunsfeld
03a351fb26 Make language settings accessors take an arc dyn file 2023-05-31 14:57:04 -07:00
Max Brunsfeld
a2ab7c9eb9 Respect project-specific settings for copilot 2023-05-31 14:42:15 -07:00
Mikayla Maki
4717ce1da3
WIP: Move statuses to entries
co-authored-by: julia <julia@zed.dev>
2023-05-31 12:55:31 -07:00
Mikayla Maki
22e4086658
WIP: Move statuses to be on their associated file entries in worktree
co-authored-by: Julia <julia@zed.dev>
2023-05-31 11:03:11 -07:00
Max Brunsfeld
8f95435548 Replicate project-specific settings when collaborating 2023-05-30 18:08:03 -07:00
Max Brunsfeld
89446c7fd4 Start work on respecting project-specific settings 2023-05-29 14:25:49 -07:00
Antonio Scandurra
6d3464fd1f Make Pane::add_item a proper Pane method
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-05-29 19:16:22 +02:00
Kirill Bulatov
fdad1adaf6 Update LSP to the newest version 2023-05-28 21:55:08 +03:00
Max Brunsfeld
e4530471de
Make worktree UpdatedEntries events fully describe all changes (#2533)
This PR makes the worktree's change events more useful in a few ways:

* The changes are now described by a cheaply clone-able collection, so
that they can be used in background tasks. Right now, I'm using a simple
Arc slice.
* The `UpdatedEntries` event now captures not only changes due to FS
changes, but also newly-loaded paths that are discovered during the
initial scan.
* The `UpdatedGitRepositories` event now includes repositories whose
work-dir changed but git dir didn't change. A boolean flag is included,
to indicate whether the git content changed.
* The `UpdatedEntries` and `UpdatedGitRepositories` events are now
*used* to compute the worktree's `UpdateWorktree` messages, used to sync
changes to guests. This unifies two closely-related code paths, and
makes the host more efficient when collaborating, because the
`UpdateWorktree` message computation used to require walking the entire
`entries` tree on every FS change.
2023-05-26 15:55:14 -07:00
Max Brunsfeld
1f42bfc1bd Include repositories with workdir changes in worktree UpdatedGitRepsositories event 2023-05-26 15:47:37 -07:00
Max Brunsfeld
2db57b5139 Adjust diagnostic transformation test to not wait for two buffer notifications 2023-05-26 15:47:37 -07:00
Max Brunsfeld
02b95ef320 Derive worktree update messages from existing change events 2023-05-26 15:47:37 -07:00
Kirill Bulatov
3a3c1c5a5b Add a test
co-authored-by: Mikayla <mikayla@zed.dev>
2023-05-27 01:12:22 +03:00
Max Brunsfeld
6628c4df28 Store worktree changes in a sorted arc slice, not a HashMap
We don't need to look-up change types by an arbitrary key, but we
do need to iterate it. It would also be useful to be able to
cheaply clone the changes, to use them in a background task.
2023-05-26 09:24:15 -07:00
Max Brunsfeld
59bfd40679 Make stricter assertions about change events in random worktree test 2023-05-26 09:24:15 -07:00
Max Brunsfeld
f890eefdef Include paths loaded during initial scan in worktree UpdatedEntries event 2023-05-26 09:24:15 -07:00
Julia
5e39ba596e Clean up final remaining code paths calling old diff update method 2023-05-25 14:41:09 -04:00
Julia
f40c498491 Fix tests 2023-05-25 14:29:28 -04:00
Julia
8d662edb6c Remove concept of git diff refresh from Item trait 2023-05-25 14:29:28 -04:00
Julia
cede296b04 Project level git diff recalc handling
This avoids an issue where in a many-buffer multi-buffer, each modified
buffer could complete its recalc independently, causing a cascade of
repeated notifies

Now all recalcs started at the same time must complete before
 A: Starting another recalc pass
 B: The master notify occurring

Each buffer can still show its new diff if something else triggers it
to notify earlier, this is desirable and does not have the same negative
effects as the notify cascade as those re-layouts would need to happen
anyway

Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-05-25 14:10:27 -04:00
Max Brunsfeld
54421b11f3 wip 2023-05-25 14:10:27 -04:00
Kirill Bulatov
e2ff829f98 Use Transaction instead of ProjectTransaction
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-05-25 16:12:14 +03:00
Kirill Bulatov
aa58d0fd77 Do not send edits over the wire 2023-05-25 12:55:44 +03:00
Kirill Bulatov
eca6d2b597 Process remote format typing also 2023-05-25 09:45:50 +03:00
Kirill Bulatov
58a56bdda2 Always use server formatting settings 2023-05-25 09:45:50 +03:00
Kirill Bulatov
b9dabb165e Use formatting options 2023-05-25 09:45:50 +03:00
Kirill Bulatov
3327e8a6dd Support remote sessions 2023-05-25 09:45:50 +03:00
Kirill Bulatov
f6d7b3d2e8 Send and handle OnTypeFormatting LSP request 2023-05-25 09:45:50 +03:00
Mikayla Maki
51d94f532b
Load diff base for buffers that are opening but not yet opened when repositories are discovered 2023-05-22 18:26:33 -07:00
Mikayla Maki
4c9d24da7c
Only fire update diff base when the dot repo is scanned (#2510)
This PR fixes a bug in the firing of the UpdatedRepositories event which
caused it to flood collaboration with new messages on every file save.

Release Notes:

* Fixed a bug in repository detection that caused it to fire
over-eagerly (preview only)
2023-05-22 14:11:19 -07:00
Mikayla Maki
96224fa7e8
Only fire update diff base when the dot repo is scanned 2023-05-22 13:57:07 -07:00
Max Brunsfeld
7689cdf3f9 Clear old diagnostics when restarting a language server 2023-05-22 12:53:22 -07:00
Max Brunsfeld
e129ed2d91
Fix spurious setting error log messages (#2498)
Fixes a bug introduced in
https://github.com/zed-industries/zed/pull/2448, where error messages
would be logged if the user config didn't specify certain fields like
`journal` or `telemetry`.
2023-05-22 11:44:21 -07:00
Mikayla Maki
bbb68c523c
Refactored apart the forward and the backwards iterator for diff hunks 2023-05-19 18:09:47 -07:00
Max Brunsfeld
e32233c826 Fix spurious setting error logs on non-existent setting keys 2023-05-19 17:15:05 -07:00
Mikayla Maki
43e301eeef
refine batched anchor conversions
co-authored-by: max <max@zed.dev>
2023-05-19 16:52:57 -07:00
Max Brunsfeld
fb11c3e4bf Remove stray prints 2023-05-19 16:52:30 -07:00
Mikayla Maki
1474429271
fmt 2023-05-19 16:32:07 -07:00
Mikayla Maki
c795c9b844
Rearrange git tests in worktree
Add support for renaming work directories
2023-05-19 16:30:00 -07:00
Max Brunsfeld
7ae642b9b8 Avoid storing removed_entry_ids on the LocalSnapshot 2023-05-19 15:16:04 -07:00
Max Brunsfeld
32c7157906 🎨 Make worktree repositories more consistent 2023-05-19 15:04:37 -07:00
Max Brunsfeld
6359333749 Don't store next_entry_id on worktree's local snapshot 2023-05-19 13:49:24 -07:00
Kirill Bulatov
7d1833b759
When the file is deleted via project panel, close it in editors (#2490)
Deals with https://github.com/zed-industries/community/issues/179 by
sending a message about it, to asynchronously apply on all workspaces.

Release Notes:

* Fixes a bug when files, deleted in the project panel were left open in
the editor
2023-05-19 21:51:37 +03:00
Max Brunsfeld
844b8d9e1e
Remove unnescessary double lookup in repo for (#2492)
Release Notes:

* Optimize repository queries (preview only)
2023-05-19 11:47:05 -07:00
Mikayla Maki
9f157bdb67
Remove unescessary methods 2023-05-19 11:30:10 -07:00
Max Brunsfeld
729a93db6b Optimize retrieving repos for entries when rendering the project panel
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-05-19 11:29:02 -07:00
Mikayla Maki
6792788216
Remove unnescessary double lookup 2023-05-19 11:08:58 -07:00
Max Brunsfeld
d480555ec9
Fix performance problems in reporting changed FS paths to language servers (#2491)
Fixes
https://linear.app/zed-industries/issue/Z-1611/main-thread-hangs-while-sending-filesystem-change-events-to-lsp

Release Notes:

* Fixed a lag that would sometime occur when large numbers of files
changed on disk, due to reporting the changed files to language servers.
2023-05-19 09:42:55 -07:00
Max Brunsfeld
459cc9c959 Optimize matching of multiple file-watch globs using the globset crate 2023-05-19 09:13:34 -07:00
Kirill Bulatov
583b15badc When the file is deleted via project panel, close it in editors 2023-05-19 18:52:30 +03:00
Kirill Bulatov
3984cc6d39 Properly handle WorktreeId 2023-05-19 12:37:36 +03:00
Max Brunsfeld
4bda5c4d69 Optimize LSP watched file reporting in 2 simple ways
* Convert globs to relative paths in advance. This avoids needing to convert
  every changed path to an absolute path before performing glob matching.
* Avoid duplicate reporting for language servers with multiple worktrees.
2023-05-18 17:08:51 -07:00
Kirill Bulatov
201d513c50 Show navigation history in the file finder modal
co-authored-by: Max <max@zed.dev>
2023-05-18 21:50:38 +03:00
Kirill Bulatov
711d2c6fe7 Maintain recently opened files history 2023-05-18 21:50:38 +03:00
Max Brunsfeld
258723566f Rename settings::register_setting -> settings::register 2023-05-17 15:06:11 -07:00
Max Brunsfeld
2d5f03e148 Remove optional path argument when getting settings 2023-05-17 15:05:20 -07:00
Max Brunsfeld
67a25126d4 Define theme/ui text style settings in theme crate 2023-05-17 14:44:59 -07:00
Max Brunsfeld
89204e85c0 Merge branch 'main' into setting-store 2023-05-17 09:55:24 -07:00
Max Brunsfeld
cbd4771f10 Define project settings in project crate 2023-05-16 17:45:04 -07:00
Max Brunsfeld
39618ae32d Define language settings in the language crate 2023-05-16 17:29:53 -07:00
Julia
8b63caa0bd Fix worktree refresh request causing gitignore to not update
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2023-05-16 13:01:29 -04:00
Julia
f50240181a Avoid removing fake fs entry when rename fails later in the process
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2023-05-16 13:00:39 -04:00
Mikayla Maki
e4d509adf4
fmt 2023-05-15 16:22:52 -07:00
Mikayla Maki
4d40aa5d6f
Restore trickle up git status to folder
co-authored-by: max <max@zed.dev>
2023-05-15 16:22:00 -07:00
Mikayla Maki
68078853b7
Made status tracking resilient to folder renames
co-authored-by: max <max@zed.dev>
2023-05-15 16:21:58 -07:00
Mikayla Maki
307dd2b83e
Update proto names to reflect new status info 2023-05-15 16:20:01 -07:00
Mikayla Maki
6c26f3d0e4
Fixed formatting 2023-05-15 16:20:01 -07:00
Mikayla Maki
2b18975cdc
Change folder styling from a reduce over all child files to a simple 'always modified'
Remove git status from tab titles
2023-05-15 16:20:01 -07:00
Julia
cf53b2ca87
Merge pull request #2471 from zed-industries/optimize-update-local-worktree-buffers
Optimize update local worktree buffers
2023-05-15 13:13:09 -04:00
Julia
fa32adecd5 Fixup more, tests finally pass 2023-05-14 12:06:00 -04:00
Mikayla Maki
a6a4b846bc
fmt 2023-05-13 10:43:16 -07:00
Mikayla Maki
5e2aaf45a0
Fix repository initialization bug 2023-05-13 10:38:24 -07:00
Mikayla Maki
04041af78b
Fixed bug with failing to clear git file status 2023-05-13 02:40:22 -07:00
Mikayla Maki
62c445da57
Match priority of folder highlights to vscode 2023-05-13 02:30:59 -07:00
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
Nathan Sobo
de9bf6dfbd Merge MutableAppContext into AppContext
There may have been a good reason for the difference at some point, or I was
still learning Rust. But now it's just &mut AppContext vs &AppContext.
2023-04-06 15:49:03 -06:00
Max Brunsfeld
aa7918c4b5 Fix handling of redundant buffer creation messages on guests
Check if the buffer already exists *before* overwriting it.
Ignore redundant registrations on remote projects.

Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2023-04-06 12:17:25 -07:00
Max Brunsfeld
22a6a243bc Move project assertions into main assertion function
Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2023-04-06 11:38:42 -07:00
Antonio Scandurra
ef04dc14cc Update file on incomplete buffer instead of waiting for it to be opened
This ensures that two successive file updates coming from the host are
not applied in reverse order.
2023-04-06 17:48:44 +02:00
Antonio Scandurra
8020ea783f Wait to see guest's buffer version before converting completion anchor 2023-04-06 16:23:10 +02:00
Antonio Scandurra
f995d07542 Return error if subscribing to an entity that was already subscribed to 2023-04-06 14:42:19 +02:00
Antonio Scandurra
d7f56d6126 Forget which buffers were shared when host reconnects
This fixes a bug where the host would momentarily disconnect and the guest
would close and reopen the project. This would cause the host to not observe
the guest closing the project. When the guest tried to open one of the
buffers opened prior to closing the project, the host would not send them the
buffer state because it would still remember that the buffer was shared.

The `shared_buffers` map is now cleared when the host reconnects and will slowly
get re-filled as guests issue `SynchronizeBuffers` requests.
2023-04-06 13:49:09 +02:00
Max Brunsfeld
bda7086220 Clear guest's shared buffers if they rejoin project after leaving while host was disconnected 2023-04-05 16:53:36 -07:00
Max Brunsfeld
43a94cda5f Don't skip worktree updates if unknown entries are removed
When rejoining a project, if entries were both created and deleted since
joining the project, the guest will receive those entries ids in as
removed.
2023-04-05 15:36:01 -07:00
Max Brunsfeld
1159f5517b Avoid applying outdated UpdateProject methods after rejoining a room 2023-04-04 21:49:37 -07:00
Max Brunsfeld
1ccf174388 Avoid applying outdated UpdateProject messages
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2023-04-04 18:34:39 -07:00
Max Brunsfeld
5ecc9606af Use synchronous locks in FakeFs
This way, the state can be accessed without running the deterministic
executor.
2023-04-03 18:15:07 -07:00
Max Brunsfeld
f95732e981 Fix bug where guest would drop BufferSaved messages while opening the buffer 2023-04-03 16:23:44 -07:00
Nathan Sobo
aed8df96ff Wrap AnyWeak handles with their typed counterparts 2023-04-02 15:42:03 -06:00
Mikayla Maki
81411b9114 Merge branch 'main' into copilot 2023-03-30 16:57:18 -07:00
Julia
cdde523ea4 Allow each language adapter to provide their own code action kinds array 2023-03-30 15:41:54 -04:00
Antonio Scandurra
5471217089 Use the same serde version across the entire workspace 2023-03-28 09:42:00 -07:00
Mikayla Maki
455cdc8b37 Add copilot crate
Refactor HTTP and github release downloading into util
Lazily download / upgrade the copilot LSP from Zed

Co-authored-by: Max <max@zed.dev>
Co-Authored-By: Antonio <antonio@zed.dev>
2023-03-28 09:41:59 -07:00
Max Brunsfeld
455ffb17f1 Handle path changes and progress updates from all worker threads during initial scan 2023-03-24 14:35:18 -07:00
Max Brunsfeld
027def6800 Merge branch 'main' into lsp-file-change-notifications 2023-03-24 08:52:43 -07:00
Max Brunsfeld
a0e98ccc35 🎨 BackgroundScanner::run 2023-03-23 18:05:12 -07:00
Max Brunsfeld
89e99d2902 🎨 Don't store path changes statefully on the background scanner 2023-03-23 16:04:47 -07:00
Max Brunsfeld
3ff5aee4a1 Respect LSP servers watch glob patterns 2023-03-23 16:03:07 -07:00
Petros Amoiridis
d5bb2d13b8
Introduce terminal button count
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2023-03-22 16:13:58 +02:00
Max Brunsfeld
c1f53358ba Remove unnecessary Arc around background scanner's snapshot 2023-03-21 15:47:02 -07:00
Max Brunsfeld
f7b2713b77 Fix error in joining empty paths 2023-03-21 15:41:24 -07:00
Max Brunsfeld
5da2b123b5 Allow refreshing worktree entries while the initial scan is in-progress 2023-03-21 15:15:12 -07:00
Max Brunsfeld
b10b0dbd75 Only mutate background snapshot in the background scanner 2023-03-21 11:26:33 -07:00
Max Brunsfeld
d742c758bc Restructure communication from BackgroundScanner to LocalWorktree
The worktree no longer pulls the background snapshot from the background scanner.
Instead, the background scanner sends both snapshots to the worktree. Along with
these, it sends the path change sets.

Also, add randomized test coverage for the worktree UpdatedEntries events.
2023-03-21 11:26:13 -07:00
Max Brunsfeld
cbeb6e692d Move postage crate version specification to workspace Cargo.toml 2023-03-21 11:26:13 -07:00
Max Brunsfeld
d36b2a3129 🎨 Simplify some worktree methods
* Consolidate local worktree construction into one method
* Simplify remote worktree construction
* Reduce indirection around pulling worktree snapshots from the background
2023-03-21 11:26:13 -07:00
Max Brunsfeld
51b093197d Add missing import in project tests 2023-03-21 11:26:13 -07:00
Max Brunsfeld
27ad6a57ce Tweak logging in worktree randomized test 2023-03-21 11:26:13 -07:00
Max Brunsfeld
c730dca3c5 Update worktree randomized test to use worktree's public interface and the fake fs 2023-03-21 11:26:13 -07:00
Max Brunsfeld
be5868e1c0 Conservatively report fs events that occurred during initial worktree scan
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2023-03-21 11:26:13 -07:00
Max Brunsfeld
61172c8478 Notify language servers of FS changes 2023-03-21 11:26:13 -07:00
Max Brunsfeld
9837a6e288 Add failing test for reporting FS change events to language servers 2023-03-21 11:26:13 -07:00
Antonio Scandurra
1af8f4be19 Deserialize Theme directly into the heap to avoid stack overflow
Co-Authored-By: Julia Risley <julia@zed.dev>
2023-03-17 15:58:52 +01:00
Antonio Scandurra
9498f02f2c Retrieve workspace configuration before initializing language server 2023-03-16 15:01:31 +01:00
Antonio Scandurra
8a685fa52a Use LanguageRegistry::workspace_configuration everywhere 2023-03-16 10:46:55 +01:00
Antonio Scandurra
60d3fb48e2 Start computing workspace configuration more dynamically 2023-03-16 10:46:55 +01:00
Max Brunsfeld
b34477458e Close remote project windows when leaving a call 2023-03-15 15:24:58 -07:00
Petros Amoiridis
bccc34c61a
Merge branch 'main' into joseph/z-226-add-terminal-popup-menu 2023-03-11 16:42:42 +02:00
Julia
09d306df85
Merge pull request #2266 from zed-industries/avoid-panic
Avoid panic scanning recursive symlink before gitignore is encountered
2023-03-10 17:19:55 -05:00
Julia
0a5cf4b831 Avoid panic scanning recursive symlink before gitignore is encountered 2023-03-10 16:54:57 -05:00
Mikayla Maki
37d01c7fb3
Merge pull request #2199 from zed-industries/welcome-experience
Welcome experience
2023-03-10 10:48:30 -08:00
Antonio Scandurra
686f5439ad Set buffer language when confirming selection in language selector
Co-Authored-By: Julia Risley <julia@zed.dev>
2023-03-10 15:34:26 +01:00
Antonio Scandurra
7a600e7a65 Allow waiting for language to be loaded in LanguageRegistry APIs 2023-03-10 12:17:47 +01:00
Antonio Scandurra
221bb54e48 Introduce a new TryFutureExt::unwrap method 2023-03-10 11:41:13 +01:00
Mikayla Maki
ab4b3293d1 Fix project panel button and style it
Co-authored-by: max <max@zed.dev>
2023-03-07 14:49:13 -08:00
Joseph Lyons
caa6a75238
Show a pop up menu for terminals
Co-Authored-By: Joseph T. Lyons <19867440+JosephTLyons@users.noreply.github.com>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2023-03-07 20:16:08 +02:00
Mikayla Maki
996294ba67
Merge pull request #2246 from zed-industries/fix-lsp-derive-error
Make diagnostic processing order independent
2023-03-04 02:25:47 -08:00
Mikayla Maki
ddf2f2cb0a Update test to use new group ids and new ordering of diagnostics. 2023-03-04 02:21:55 -08:00
Mikayla Maki
bd4d7551a5 Make diagnostic processing order independent
Co-authored-by: max <max@zed.dev>
2023-03-03 16:35:12 -08:00
Joseph T. Lyons
b9573872e1
Merge pull request #2243 from zed-industries/joseph/z-225-track-open-terminals
Keep track of open terminals
2023-03-03 12:55:28 -08:00
Joseph Lyons
3ec71a742d Keep track of open terminals
Co-Authored-By: Petros Amoiridis <petros@hey.com>
Co-Authored-By: Mikayla Maki <mikayla.c.maki@gmail.com>
2023-03-03 12:50:08 -08:00
Max Brunsfeld
70cb2fa8d7 Apply external command formatting if buffer has changed while computing it 2023-03-01 10:17:04 -08:00
Max Brunsfeld
368d2a73ea Perform whitespace formatting regardless of whether buffer has a language server or path 2023-02-28 21:52:00 -08:00
Max Brunsfeld
a890b8f3b7 Add a setting for ensuring a single final newline on save 2023-02-28 21:52:00 -08:00
Max Brunsfeld
7faa0da5c7 Avoid finalizing transactions inside Buffer::apply_diff 2023-02-28 21:52:00 -08:00
Max Brunsfeld
ff85bc6d42 Add setting for removing trailing whitespace on save 2023-02-28 21:52:00 -08:00
Max Brunsfeld
010eba509c Make Project::save_buffer and ::save_buffers into methods 2023-02-20 09:42:44 -08:00
Max Brunsfeld
56b7eb6b6f 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
cdf64b6cad 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
3a7cfc3901 Move the save and save_as code paths close together 2023-02-17 17:21:48 -08:00
Max Brunsfeld
de6eb00e2b Start work on making save and save_as code paths more similar 2023-02-17 15:52:13 -08:00
Max Brunsfeld
76975c29a9 Refactor: split Project::format logic into local and remote cases 2023-02-17 15:29:54 -08:00
Max Brunsfeld
31dac39e34 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
baee6d0342 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
ea39983f78 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
ddf4e1a316 Load languages lazily in the background 2023-01-25 17:47:46 -08:00
Max Brunsfeld
7003a475a7 Assign the language registry to all buffers in the project 2023-01-25 10:44:15 -08:00
Antonio Scandurra
dff08d3cfe Merge branch 'main' into markdown-fenced-blocks 2023-01-24 15:43:35 +01:00
Antonio Scandurra
c48e3f3d05 Reparse unknown injection ranges in buffer when adding a new language 2023-01-24 15:29:59 +01:00
Mikayla Maki
d060114f00 Added complete scripts for generating third party license files 2023-01-23 12:47:12 -08:00
Antonio Scandurra
a58b39f884 Merge branch 'main' into optimize-large-multi-buffers 2023-01-19 16:18:21 +01:00
Antonio Scandurra
8ca0f9ac99 Fix compile errors 2023-01-18 13:58:01 +01:00
Antonio Scandurra
a653e87658 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
8651320c9f Make workspace items expose their underlying models, remove file-related methods 2023-01-17 17:21:06 -08:00
Antonio Scandurra
bb200aa082 Relay saved version metadata to ensure buffers modified state converges 2023-01-17 16:32:54 +01:00
Max Brunsfeld
41ff42ddec 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
95098e4f29 Update git diff base when synchronizing a guest's buffers 2023-01-08 09:10:57 -07:00
Antonio Scandurra
8487ae77e7 Share new worktrees when resharing project
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-01-06 12:58:19 -07:00
Antonio Scandurra
585c23e9f6 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
0d31c8c1c8 Only share worktrees when UpdateProject succeeded 2023-01-06 10:41:11 -07:00
Antonio Scandurra
8c5a0ca3a4 Couple worktree sharing with project metadata updates 2023-01-06 10:31:36 -07:00
Antonio Scandurra
5c05b7d413 Ensure initial project metadata is sent when first sharing a project 2023-01-06 10:18:26 -07:00
Nathan Sobo
4256a96051 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
77e322cb75 Wait for incomplete buffers when handling incoming buffer file updates 2023-01-05 13:50:25 -07:00
Nathan Sobo
7a629769b7 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
789bbf15b7 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
1dd085fc92 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
90fb9b53ad WIP 2023-01-03 13:30:14 -07:00
Nathan Sobo
a6ffcdd0cf 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
f3dee2d332 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
6458a9144e 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
344d05045d Avoid hanging waiting for operations when buffer has none 2022-12-23 12:26:48 +01:00
Max Brunsfeld
d750b02a7c 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 Brunsfeld
c321f5d94a 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
47348542ef Synchronize buffers when either the host or a guest reconnects 2022-12-21 14:20:56 +01:00
Antonio Scandurra
b5fb8e6b8b Remove unused JoinProjectError 2022-12-21 13:10:07 +01:00
Antonio Scandurra
ecd80c553c Verify removing worktrees while host is offline 2022-12-21 11:47:01 +01:00
Antonio Scandurra
59d7f06c57 Handle proto::UpdateProjectCollaborator message in Project 2022-12-21 11:09:27 +01:00
Max Brunsfeld
ec6f2a3ad4 💄 Reorder private Project method 2022-12-20 17:32:42 -08:00
Max Brunsfeld
6542b30d1f 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 Brunsfeld
55ebfe8321 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
9d15b3d295 Remove unused import 2022-12-20 17:47:22 +01:00
Antonio Scandurra
d31fd9bbf2 Support adding worktrees to project while host is offline 2022-12-20 17:42:08 +01:00
Antonio Scandurra
52babc51a0 Make host reconnection test pass when mutating worktree while offline 2022-12-20 17:30:58 +01:00
Antonio Scandurra
1a3940a12e Fix project reconnection test to ensure rooms actually reconnects 2022-12-20 14:51:46 +01:00
Max Brunsfeld
70dd586be9 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
Antonio Scandurra
d8219545c9 💄 2022-12-19 16:17:27 +01:00
Antonio Scandurra
06f6d02579 Stop counting extensions in worktree 2022-12-19 16:05:22 +01:00
Antonio Scandurra
05e99eb67e Introduce an epoch to ConnectionId and PeerId 2022-12-14 15:55:56 +01:00
Mikayla Maki
da100a09fb WIP 2022-12-08 20:21:00 -08:00
Mikayla Maki
c42da5c9b9 WIP 2022-12-08 20:21:00 -08:00
Mikayla Maki
83aefffa38 Rearrange the terminal code to not have a cyclic dependency with the project 2022-12-08 20:21:00 -08:00
Mikayla Maki
1b8763d0cf WIP - move terminal to project as pre-prep for collaboration 2022-12-08 20:21:00 -08:00
Antonio Scandurra
9a62150dce Merge branch 'main' into reconnections-2 2022-12-05 19:18:40 +01:00
Antonio Scandurra
7bbd97cfb9 Send diagnostic summaries synchronously 2022-12-05 19:07:06 +01:00
Kay Simmons
d20d21c6a2 Dock persistence working!
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-12-03 16:06:01 -08:00
Mikayla Maki
4798161118 Distributed database pattern built.
Co-Authored-By: kay@zed.dev
2022-12-03 16:06:01 -08:00
Mikayla Maki
c84201fc9f Done first draft of strongly typed migrations 2022-12-03 16:05:25 -08:00
Antonio Scandurra
969c314315 Merge branch 'main' into reconnections-2 2022-12-02 19:09:33 +01:00
Antonio Scandurra
d0709e7bfa Error if project is disconnected after getting completions response 2022-11-28 19:19:24 +01:00
Antonio Scandurra
af2a2d2494 Return error when waiting on a worktree snapshot after disconnecting 2022-11-28 17:43:40 +01:00
Antonio Scandurra
2a0ddd99d2 Error if project is disconnected after getting code actions response 2022-11-28 15:05:34 +01:00
Antonio Scandurra
5581674f8f After completing LSP request, return an error if guest is disconnected 2022-11-28 14:39:27 +01:00
Julia
a666ca3e40 Collapse proto Point into the one kind of use case, utf-16 coords
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-11-23 13:28:44 -05:00
Julia
b58ae8bdd7 Clip diagnostic range before and during empty range expansion
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-11-23 13:21:05 -05:00
Julia
e51cbf67ab Fixup compile errors 2022-11-22 02:49:47 -05:00
Julia
8c75df30cb Wrap a bunch of traits for Unclipped<T> 2022-11-21 15:58:44 -05:00
Julia
1c84e77c37 Start adding concept of Unclipped text coordinates
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-11-21 15:48:25 -05:00
Julia
436c89650a Rename clamped -> clipped 2022-11-21 15:23:00 -05:00
Julia
bb32599ded Clamp for all UTF-16 to offset conversions which used to use ToOffset 2022-11-21 14:25:01 -05:00
Julia
f9cbed5a1f Clamp UTF-16 coordinate while performing LSP edits rather than panicing 2022-11-21 11:48:13 -05:00
Max Brunsfeld
bca635e5d3 Add LspAdapter hook for processing completions, fix completion sorting from Pyright 2022-11-17 15:26:46 -08:00
Antonio Scandurra
4f39181c4c Revert "Don't replace newer diagnostics with older ones"
This reverts commit 71eeeedc05.
2022-11-17 16:57:40 +01:00
Antonio Scandurra
71eeeedc05 Don't replace newer diagnostics with older ones 2022-11-17 12:21:51 +01:00
Antonio Scandurra
c1291a093b WIP: Allow subscribing to remote entity before creating a model
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-11-16 19:51:24 +01:00
Antonio Scandurra
faf265328e Wait for acknowledgment before sending the next diagnostic summary 2022-11-16 16:03:01 +01:00
Antonio Scandurra
117458f4f6 Send worktree updates after project metadata has been sent 2022-11-16 14:58:11 +01:00
Antonio Scandurra
4b1dcf2d55 Always use strings to represent paths over the wire
Previously, the protocol used a mix of strings and bytes without any consistency.

When we go to multiple platforms, we won't be able to mix encodings of paths anyway.
We don't know this is the right approach, but it at least makes things consistent
and easy to read in the database, on the wire, etc. Really, we should be using entry
ids etc to refer to entries on the wire anyway, but there's a chance this is the
wrong decision.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-11-15 16:46:17 +01:00
Antonio Scandurra
3e8fcb04f7 Finish implementing Db::update_project 2022-11-15 09:01:51 +01:00
Antonio Scandurra
40073f6100 Wait for acknowledgment before sending the next project update 2022-11-14 15:32:49 +01:00
Julia
ea8778921b Use EMPTY code action kind to get more RA actions without breaking TS 2022-11-11 15:26:12 -05:00
Julia
b6f78cd5dc
Merge pull request #1871 from zed-industries/skip-additional-edit-within-primary
Skip LSP additional completion edits which fall within primary edit
2022-11-11 10:31:41 -05:00
Antonio Scandurra
a6198c9a1a
Merge pull request #1870 from zed-industries/fix-remote-abs-paths
Fix bug where absolute paths of worktrees were not being stored on the server
2022-11-11 15:28:17 +00:00
Julia
ad698fd110 Test for filtering out of faulty LSP completion additional edits 2022-11-11 10:28:07 -05:00
Julia
44c3cedc48 Skip additional completions on any kind of overlap with primary edit 2022-11-10 18:53:37 -05:00
Julia
03115c8d71 Skip LSP additional completion edits which fall within primary edit 2022-11-10 15:28:11 -05:00
Nathan Sobo
fb03eb7a3c Store absolute path on server when sharing worktree
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-11-10 09:34:16 -07:00
Julia
7482660456 Don't restrict which kind of code actions we ask the LSP server for 2022-11-08 16:23:31 -05:00
Julia
8361b4d47a Add test for go-to hunk and fix discovered bugs 2022-10-28 15:08:13 -04:00
Julia
ae2021e073 WIP start setting up test infrastructure for editor diff actions
Co-Authored-By: Kay Simmons <kay@zed.dev>
2022-10-28 15:08:13 -04:00
Antonio Scandurra
bb0f6e85a8 Assign a new language when remote buffer is renamed 2022-10-26 17:52:39 +02:00
Antonio Scandurra
19adfdf8bb Match progress token's prefix to detect disk-based diagnostic progress
The new version of rust-analyzer changed the disk-based diagnostic token
to `rust-analyzer/checkOnSave/0`. The trailing number could be different
from 0 when there are multiple Rust projects open using the same rust-analyzer
instance.

As such, with this commit we will perform a prefix match as opposed to a strict
equality check when detecting a disk-based diagnostics progress token.
2022-10-25 11:35:59 +02:00
K Simmons
79cf5dbd4b remove rocksdb 2022-10-18 17:21:15 -07:00
Mikayla Maki
5bb2edca8b Added absolute path info to remote worktrees (updated protocol version) 2022-10-17 15:27:46 -07:00
Mikayla Maki
1789dfb8b1 Fixed tests 2022-10-17 14:53:52 -07:00
Mikayla Maki
f473eadf2d Fixed failing test, now to make breadcrumbs scrollable... 2022-10-17 13:57:29 -07:00
Mikayla Maki
1f161b9aa1 Show full, absolute paths when displaying a local worktree 2022-10-17 13:35:45 -07:00
Max Brunsfeld
2d3d07d4d7 Clear project's shared state upon every disconnection
Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Antonio Scandurra <as-cii@zed.dev>
2022-10-14 10:17:59 -07:00
Antonio Scandurra
37a0fd33c5 Use fake file system for buffer identity test 2022-10-13 09:33:55 +02:00
Antonio Scandurra
f28cc5ca0c Preserve buffer identity when underlying entry temporarily disappears 2022-10-13 09:10:10 +02:00
Antonio Scandurra
0a1aea6cb8 Add test to ensure buffer identity is kept across Project::rename 2022-10-13 08:17:35 +02:00
Max Brunsfeld
6cdf4e98fc Re-export basic text types from text and language crates
Also avoid production dependencies on fs and rope in collab
2022-10-12 15:48:19 -07:00
Max Brunsfeld
69dcfbb423 Send guests DiskBasedDiagnosticsFinished messages when they join a project
Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2022-10-12 13:49:09 -07:00
Max Brunsfeld
3c3671a193 Avoid sending stale diagnostics after sharing a worktree
Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2022-10-12 11:33:19 -07:00
Antonio Scandurra
9adbab5d99 Fix opening a buffer after leaving and joining the same project
This bug existed prior to #1700 and was caused by not clearing the
buffers that were already shared with a peer that left and opened
a project using the same connection. When such peer would re-join
the project and open a buffer that it had opened previously, the
host assumed the peer had already seen that buffer and wouldn't bother
sending it again.
2022-10-12 10:31:06 +02:00
Mikayla Maki
0beb97547e Finished refactoring out fs and rope 2022-10-11 15:25:54 -07:00
Mikayla Maki
0a8e2f6bb0 Moved fs to it's own crate, build failing due to cyclic dependency on rope 2022-10-11 13:03:36 -07:00
Antonio Scandurra
afaacba41f Merge remote-tracking branch 'origin/main' into room 2022-10-10 15:43:38 +02:00
Max Brunsfeld
ec76146a23
Merge pull request #1692 from zed-industries/avoid-duplicate-autoformat-edits
Avoid duplicate autoformat edits
2022-10-07 09:35:10 -07:00
Antonio Scandurra
386de03f46 Fix room disconnection problems when creating room and sharing project 2022-10-07 14:39:11 +02:00
Antonio Scandurra
b479c8c8ba Move project sharing into Room 2022-10-07 10:14:17 +02:00
Julia
d67fad8dca Extend a test to cover repos not at worktree root 2022-10-06 22:20:10 -04:00
Max Brunsfeld
47a8e4222a Don't allow multiple concurrent formatting requests for the same buffer
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-10-06 17:03:38 -07:00
Julia
771215d254 Reload git index on file events to catch new contents 2022-10-06 12:01:21 -04:00
Julia
3f4be5521c Load diff base from correct relative path 2022-10-05 16:04:55 -04:00
Antonio Scandurra
41240351d3 Simplify Collaborator to stop including the user
It can be retrieved from the `Room` and we're guaranteed to have
a room in order to have collaborators in a project.
2022-10-04 18:00:54 +02:00
Mikayla Maki
499e95d16a Removed debugs, simplified settings 2022-10-03 17:43:05 -07:00
Mikayla Maki
6f7547d28f Fixed a couple bugs in tests and worktree path handling 2022-10-03 17:18:38 -07:00
Julia
6f6d72890a Once again respect user settings for git gutter
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-10-03 15:42:30 -04:00
Julia
e6487de069 Rename head text to indicate that it's not always going to be from head
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-10-03 15:11:06 -04:00
Julia
a5c2f22bf7 Move git gutter settings out of editor settings
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-10-03 14:53:33 -04:00
Julia
8f4b3c3493 Store repo content path as absolute
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-10-03 14:00:58 -04:00
Julia
9427bb7553 Be clearer about using GitFilesIncluded setting 2022-10-03 11:58:48 -04:00
Antonio Scandurra
6426037653 Adapt integration tests to always pass a room id to Project::share
Randomized test is failing, so we'll look into that next.
2022-10-03 15:44:11 +02:00
Mikayla Maki
5769cdc354 made git diff rendering respect line wrap 2022-10-02 18:00:13 -07:00
Mikayla Maki
512f817e2f Added proto messages for updating the head text 2022-10-01 18:18:35 -07:00
Mikayla Maki
8c24c858c9 Touched up comments 2022-09-30 17:36:22 -07:00
Mikayla Maki
af0974264c Refactored git repository code to seperate out repository entry tracking data and git2 mocking code.
Co-authored-by: Max <max@zed.dev>
Co-authored-by: Julia <julia@zed.dev>
2022-09-30 17:33:34 -07:00
Julia
c95646a298 WIP Start refactoring separation of concerns for repo metadata
Co-Authored-By: Max Brunsfeld <max@zed.dev>
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-09-30 18:25:25 -04:00
Julia
42b7820dbb Perform git diff on remote buffer open 2022-09-30 18:05:09 -04:00
Julia
ce7f6dd082 Start a test for remote git data updating
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-09-30 15:51:32 -04:00
Antonio Scandurra
964a5d2db7 WIP: require sharing projects on a given Room 2022-09-30 18:21:47 +02:00
Julia
bce25918a0 Fix test build 2022-09-30 11:13:22 -04:00
Antonio Scandurra
074b8f18d1 Rip out project registration and use sharing/unsharing instead 2022-09-30 12:23:57 +02:00
Antonio Scandurra
be8990ea78 Remove project join requests 2022-09-30 11:35:50 +02:00
Julia
e865b85d9c Track index instead of head for diffs 2022-09-29 13:16:02 -04:00
Mikayla Maki
113d3b88d0 Added test, and fix, for changed_repos method on LocalWorktree 2022-09-29 13:16:02 -04:00
Julia
f7714a25d1 Don't pretend this is async 2022-09-29 13:16:02 -04:00
Mikayla Maki
71b2126eca WIP, re-doing fs and fake git repos 2022-09-29 13:16:02 -04:00
Julia
d5fd531743 Move git related things into specialized git crate
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-09-29 13:16:02 -04:00
Julia
bf3b3da6ed Build again 2022-09-29 13:16:02 -04:00
Julia
7e5d49487b WIP Notifying buffers of head text change
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-09-29 13:16:02 -04:00
Julia
759b7f1e07 Update repo scan id when files under dot git dir events
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-09-29 13:16:02 -04:00
Julia
d2b18790a0 Remove git repos from worktree when deleted on storage
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-09-29 13:16:02 -04:00
Julia
4251e0f5f1 Find repos under worktree & return correct results for repo queries
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-09-29 13:16:02 -04:00
Mikayla Maki
c8e63d76a4 Get the test to failing,,, correctly 2022-09-29 13:16:02 -04:00
Mikayla Maki
6ac9308a03 Added git repository type infrastructure and moved git file system stuff into fs abstraction so we can test without touching the file system. Co-Authored-By: kay@zed.dev 2022-09-29 13:16:02 -04:00
Mikayla Maki
0d1b2a7e46 WIP - max & mikayla working on tests 2022-09-29 13:16:02 -04:00
Julia
bb8798a844 WIP pls amend me
Co-Authored-By: Max Brunsfeld <max@zed.dev>
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-09-29 13:16:02 -04:00
Julia
632f47930f Utilize initial file contents as head text by default
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-09-29 13:16:02 -04:00
Julia
8edee9b2a8 Async-ify head text loading 2022-09-29 13:16:02 -04:00
Julia
6633c0b328 Perform initial file load git diff async 2022-09-29 13:16:02 -04:00
Julia
55ca02351c Start painting some sort of hunk info, it's wrong but it's close
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-09-29 13:16:01 -04:00
ForLoveOfCats
2a14af4cde Load a file's head text on file load just to get started 2022-09-29 13:16:01 -04:00
Antonio Scandurra
4a9bf8f4fe Introduce call infrastructure
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-09-28 11:33:38 +02:00
Max Brunsfeld
5d0b6a3da7 Merge branch 'main' into new-signup-flow 2022-09-27 15:35:05 -07:00
Nathan Sobo
f0c50c1e0a Extract db module from project to its own crate
This will let us use it from the telemetry crate.

Co-authored-by: Joseph Lyons <joseph@zed.dev>
2022-09-26 16:37:09 -06:00
Julia
879a0d8b12 Backward compat format settings 2022-09-26 11:41:31 -04:00
Max Brunsfeld
04baccbea6 Start work on a client-side telemetry system 2022-09-23 12:23:12 -07:00
Julia
f3395cf4fd Add editor action to manually invoke buffer format 2022-09-22 18:21:05 -04:00
Max Brunsfeld
3ae16904b4 Avoid changing entry's kind from Dir to PendingDir in refresh_entry
When lots of filesystem changes are occurring, the filesystem event
for the directory creation may be delivered before the call to
fs::metadata resolves.
2022-08-30 16:13:07 -07:00
Max Brunsfeld
d4bbf21650
Merge pull request #1559 from zed-industries/language-injection
Add language injection support
2022-08-30 11:54:00 -07:00
Max Brunsfeld
ced45cbb0a Use SyntaxMap in Buffer 2022-08-24 13:00:27 -07:00
Antonio Scandurra
f0d35ccc50 Move operation serialization off the main thread 2022-08-23 16:34:25 +02:00
Antonio Scandurra
954695f5fe Stream buffer ops in the background when creating buffer for peers 2022-08-23 16:05:56 +02:00
Antonio Scandurra
13c2021aef Default to language that started LSP when querying project symbols 2022-08-22 14:30:27 +02:00
Antonio Scandurra
9c9bf07e40 Create buffers for remote collaborators out of band
Previously, we would use `Project::serialize_buffer_for_peer` and
`Project::deserialize_buffer` respectively in the host and in the
guest to create a new buffer or just send its ID if the host thought
the buffer had already been sent.

These methods would be called as part of other methods, such as
`Project::open_buffer_by_id` or `Project::open_buffer_for_symbol`.
However, if any of the tasks driving the futures that eventually
called `Project::deserialize_buffer` were dropped after the host
responded with the buffer state but (crucially) before the guest
deserialized it and registered it, there could be a situation where
the host thought the guest had the buffer (thus sending them just the
buffer id) and the guest would wait indefinitely.

Given how crucial this interaction is, this commit switches to creating
remote buffers for peers out of band. The host will push buffers to guests,
who will always refer to buffers via IDs and wait for the host to send them,
as opposed to including the buffer's payload as part of some other operation.
2022-08-17 11:55:36 +02:00
ForLoveOfCats
8ba2f77148 One big cleanup pass of clippy lints
Co-authored-by: Mikayla <mikayla@zed.dev>
2022-08-10 16:51:01 -07:00
Max Brunsfeld
7527850546 Handle RPC requests for type definitions on server and host 2022-08-04 15:10:46 -07:00
ForLoveOfCats
c21314bfbd Add ability to provide custom LSP server initialization options 2022-08-04 14:47:06 -04:00
Antonio Scandurra
fc14100134 Fix tests 2022-08-02 18:48:17 +02:00
Antonio Scandurra
a59813cec5
Merge pull request #1430 from zed-industries/xdg-compliance
Store config files under `~/.config/zed` and data files under `~/Library/Application Support/Zed`
2022-08-01 12:13:08 +02:00
ForLoveOfCats
d474e1e1f4 Deduplicate some lsp_command code 2022-07-29 18:04:14 -04:00
ForLoveOfCats
5149c15329 Add "go to type definition" action 2022-07-29 11:41:08 -04:00
Antonio Scandurra
cfe3ebd2b3 Use XDG-compliant directories for config and cache files 2022-07-29 10:01:48 +02:00
Max Brunsfeld
fa5af4383d Introduce AutoindentMode parameter to Buffer::edit
This controls whether or not we preserve the relative indentation
of inserted text blocks.

Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
2022-07-28 14:03:31 -07:00
Antonio Scandurra
8552ba15dc Show symbols located in visible paths before ones located externally 2022-07-26 14:48:18 +02:00
Antonio Scandurra
45eb0e7889 Clip invalid edits from LSP instead of reporting an error
This fixes an issue with the Go language server, which reports invalid
formatting ranges when there's a missing newline at the end of the file.
Specifically, if the buffer is `N` lines long, it will try to insert the
newline at `Point(N + 1, 0)`.

I confirmed the behavior is the same in VS Code, and they indeed clip the
LSP ranges as well.
2022-07-26 08:43:27 +02:00
Antonio Scandurra
32662b6b92 Start indexing UTF-16 offsets
This is needed because cocoa will report ranges as UTF-16 indices.
2022-07-21 09:40:48 +02:00
Max Brunsfeld
43613fe2ac Ensure that fs watches are dropped when dropping the event stream 2022-07-18 14:55:24 -07:00
Antonio Scandurra
11ef6bfbae Avoid unnecessarily emitting fake fs events for dirs that exist 2022-07-18 17:36:40 +02:00
Antonio Scandurra
f9df5fe595 Detect cycles also when processing events 2022-07-18 17:31:09 +02:00
Antonio Scandurra
b3218641cd Create intermediate directories in FakeFs::create_dir 2022-07-18 16:38:26 +02:00
Antonio Scandurra
b48118830f Detect cycles when scanning a directory 2022-07-18 13:47:15 +02:00
Max Brunsfeld
f9a5ed3a85 Start work on a test for a worktree with symlink cycles 2022-07-18 12:23:07 +02:00
Max Brunsfeld
f6c1393dfd Restructure FakeFs to let it model symlinks
Instead of storing paths, model the FS more directly
as nodes
2022-07-18 12:23:07 +02:00
Antonio Scandurra
07d269234f Differentiate among tabs with the same name
This commit introduces a new, optional `Item::tab_description` method
that lets implementers define a description for the tab with a certain
`detail`. When two or more tabs match the same description, we will
increase the `detail` until tabs don't match anymore or increasing the
`detail` doesn't disambiguate tabs any further.

As soon as we find a valid `detail` that disambiguates tabs enough, we
will pass it to `Item::tab_content`. In `Editor`, this is implemented by
showing more and more of the path's suffix as `detail` is increased.
2022-07-14 11:54:11 +02:00
Max Brunsfeld
2a478462b6 Fix association of 'json' lsp language id with JSON language 2022-07-12 15:43:59 -07:00
Max Brunsfeld
c02f4ea8dc Rename LanguageSettings -> EditorSettings 2022-07-12 11:42:43 -07:00
Antonio Scandurra
afc8e9050c
Merge pull request #1252 from zed-industries/plugin
Language Server WebAssembly Plugin Integration (Part 2)
2022-07-12 11:04:20 +02:00
Isaac Clayton
815de6da61 Rewrite test_managing_language_servers to add languages after buffers are open
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2022-07-12 10:25:11 +02:00
Isaac Clayton
d8b22a200e Rename LspAdapterTrait to LspAdapter and LspAdapter to CachedLspAdapter 2022-07-12 09:29:38 +02:00
Antonio Scandurra
b1e3b38cb3 Don't prompt guest to save when closing window after disconnection 2022-07-12 09:05:39 +02:00
Isaac Clayton
be41ad44a7 Fix minor issues in plugin and project raised during review 2022-07-11 16:40:12 +02:00
Isaac Clayton
bc94d0d1a9 Restore main version of Project::symbols and convert to async 2022-07-11 16:22:58 +02:00
Isaac Clayton
0600157c38 Restore main version of Project::completions and convert to async 2022-07-11 15:55:07 +02:00
Isaac Clayton
ec327a30c3 Fix minor issues pointed out in the review 2022-07-11 15:54:03 +02:00
Isaac Clayton
3ad8d5363c Remove the blocking call and inline on_lsp_diagnostics_published 2022-07-11 12:11:00 +02:00
Isaac Clayton
8c91c5c575 Minor fixes found during review 2022-07-11 10:37:51 +02:00
Max Brunsfeld
5bafabcb8e
Merge pull request #1314 from zed-industries/code-action-with-edit-and-command
Run code action's commands if their edits are empty
2022-07-08 16:58:12 -07:00
Max Brunsfeld
e101f4e705 Run code action's commands if their edits are empty 2022-07-08 16:12:20 -07:00
Isaac Clayton
8931218dc6 Remove debug statements 2022-07-08 21:28:35 +02:00
Isaac Clayton
6f99d59d38 Require theme directly when creating language 2022-07-08 16:08:40 +02:00
Isaac Clayton
73620dad06 Add channel to notify project when languages are added 2022-07-08 14:37:27 +02:00
Antonio Scandurra
56f9c7bc1b Include ignored files in fuzzy search when root entry is ignored 2022-07-08 11:54:45 +02:00
Antonio Scandurra
32c6ae3188 🎨 2022-07-08 11:42:59 +02:00
Antonio Scandurra
e66144104f Honor gitignores above worktree root 2022-07-08 11:19:46 +02:00
Antonio Scandurra
9328ab121a Use absolute paths to compute ignored status
This lays the groundwork for harvesting gitignores up above the
worktree.
2022-07-08 11:19:21 +02:00
Antonio Scandurra
ca225d0765 Make build_gitignore async 2022-07-08 08:50:21 +02:00
Isaac Clayton
5cb59dfdab Fix errors resulting from rebase 2022-07-07 18:14:16 +02:00
Isaac Clayton
895747476f Done! Finish transition to async, very close to merging 2022-07-07 16:21:20 +02:00
Isaac Clayton
39fdbc593b Fix most warnings 2022-07-07 16:19:49 +02:00
Isaac Clayton
6585daccf9 Further unpropogate async 2022-07-07 16:16:58 +02:00
Isaac Clayton
4f016d5fc4 Switch LspAdapter to struct and revert some async/await 2022-07-07 16:12:10 +02:00
Isaac Clayton
0872e9b1a7 use join_all to build partial symbols and completions asynchronously 2022-07-07 15:44:21 +02:00
Isaac Clayton
602fe14aa4 Going to move LspAdapter from trait to struct 2022-07-07 15:44:21 +02:00
Isaac Clayton
e4a680f47b Uncommented previously commented sections 2022-07-07 15:44:18 +02:00
Isaac Clayton
2b0b341415 Move await outside of a closure, remove future_wrap dependency 2022-07-07 15:42:53 +02:00
Isaac Clayton
172e276411 Fix warnings and propogate async further 2022-07-07 15:42:48 +02:00
Isaac Clayton
ce90dbd06a Temporarily comment out closure errors to address other errors in project 2022-07-07 15:41:34 +02:00
Isaac Clayton
2ff67ef9f6 Factor out await in doubly-nested for loop 2022-07-07 15:40:39 +02:00
Isaac Clayton
db7b863d8c Fix on_settings_changed, need to review that impl is correct 2022-07-07 15:40:01 +02:00
Isaac Clayton
4dad2eb7d7 Refactor closure to extract async 2022-07-07 15:40:01 +02:00
Isaac Clayton
7d128e81aa Add lsp_settings_changed: Task to Project, need to resolve cx in Project::on_settings_changed 2022-07-07 15:39:59 +02:00
Isaac Clayton
f4b4212932 More work on transitioning to async, need to figure out when to stop 2022-07-07 15:38:28 +02:00
Isaac Clayton
feb6cf6789 Allow async to infect some more functions 2022-07-07 15:34:27 +02:00
Isaac Clayton
2c637b83bf Work on updating code to be async 2022-07-07 15:32:41 +02:00
Antonio Scandurra
52b8efca1b Add integration test to exercise formatting via external command 2022-07-07 11:53:32 +02:00
Antonio Scandurra
c6254247c3 Allow providing an external format in format_on_save setting 2022-07-07 11:04:03 +02:00
Antonio Scandurra
2c1906d710 Normalize line endings when parsing completions
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-07-06 19:32:45 +02:00
Max Brunsfeld
7e9beaf4bb Strip carriage returns from all text in text::Buffer
* Moving the logic from Rope to text::Buffer makes it easier
  to keep the Rope in sync with the fragment tree.
* Removing carriage return characters is lossier, but is much
  simpler than incrementally maintaining the invariant that
  there are no carriage returns followed by newlines. We may
  want to do something smarter in the future.

Co-authored-by: Keith Simmons <keith@zed.dev>
2022-07-05 17:25:09 -07:00
Max Brunsfeld
4aa19c1a7f Select the last root when right-clicking below all project panel entries 2022-07-05 13:21:41 -07:00
Antonio Scandurra
eac76df0ac Transmit new line ending when buffer is reloaded 2022-07-05 08:01:14 +02:00
Max Brunsfeld
c1b886b0ce Normalize line endings consistently between fake and real FS 2022-07-04 13:00:12 -07:00
Max Brunsfeld
9804c683c0 Rename NewlineStyle -> LineEnding 2022-07-04 12:47:40 -07:00
Max Brunsfeld
0ba12eab22 Handle a file's line endings changing on disk 2022-07-04 12:30:28 -07:00
Max Brunsfeld
b0efa4f5c1 Move project tests into their own file 2022-07-04 12:00:15 -07:00
Antonio Scandurra
3480b50920 Detect buffer newline style and honor it when saving 2022-07-04 17:40:26 +02:00
Antonio Scandurra
d3b9eca791 Merge branch 'main' into user-timeline 2022-07-04 09:23:16 +02:00
Antonio Scandurra
0b2452f666
Merge pull request #1265 from zed-industries/worktree-performance
Fix problems that arise when large numbers of files change on disk
2022-07-04 09:19:18 +02:00
Antonio Scandurra
aca757a02d Don't poll snapshot if processing events unless user manually changed fs 2022-07-04 08:10:31 +02:00
Antonio Scandurra
cf05738f68 Remove redundant calls to poll_snapshot 2022-07-01 14:40:39 +02:00
Antonio Scandurra
a42399bcf3 Grab latest snapshot when invoking LocalWorktree::poll_snapshot 2022-07-01 14:36:51 +02:00
Antonio Scandurra
833aa726d5 🎨 2022-07-01 14:11:21 +02:00
Keith Simmons
ebe733a393 Restart language server using original root path rather than the path of the buffer restarted from 2022-06-30 19:11:21 -07:00
Max Brunsfeld
8a105bf12f WIP - try representing snapshots_to_send as a watch 2022-06-30 18:04:31 -07:00
Keith Simmons
832cc3dd19 Clear language server id for all worktrees when stopping a language server 2022-06-30 17:50:30 -07:00
Keith Simmons
6b50dda28a Fix failing test due to change in stop_language_server function 2022-06-30 17:40:50 -07:00
Keith Simmons
38ca4aab31 add assertion to test_definition ensuring no new language servers are created 2022-06-30 17:24:32 -07:00
Keith Simmons
37b75132b7 Minor comment change 2022-06-30 17:18:28 -07:00
Keith Simmons
f495185a4e add a comment explaining the three language server collections on project 2022-06-30 17:09:23 -07:00
Keith Simmons
5e7651e92e Kill starting servers as well as currently running ones 2022-06-30 17:00:29 -07:00
Keith Simmons
db05e32389 Prevent creating extra language server instances if there already exists one for that workspace 2022-06-30 16:46:26 -07:00
Max Brunsfeld
5fdbc38f46 Don't update worktrees' snapshots in the middle of processing fs events 2022-06-30 15:46:31 -07:00
Max Brunsfeld
b81135e10b Stop waiting for snapshot updates when disconnected from host 2022-06-30 15:07:40 -07:00
Antonio Scandurra
4ee8ee5a06 Ensure newer snapshots are always detected in wait_for_snapshot 2022-06-30 18:04:19 +02:00
Antonio Scandurra
484af8c7c4 Split worktree updates when a peer joins an already-shared project 2022-06-30 16:49:56 +02:00
Antonio Scandurra
845c79ee05 Respond to join project request before sharing project completes
This ensures the guest doesn't observe a huge delay when joining.
2022-06-30 14:29:06 +02:00
Antonio Scandurra
09bb3ddeb8 Split worktree updates and only send 256 entries at a time 2022-06-30 14:06:41 +02:00
Antonio Scandurra
5df0a6a425 Coalesce as many fs events as possible before processing them 2022-06-30 10:20:46 +02:00
Antonio Scandurra
b96962005e Keep looking for a newer snapshot before broadcasting it 2022-06-30 09:54:14 +02:00
Max Brunsfeld
b5d862abfe Only send one UpdateProject msg when changing project's online status 2022-06-29 17:58:02 -07:00
Antonio Scandurra
7bae759a02 Send extension counts when metadata changes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-29 17:58:11 +02:00
Antonio Scandurra
d1cdacdf14 Skip ignored entries when recording worktree extensions
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-29 17:00:16 +02:00
Antonio Scandurra
639cd71a3b Record worktree extensions every 5 minutes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-29 16:58:19 +02:00
Antonio Scandurra
f9e0fec396 Maintain extension counts on local worktrees
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-29 16:38:24 +02:00
Antonio Scandurra
09f4262fd4 Don't share a project unless it's online and we're allowing a request 2022-06-29 15:16:55 +02:00
Antonio Scandurra
e3cfc7b3ce Register project activity for offline projects as well 2022-06-29 14:55:04 +02:00
Max Brunsfeld
8fe6809932 Exclude hidden worktrees from project's diagnostic summaries 2022-06-28 14:23:24 -07:00
Max Brunsfeld
f05e94d0de Allow diagnostics to be published for hidden worktrees 2022-06-28 13:31:04 -07:00
Antonio Scandurra
ca1d0a6e59 Ignore tokens that were not created via WorkDoneProgressCreate
With the new version of rust-analyzer, we were seeing stray `WorkDoneProgress::End`
messages that create an imbalance in the `pending_diagnostic_updates` that never
resolves. This was causing the diagnostic status bar item to never update because
we wouldn't emit `DiskBasedDiagnosticsStarted` nor `DiskBasedDiagnosticsFinished`.

This commit fixes the above situation by only acknowledging progress report for tokens
that have explicitly been created via the `WorkDoneProgressCreate` request, as stated
by the protocol.

In addition to that, we are replacing the `pending_diagnostic_updates: isize` with
a `has_pending_diagnostic_updates: bool`. We added it at some point to prevent a similar
issue where we would observe begin/end reports in a seemingly random order, which would cause
us to permanently display a `checking...` message in the status bar. I believe this commit
fixes that as well because the `isize` was just a less general solution for the same
underlying issue. As the protocol states: "the token provided in the create request should
only be used once (e.g. only one begin, many report and one end notification should be sent
to it)."
2022-06-28 10:08:43 +02:00
Keith Simmons
a477733bcb Address hover panic and add hint to install go when language server failed to install 2022-06-27 15:48:15 -07:00
Keith Simmons
bc82d98ae5
Merge pull request #1237 from zed-industries/jump-to-definition
Mouse jump to definition
2022-06-27 15:20:07 -07:00
Antonio Scandurra
7bfd7093b1 Don't stop scanning directory if reading one of the children errors 2022-06-27 08:40:37 +02:00
Keith Simmons
92ab107fc9 working jump to definition with tests 2022-06-24 15:09:31 -07:00
Keith Simmons
848445455d Working underline based on symbol origin 2022-06-24 15:05:35 -07:00
Keith Simmons
755636d10e Use NonZeroU32 to ensure settings tabsize cannot be zero 2022-06-23 12:55:38 -07:00
Antonio Scandurra
2cb8a3ccfb Don't override top-level settings with language defaults
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-23 16:40:57 +02:00
Antonio Scandurra
2d8ffbdfa2 Don't wait for host's worktree updates if they disconnected
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-06-22 19:45:55 +02:00
Antonio Scandurra
2f09a4af16 Update project metadata when releasing a worktree's weak handle
When a project was getting unshared, we would remove invisible worktrees
from the project's state without notifying the server, which was causing
the randomized tests to fail.

This commit calls `Project::remove_worktree` when a worktree's handle gets
released. Doing so ensures that we update both our local metadata database
as well as the state on the server.
2022-06-22 10:26:10 +02:00
Antonio Scandurra
69aa3d848e Report running language servers when sharing project for the first time
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-06-21 20:39:54 +02:00
Antonio Scandurra
4f215a77cd Don't compute fingerprint for every text summary 2022-06-17 15:15:27 +02:00
Antonio Scandurra
6f7a893ec9 Determine Buffer::is_dirty based on the rope's fingerprint 2022-06-17 12:38:25 +02:00
Antonio Scandurra
dc75b70724 Use word boundaries instead of syntax to infer completion edit ranges 2022-06-16 11:27:22 +02:00
Antonio Scandurra
35889add40 Add failing test for wrong typescript completion 2022-06-16 11:26:35 +02:00
Antonio Scandurra
3a1d0dd692 Track active projects in metrics
An active project is defined as a project where there has been at
least a buffer edit, a join request/response, or a follow update
in the last minute.
2022-06-15 10:33:20 +02:00
Keith Simmons
93158bfcff Fix delayed lsp request 2022-06-09 17:03:45 -07:00
Max Brunsfeld
87ba68e3ea
Merge pull request #1155 from zed-industries/golang
Add Go support
2022-06-09 14:18:37 -07:00
Max Brunsfeld
4ce4c0ef03 Ignore completions from gopls that we can't yet handle
We only support additionalEdits if they are provided when resolving the
completion, not if they are provided immediately.
2022-06-09 13:08:08 -07:00
Antonio Scandurra
213b31607c Remove language server statuses synchronously when stopping a server 2022-06-09 10:59:02 +02:00
Antonio Scandurra
69170fc33a Add unit test to ensure changing enable_language_server works 2022-06-09 10:48:06 +02:00
Antonio Scandurra
36a1a7a819 Start/stop language servers when enable_language_server changes 2022-06-09 10:08:11 +02:00
Antonio Scandurra
9d7476afc6 Extract a Project::stop_language_server method when restarting server
This will be useful later to stop a language server when detecting
configuration changes.
2022-06-09 10:05:35 +02:00
Max Brunsfeld
36ce3eb5ef Handle messages associated with LSP WorkDoneProgress::Begin messages
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-08 10:26:41 -07:00
Antonio Scandurra
eda569d6b2 Snapshot file instead of path when creating a buffer snapshot 2022-06-08 14:29:14 +02:00
Antonio Scandurra
d8b885e3ec Provide tab_size when formatting document using LSP range formatting 2022-06-08 09:56:11 +02:00
Keith Simmons
9d5111e86a
Merge pull request #1078 from zed-industries/lsp-hover
LSP Hover Information
2022-06-07 14:45:43 -07:00
Keith Simmons
1b66e1e185 Add integration test and fix hovering over the wire 2022-06-07 14:22:02 -07:00
Keith Simmons
a6c0ee472c Add vim bindings for hover
Allow scrolling in hover popover
2022-06-07 13:07:53 -07:00
Keith Simmons
67d9abc00f Move highlighting to editor code and implement proto message types for hover response 2022-06-07 11:54:52 -07:00
Keith Simmons
c7cc07aafb working markdown rendering 2022-06-07 11:54:51 -07:00
Keith Simmons
b014352740 Syntax highlighting working. Getting started on markdown support 2022-06-07 11:54:33 -07:00
Isaac Clayton
d529a1deb4 Add basic debounce, fix flickering 2022-06-07 11:54:31 -07:00
Keith Simmons
560dff7329 Pull hover popover out of context menu 2022-06-07 11:54:00 -07:00
Isaac Clayton
470c70d394 Get minimal POC working 2022-06-07 11:52:52 -07:00
Antonio Scandurra
b04e62d895 Fix tracking of in-progress disk-based diagnostics on indicator
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-06-07 19:35:53 +02:00
Antonio Scandurra
bbfa6580a4 Avoid refreshing diagnostics for language servers that didn't update
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-06-07 19:05:06 +02:00
Antonio Scandurra
1ecc51f035 Fix warnings 2022-06-06 16:23:49 +02:00
Antonio Scandurra
70afc06666 Handle out-of-order edits coming from LSP 2022-06-06 16:15:11 +02:00
Max Brunsfeld
ed14fd6e0d Add setting to make projects online/offline by default 2022-06-03 17:01:15 -07:00
Max Brunsfeld
24aafde1e8 Avoid persisting project's state before it has been initialized 2022-06-03 16:40:16 -07:00
Max Brunsfeld
e18bc24989 Rename project's 'public'/'private' flag to 'online'/'offline' 2022-06-03 14:39:06 -07:00
Max Brunsfeld
afdd386057 Move persistence and restoration logic from workspace into project
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-03 11:52:14 -07:00
Max Brunsfeld
36a4d31b5b Keep unregistered projects' ids until pending contact updates are done 2022-06-02 18:04:54 -07:00
Max Brunsfeld
f7e7a7c6a7 Use rocksdb to store project paths' public/private state 2022-06-02 17:38:33 -07:00
Max Brunsfeld
d45db1718e Style the contact panel while public/private operations are in-flight 2022-06-02 17:38:33 -07:00
Max Brunsfeld
d11beb3c02 Change project registration RPC APIs to smooth out UI updates
* Make `UnregisterProject` a request. This way the client-side project can wait
  to clear out its remote id until the request has completed, so that the
  contacts panel can avoid showing duplicate private/public projects in the
  brief time after unregistering a project, before the next UpdateCollaborators
  message is received.
* Remove the `RegisterWorktree` and `UnregisterWorktree` methods and replace
  them with a single `UpdateProject` method that idempotently updates the
  Project's list of worktrees.
2022-06-02 17:32:43 -07:00
Max Brunsfeld
3ea061a11e Allow making projects private 2022-06-02 17:32:42 -07:00
Max Brunsfeld
7ef9de32b1 Show private projects in the contacts panel
Introduce a ProjectStore that lets you iterate through all open projects.
Allow projects to be made public by clicking the lock.
2022-06-02 17:29:11 -07:00
Max Brunsfeld
a60fef52c4 Start work on private projects 2022-06-02 17:29:11 -07:00
Antonio Scandurra
6baf8b033b Don't reuse the same diagnostic group id across buffers
This lets us use the group id as the key for an `ElementState`, which
fixes a panic that would occur in project diagnostics when opening it
while there were multiple diagnostic groups with the same id.
2022-06-02 12:05:28 +02:00
Max Brunsfeld
b9dc476e74 Avoid sending unnecessary messages for local projects that aren't shared 2022-06-01 14:49:12 -07:00
Antonio Scandurra
339069b1d3 Cap MessageStream buffer size to 1MB
We temporarily let it grow when the message size exceed the limit,
but restore the buffer's capacity shortly after. This ensures that,
for each connection in its entire lifetime, we only ever use 1MB.
2022-05-31 11:16:32 +02:00
Antonio Scandurra
354488ebdf Don't eagerly populate copied subdirectory
This can race anyway with snapshot updates, so we just eagerly refresh
the root entry and wait for updates to come in to populate it.
2022-05-31 08:11:07 +02:00
Antonio Scandurra
20e1044d49 Merge branch 'main' into project-panel-with-new-mouse-events 2022-05-30 18:29:46 +02:00
Antonio Scandurra
88fdd8606a Eagerly populate child entries when copying a directory via RPC 2022-05-30 18:01:46 +02:00
Antonio Scandurra
3336bc6ab3 Implement copy paste for ProjectPanel 2022-05-30 14:52:34 +02:00
Max Brunsfeld
e6be151a64 Emit the WorktreeRemoved event when removing a worktree from a project 2022-05-27 10:49:10 -07:00
Max Brunsfeld
a1a4c70845 Emit an event when adding a worktree to a project 2022-05-27 10:48:47 -07:00
Antonio Scandurra
3ac6fc89c1 Pretty-print JSON of server snapshot 2022-05-26 09:34:39 +02:00
Antonio Scandurra
ec88288d5e Bump chunk size to 256 2022-05-24 09:54:53 +02:00
Antonio Scandurra
85f228dade Fix logic error when streaming ignored entries
We were calling `next` twice, which led us to skip every other entry.
This commit also enhances the `test_share_project` integration test
to exercise this new streaming logic.
2022-05-24 09:03:05 +02:00
Antonio Scandurra
94e70bc1a6 WIP: log received updated_entries on remote worktree
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-05-23 19:39:24 +02:00
Antonio Scandurra
c65dae8095 Correctly assign ignored status in refresh_entry
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-05-23 19:19:13 +02:00
Antonio Scandurra
23ca9dce2e WIP: stream ignored entries 2022-05-23 16:38:16 +02:00
Antonio Scandurra
fe1498dc1d Fix worktree::Snapshot::entries(true) always being empty 2022-05-23 15:38:20 +02:00
Max Brunsfeld
ef0b584532 Remove AppState from workspace actions
This allows those actions to be bound to keystrokes in the keymap.
Also, remove the WorkspaceParams struct, simplify how Workspaces are
constructed.
2022-05-19 14:37:26 -07:00
Antonio Scandurra
7b161b81b5 WIP: accept to join requests if user is already participating
There's a panic caused by `Store::check_invariants` that we still
need to figure out.
2022-05-17 13:21:20 +02:00
Nathan Sobo
d821e7a4c1 Cancel join requests when the requester closes the window 2022-05-16 20:29:36 -06:00
Antonio Scandurra
ed6ed99d8f Show the reason why a join request was declined
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-05-16 19:57:50 +02:00
Antonio Scandurra
47ce8ae05c Poll snapshot after refreshing entry 2022-05-16 11:50:21 +02:00
Antonio Scandurra
b144995f27 Grab share state after retrieving metadata when refreshing entry 2022-05-16 11:46:49 +02:00
Max Brunsfeld
842bfae3af WIP - update worktree's scan_id when mutating it in the foreground 2022-05-13 17:03:48 -07:00
Antonio Scandurra
5789aeea24 Fix randomized test failure caused by unsharing while guest was joining
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-05-13 17:39:13 +02:00
Antonio Scandurra
dd684d26a1 Make Project::share and Project::unshare private
This is still in-progress because randomized tests are failing.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-05-13 17:17:20 +02:00
Max Brunsfeld
be51a58311 Start work on requesting to join projects
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-05-12 17:53:11 -07:00
Max Brunsfeld
3dee656490 Avoid panic when language server is dropped before being initialized in tests
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-05-09 18:05:10 -07:00
Max Brunsfeld
054d697fb7 Remove remaining code associated with .zed.toml files 2022-05-09 16:31:30 -07:00