Commit Graph

1342 Commits

Author SHA1 Message Date
Nathan Sobo
d7a78e14ac Allow disk-based diagnostic progress begin/end events to interleave
When multiple saves occur, we can have multiple start events followed by multiple end events. We don't want to update our project diagnostics view until all pending progress is finished.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-01-06 09:32:08 -07:00
Max Brunsfeld
0bcd0a3f08 Forward events from remote worktrees to their projects 2022-01-04 16:01:25 -08:00
Max Brunsfeld
d8b888c9cb Replicate diagnostic summaries
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-01-04 14:29:22 -08:00
Antonio Scandurra
b2f0c78924 Merge branch 'main' into polish-project-diagnostics
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-04 18:35:28 +01:00
Antonio Scandurra
ad1db117e6 Re-enable cargo check for rust-analyzer 2022-01-04 18:26:16 +01:00
Antonio Scandurra
508b9dc024 Rip out "diagnostic providers" 2022-01-04 16:32:17 +01:00
Antonio Scandurra
496066db59 Run Project::diagnose when registering a new language on Worktree 2022-01-04 15:17:37 +01:00
Max Brunsfeld
a4027aacb5 Introduce a WorktreeId struct, fix incorrect use of remote worktrees' handle id 2022-01-04 11:28:44 +01:00
Max Brunsfeld
7f8e76e0f1 Remove worktree-specific methods from language::File trait
Use downcasting instead for accessing worktree-specific state of the Files.

This will allow us to introduce a WorktreeId type and use that everywhere
for identifying worktrees. It also just removes some unnecessary coupling
between the language crate and the worktree.
2022-01-04 11:28:44 +01:00
Max Brunsfeld
a080ae98c6 Allow the zed app to connect to both the old and new rpc endpoints
In the case of the new Next.js app, the app will follow a redirect
from 'zed.dev/rpc' to the subdomain where the rust service is hosted.
Until then, the app will connect directly to zed.dev/rpc.
2022-01-03 15:29:26 -08:00
Antonio Scandurra
393009a05c Implement Buffer::diagnostic_group 2021-12-24 12:08:55 +01:00
Antonio Scandurra
11e3874b4a Remove duplication when assigning diagnostics and hardcode provider names 2021-12-24 12:07:26 +01:00
Max Brunsfeld
4f774e2bde wip 2021-12-23 23:10:28 -08:00
Max Brunsfeld
d5a17053df Get code compiling with some todos 2021-12-23 14:21:10 -08:00
Nathan Sobo
e3ecd87081 WIP
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-23 11:24:35 -07:00
Antonio Scandurra
7b453beebc WIP: Use cargo check for on-disk diagnostics
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-12-23 18:35:50 +01:00
Antonio Scandurra
b9d1ca4341 Show only disk-based diagnostics in ProjectDiagnosticsEditor
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-23 16:47:54 +01:00
Antonio Scandurra
dcf26acaac Use a different invalidation strategy for project-wide diagnostics 2021-12-23 15:41:43 +01:00
Antonio Scandurra
9164c5f239 Emit an UpdateDiagnostics from Worktree when buffer diagnostics change 2021-12-23 09:57:50 +01:00
Max Brunsfeld
1544da887e Start work on preserving continuity of disk-based diagnostics 2021-12-22 12:52:50 -08:00
Max Brunsfeld
2c3efdea8c WIP - Start work on updating project diagnostics view 2021-12-21 16:39:23 -08:00
Max Brunsfeld
bc906fef9c Store worktree's diagnostics summaries ordered by path 2021-12-21 14:07:09 -08:00
Max Brunsfeld
699dafbbd4 Avoid cloning diagnostic messages from language server 2021-12-21 14:06:17 -08:00
Antonio Scandurra
99317bbd62 Delete unit test
Sharing/unsharing is already exercised via the integration tests.
2021-12-21 14:51:09 +01:00
Antonio Scandurra
89c0b358a7 Allow sharing/unsharing of projects 2021-12-21 12:45:20 +01:00
Antonio Scandurra
40da3b233f Get more integration tests passing 2021-12-21 09:50:11 +01:00
Antonio Scandurra
1e8ef8a4c1 Register local worktrees after acquiring a project remote id 2021-12-21 09:49:13 +01:00
Antonio Scandurra
4053d683d9 Re-enable commented out worktree test 2021-12-21 08:35:08 +01:00
Max Brunsfeld
636931373e Add missing RPC handlers for local projects 2021-12-20 18:08:06 -08:00
Max Brunsfeld
870b73aa36 Send a LeaveProject message when dropping a remote project 2021-12-20 18:07:51 -08:00
Max Brunsfeld
a138955943 Fix logic for waiting for project's remote id 2021-12-20 18:07:34 -08:00
Max Brunsfeld
5d8d7de68d Fix accidental usages of local worktree id instead of remote id 2021-12-20 18:06:58 -08:00
Max Brunsfeld
55910c0d79 Get the server and integration tests compiling 2021-12-20 16:30:29 -08:00
Max Brunsfeld
614ee4eac7 Send worktree info only when sharing worktree
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-20 11:36:59 -08:00
Antonio Scandurra
697e641e8e Get back to a compiling state for client
This temporarily disables some tests and there are still some server-side
compiler errors.
2021-12-20 16:08:34 +01:00
Max Brunsfeld
c41b958829 WIP - start restructuring collaboration around entire projects
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-17 22:00:39 -08:00
Max Brunsfeld
a293e9c0c5 Suppress unused field warnings 2021-12-16 11:17:06 -08:00
Max Brunsfeld
0b1c27956b Add Project::open_buffer method 2021-12-13 17:44:15 -08:00
Max Brunsfeld
fe571f1d70 Store diagnostic summaries on worktrees 2021-12-13 16:36:53 -08:00
Max Brunsfeld
6ab795c629 Handle buffer deduping in the worktree instead of in workspace
Previously, buffers were only deduped by file if they were opened
through Workspace::open_entry
2021-12-13 16:35:46 -08:00
Max Brunsfeld
418a9a3d66 Get things compiling with diagnostics on worktree
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-13 11:15:03 -08:00
Antonio Scandurra
85674ba506 WIP
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-13 16:46:35 +01:00
Nathan Sobo
8432daef6a WIP: Start on removing selections from buffer in favor of editor 2021-12-10 19:23:34 -07:00
Max Brunsfeld
a758bd4f8d Fill in some missing methods on MultiBuffer, MultiBufferSnapshot 2021-12-10 14:27:04 -08:00
Antonio Scandurra
91a7bbbba2 Fix some of the diagnostic tests and make DiagnosticEntry generic
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-09 17:53:08 +01:00
Antonio Scandurra
65711b2256 Remove anchor collections
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-09 17:28:27 +01:00
Antonio Scandurra
733e0cb21b Use the new buffer subscription API to keep DisplayMap in sync
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-01 16:08:53 +01:00
Max Brunsfeld
faba276fdc WIP - maintain foldmap with Buffer::edits_since
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-30 17:23:02 -08:00
Max Brunsfeld
924e1578ea Use &Snapshot directly instead of impl Into<Content<'a>>
The text::Buffer and its snapshot already used the same representation
for their content, so we can just make Buffer deref to a Snapshot.
2021-11-30 13:32:11 -08:00
Nathan Sobo
1445ce10b5 Name the root file of every crate after the crate to ease navigation
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-11-30 12:46:39 -07:00
Nathan Sobo
d3f28166cb Rename buffer crate to text and name its entrypoint after the crate
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-11-30 12:26:12 -07:00
Antonio Scandurra
2c17ae9aa6 Introduce a new Grammar struct and allow it to be optional
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-29 17:38:59 +01:00
Nathan Sobo
fbc307cd5e Associate collaborator avatars with "ribbons" corresponding to their cursor color 2021-11-28 13:25:05 -07:00
Nathan Sobo
4bd43e67ef Introduce a TestClient and associate it with a PeerId
This makes it easier to integration test peer interactions because now we know their PeerIds.
2021-11-27 12:33:25 -07:00
Nathan Sobo
b307a7e91d Populate the user data of worktree collaborators
This will make it possible for us to render their avatars. Previously we only had the user ids. During rendering, everything needs to be available synchronously. So now, whenever collaborators are added, we perform the async I/O to fetch their user data prior to adding them to the worktree.
2021-11-26 20:35:50 -07:00
Nathan Sobo
9930e92412 WIP: Give worktrees a reference to the UserStore
This will allow them to fetch user data when peers are added or removed. Still work to do though.
2021-11-26 19:12:12 -07:00
Nathan Sobo
21aba54dc3 Introduce a worktree::Collaborator struct that holds the user_id
We can use this to render avatars.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-11-26 11:28:30 -07:00
Nathan Sobo
c8ad5b68e0 Rename collaborator_logins to authorized_logins
Again, this is about reserving the concept of a "collaborator" for actual collaborators on a worktree.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-11-26 11:08:34 -07:00
Nathan Sobo
f453928b44 Associate the project with an active worktree
This is similar to the active entry, but it can remain assigned even if there is no active entry and we can potentially manipulate it in other scenarios such as interaction with the project browser. This prepares the ground to show the collaborators for the active worktree.
2021-11-26 10:21:56 -07:00
Antonio Scandurra
0e51365770 In a diagnostic group, mark the highest-severity diagnostic as primary
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-18 15:53:00 +01:00
Antonio Scandurra
78bbb83448 Assign diagnostics a group_id based on their related_information
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-04 14:52:34 +01:00
Max Brunsfeld
9384823e47 Remove logging in worktree tests 2021-11-03 12:36:57 -07:00
Antonio Scandurra
9dc3c74260 Make resolving selections generic
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-11-03 17:51:57 +01:00
Max Brunsfeld
8d3f42de52 Start language servers based on buffers' languages
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-02 17:41:01 -07:00
Max Brunsfeld
89392cd23d Avoid using worktree handle in File's path methods
This avoids a circular model update that was happening
when trying to retrieve the absolute path from a buffer's
file while applying remote operations.
2021-11-02 14:33:55 -07:00
Max Brunsfeld
1995bd89a6 Deserialize buffer's diagnostics
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-02 12:29:03 -07:00
Nathan Sobo
2c57703ad6 Explicitly shut down language servers when quitting the app
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-11-02 13:16:25 -06:00
Max Brunsfeld
61e06487b7 Avoid circular model update when sending diagnostics operations 2021-11-01 17:14:22 -07:00
Max Brunsfeld
40c861c249 Move protobuf logic from buffer crate to language crate
This will enable us to add operations that only pertain to the language crate.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-01 14:05:19 -07:00
Max Brunsfeld
78d97a3db2 Use Diagnostic struct in buffer's diagnostics multimap 2021-11-01 12:59:01 -07:00
Max Brunsfeld
1aee7bdb1d Delay quit until language servers are gracefully shut down
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-01 11:57:31 -07:00
Max Brunsfeld
2cbb313467 Avoid panic when rust language isn't present (project unit tests) 2021-10-28 17:12:17 -07:00
Max Brunsfeld
e1556893f7 Merge branch 'anchor-map-selections' into lsp 2021-10-28 17:08:06 -07:00
Max Brunsfeld
9bc08e446b Fix unit test for on-disk-changes to not rely on selection bias 2021-10-28 16:17:07 -07:00
Max Brunsfeld
f3cd710f21 Create valid disjoint selection sets in selections_in_ranges 2021-10-28 16:04:16 -07:00
Max Brunsfeld
79ba217485 Fix routing of diagnostics to buffers in worktree 2021-10-26 15:46:39 -07:00
Max Brunsfeld
5bfbeb55c0 Simplify buffer constructor methods
Don't expose the `buffer::History` to callers of `language::Buffer`
2021-10-26 14:26:47 -07:00
Max Brunsfeld
7d5425e142 Move lsp configuration into language crate
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-26 12:17:51 -07:00
Antonio Scandurra
0674e76864 WIP 2021-10-26 19:42:40 +02:00
Antonio Scandurra
e8a2885721 Introduce Content::anchor_range_multimap 2021-10-26 14:28:02 +02:00
Max Brunsfeld
50c77daa0b Start work on a test for worktree handling LSP diagnostics 2021-10-25 21:42:55 -07:00
Max Brunsfeld
6384950d56 Merge remote-tracking branch 'origin/main' into lsp 2021-10-25 16:24:08 -07:00
Max Brunsfeld
b49a268031 Add a fake lsp server
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-25 15:28:40 -07:00
Antonio Scandurra
580bad2042 Get a basic end-to-end test for rust-analyzer integration working
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-10-25 18:11:52 +02:00
Nathan Sobo
ab4f90a20a Get language and project compiling 2021-10-25 09:26:36 -06:00
Antonio Scandurra
59ed535cdf Implement a more robust way of locating rust-analyzer
When bundled, we will retrieve it out of the `Resources` folder.
Locally, we're expected to run `script/download-rust-analyzer` and
put `vendor/bin` in our $PATH.
2021-10-25 11:02:35 +02:00
Antonio Scandurra
2c6aeaed7c Start on integrating rust-analyzer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-10-21 16:26:37 +02:00
Max Brunsfeld
282195b13e Assign new file handles on buffers when their files change on disk
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-21 13:08:54 +02:00
Max Brunsfeld
eb9d7c8660 Update buffer's saved mtime when file is reloaded after on-disk change
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-21 12:05:44 +02:00
Max Brunsfeld
81a85e9c79 Extract a language crate 2021-10-20 22:51:40 +02:00
Max Brunsfeld
94209d2b6d Rename rpc_client -> client
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-04 17:14:21 -07:00
Max Brunsfeld
2f0212ee98 Rename worktree crate to project, pull in Project
Also, move the high-level fuzzy mathcing functions in
zed::fuzzy into the fuzzy crate so that project can
use them.

This required defining a 'PathMatchCandidateSet' trait
to avoid a circular dependency from fuzzy to worktree.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-04 16:45:05 -07:00