Commit Graph
71 Commits
Author SHA1 Message Date
Antonio Scandurra 71082d4cdc Return a Task<Result<()>> in {ItemView,Buffer,MultiBuffer}::save 2022-01-20 09:58:24 +01:00
Max Brunsfeld f43dcd6763 Move logic for starting language servers to the project 2022-01-19 14:05:06 -08:00
ea69dcd42a Match on names only when outline query has no spaces
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-14 09:16:29 -08:00
Antonio Scandurra a64ba8b687 Allow matching of context items in outline view 2022-01-14 11:09:02 +01:00
Max Brunsfeld adeb7e6864 Incorporate syntax highlighting into symbol outline view
Still need to figure out how to style the fuzzy match characters
now that there's syntax highlighting. Right now, they are
underlined in red.
2022-01-13 18:10:02 -08:00
Max Brunsfeld 7913a1ea22 Include highlighting runs in Outline 2022-01-13 14:46:15 -08:00
Max Brunsfeld 3e1c559b2d Allow multiple disjoint nodes to be captured as matcheable in the outline query 2022-01-13 14:04:25 -08:00
Antonio ScandurraandMax Brunsfeld 055d48cfb2 Select the closest outline item when the outline view's query is empty
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-13 18:43:49 +01:00
Antonio ScandurraandMax Brunsfeld 2660d37ad8 Return Outline<Anchor> from MultiBuffer::outline
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-13 18:24:00 +01:00
Antonio Scandurra 06ba1c64cf Implement Outline::search 2022-01-13 15:10:29 +01:00
Antonio Scandurra ef596c64f8 Add OutlineItem::depth so that we can render a tree in the outline view 2022-01-13 11:35:43 +01:00
Max BrunsfeldandNathan Sobo 63a401ac5d Add Buffer::outline method
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-12 18:17:49 -08:00
Antonio ScandurraandMax Brunsfeld 66694b4c9a Fix failing tests
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-12 18:43:23 +01:00
Antonio ScandurraandNathan Sobo 310def2923 Implement Buffer::format
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-12 18:01:20 +01:00
Max Brunsfeld fee7657fd7 Merge branch 'main' into polish-project-diagnostics 2022-01-05 20:38:20 -08:00
Max BrunsfeldandNathan Sobo e5faaeb2f2 Fix Global::gt and rename it to changed_since
A false negative return value of `gt` was preventing guests' multibuffers from
syncing correctly.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-05 17:36:12 -08:00
Max Brunsfeld 8728d3292d Merge branch 'main' into polish-project-diagnostics
Also fix false failure in ModelHandle::condition when parking is not forbidden.
2022-01-05 10:53:18 -08:00
Antonio Scandurra e56609cf0c Ensure prior, deferred selections don't override newer selections 2022-01-05 15:43:26 +01:00
Antonio Scandurra f8c2620166 Fix Buffer::remote_selections_in_range at query range boundaries 2022-01-05 15:04:50 +01:00
Antonio Scandurra 587a908225 Populate deferred operations when an operation can't be applied 2022-01-05 15:04:19 +01:00
Antonio Scandurra 870fa5f278 Serialize deferred operations 2022-01-05 11:52:41 +01:00
Antonio Scandurra d383ff30ce Introduce randomized test for collaboration on buffers
This test will exercise serialization of operations as well as peers
replicating from an existing buffer.
2022-01-05 11:51:41 +01:00
Antonio Scandurra 7bc8eb4f3d Fix compile errors and get serialization unit test passing 2022-01-05 10:29:29 +01:00
Max Brunsfeld 984e366c32 WIP - Serialize buffer in terms of its state, not its base text + ops
The main reason for this is that we need to include information about
a buffer's UndoMap into its protobuf representation. But it's a bit
complex to correctly incorporate this information into the current
protobuf representation.

If we want to continue reusing `Buffer::apply_remote_edit` for
incorporating the historical operations, we need to either make
that method capable of incorporating already-undone edits, or
serialize the UndoMap into undo *operations*, so that we can apply
these undo operations after the fact when deserializing. But this is
not trivial, because an UndoOperation requires information about
the full offset ranges that were undone.
2022-01-04 18:06:16 -08:00
Antonio ScandurraandMax Brunsfeld 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 508b9dc024 Rip out "diagnostic providers" 2022-01-04 16:32:17 +01:00
Antonio Scandurra 05a6137549 Capture a new buffer snapshot for excerpts whose selections got updated 2022-01-04 12:22:51 +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 BrunsfeldandNathan Sobo 43db9e826b Clear autoindent requests when applying autoindent
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-27 13:33:48 -08:00
Antonio ScandurraandNathan Sobo a85e400b35 Start on a DiagnosticProvider implementation for Rust
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-24 16:22:22 +01: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 d5a17053df Get code compiling with some todos 2021-12-23 14:21:10 -08:00
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 ScandurraandNathan Sobo 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 5d8ed535be Clear out old disk-based diagnostics after 2 seconds 2021-12-22 15:51:51 -08:00
Max Brunsfeld b9551ae8b1 Preserve group ids when updating diagnostics 2021-12-22 14:50:51 -08:00
Max Brunsfeld 0faf5308ac Add a unit test for preserving disk-based diagnostics 2021-12-22 13:27:43 -08:00
Max Brunsfeld 1544da887e Start work on preserving continuity of disk-based diagnostics 2021-12-22 12:52:50 -08:00
Max Brunsfeld 3c26f67ea3 Minor cleanup in Buffer::update_diagnostics 2021-12-21 14:07:50 -08:00
1bdaeda43e Remove disk diagnostics that were invalidated by a buffer edit
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-12-15 18:29:01 +01:00
Nathan SoboandMax Brunsfeld 6c5b27af1d Group diagnostics by primary
Render primary message above the excerpt and supporting messages as block decorations with a `Below` disposition. This is still super rough.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-14 18:26:42 -07:00
Antonio Scandurra 08e9f3e1e3 Maintain a different undo/redo stack in MultiBuffer
This only applies to singleton mode.
2021-12-14 17:43:41 +01:00
Max Brunsfeld 4efdc53d9f WIP 2021-12-13 17:44:20 -08:00
Antonio ScandurraandNathan Sobo 85674ba506 WIP
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-13 16:46:35 +01:00
Antonio Scandurra c984b39aaa Show remote collaborators' active selections 2021-12-13 11:38:38 +01:00
Nathan Sobo cdbcbdfe6d Test undo/redo at editor layer, including selection restoration 2021-12-12 15:04:19 -07:00
Nathan Sobo 1e7184ea07 Get selections rendering again when local selections are owned by Editor 2021-12-11 13:42:46 -07:00