Commit Graph
363 Commits
Author SHA1 Message Date
b7561c6cef Add select_first and select_last bindings to outline view
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-14 10:45:37 -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
Max BrunsfeldandAntonio Scandurra 373fe6fadf Change Editor::set_highlighted_row to take a row range
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-01-13 09:49:46 -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
Max BrunsfeldandNathan Sobo 63a401ac5d Add Buffer::outline method
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-12 18:17:49 -08:00
Max BrunsfeldandNathan Sobo 1a672929e0 Adjust BlockMap tests to reflect new tiebreaking behavior
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-12 12:11:55 -08:00
Max BrunsfeldandNathan Sobo 6ad9ff10c1 Ensure path headers appear before first diagnostic header
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-12 10:51:28 -08:00
Max Brunsfeld 9ccf2f3f58 Tweak theming of project diagnostics 2022-01-12 10:51:08 -08:00
Max Brunsfeld b5ee095da9 Deduplicate path names in the project diagnostics view 2022-01-12 10:51:08 -08:00
Max Brunsfeld a9937ee8be Expand block decorations' bounds to include the gutter 2022-01-12 10:51:08 -08:00
Antonio ScandurraandNathan Sobo 310def2923 Implement Buffer::format
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-12 18:01:20 +01:00
Antonio Scandurra 6fbbbab7ba Process selection anchors in a sorted fashion when refreshing them 2022-01-12 09:28:09 +01:00
Antonio Scandurra b768a3977c Add unit test reproducing a panic when refreshing selections 2022-01-12 09:27:03 +01:00
Antonio Scandurra 7daa4b5b04 Don't return a Result in test-only method select_display_ranges 2022-01-12 09:14:48 +01:00
c16820166b Fix cursor position when inserting newlines on a repeated excerpt
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-11 18:30:25 +01:00
Antonio ScandurraandNathan Sobo aa543a4b0a Ensure selections stay sorted after refreshing them
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-11 17:16:45 +01:00
Antonio ScandurraandNathan Sobo e70b728758 Verify Anchor::buffer_id before resolving it or comparing it
This commit also verifies some properties about anchor resolution in the
multibuffer randomized test.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-11 16:40:12 +01:00
Antonio Scandurra b1de9a945d Fix outdent not working when cursor is at column 0 2022-01-10 15:32:28 +01:00
Antonio Scandurra 0742640b39 Correctly report line boundaries when a map contains both folds and wraps
This fixes the randomized test failures that were occurring on main.
2022-01-10 11:26:48 +01:00
Max Brunsfeld f933d54469 When selections lose their excerpts, move them to the next primary diagnostic 2022-01-07 14:53:33 -08:00
Max BrunsfeldandNathan Sobo ce6f3d7f3e Reuse views when moving between diagnostic view and editors
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-07 11:00:12 -08:00
Max BrunsfeldandNathan Sobo ea263822fa Finish implementing ProjectDiagnostics::open_excerpts
* Build workspace item views with a reference to the workspace
* Add randomized test for MultiBuffer::excerpted_buffers and fix a small bug

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-07 09:59:27 -08:00
Antonio ScandurraandNathan Sobo e5c520a265 Use Buffer handles instead of MultiBuffer as editor workspace items
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-07 17:48:31 +01:00
Antonio ScandurraandNathan Sobo 794d214eee Refactor opening workspace items
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-07 17:38:37 +01:00
Antonio ScandurraandNathan Sobo 3cab32d201 WIP: Add keybinding to open buffers under cursors
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-07 16:12:50 +01:00
Antonio Scandurra 67f672d0cc Clear selections on other excerpted buffers when setting active selections 2022-01-07 10:19:28 +01:00
Max Brunsfeld 94e9c7fd5b Give a full-width background to the diagnostic headers 2022-01-06 17:55:56 -08:00
Max BrunsfeldandNathan Sobo b19d92e918 Keep selections at the top of the project diagnostics view when it is first populated
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-06 17:01:13 -08:00
Nathan SoboandMax Brunsfeld 2dbee1d914 Send diagnostic summaries to guests when they join the project
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-01-06 12:12:09 -07:00
Nathan SoboandAntonio Scandurra 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
Antonio ScandurraandNathan Sobo 1875a0e349 Polish rendering of inline errors
- Don't soft-wrap
- Render multiple lines

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-06 16:17:53 +01:00
Antonio Scandurra f37f839330 Wire up refresh_anchors in Editor::refresh_selections and call it 2022-01-06 15:32:37 +01:00
Max Brunsfeld 7340e83059 WIP - MultiBuffer::refresh_anchors 2022-01-05 21:12:49 -08: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 BrunsfeldandNathan Sobo 5a53eeef63 Don't scroll editors away from the top of their buffer when content changes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-05 12:31:00 -08:00
Max BrunsfeldandNathan Sobo 85a13fa477 Fix panic when resolving anchors after an excerpt id has been recycled
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-05 11:28:49 -08:00
Antonio Scandurra 29b63ae4c6 Remove invalid excerpts as opposed to styling them differently 2022-01-05 18:21:17 +01: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 2b31a48ef9 Clip right when moving to next word in case we land on a block line 2022-01-04 15:17:37 +01:00
Antonio Scandurra ed361f2d1a Position selections correctly when duplicating lines in a multi-buffer 2022-01-04 15:17:37 +01:00
Antonio Scandurra 8dc9197324 Position cursors correctly in Editor::delete_line in a multi-buffer 2022-01-04 15:17:37 +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