Commit Graph
116 Commits
Author SHA1 Message Date
Antonio Scandurra 79568c471a Pass a reference to TestAppContext in tests
This allows us to drop the context *after* we ran all futures to
completion and that's crucial otherwise we'll never drop entities
and/or flush effects.
2022-03-01 12:01:02 +01:00
Nathan SoboandMax Brunsfeld b212b31d0a Open excerpts on alt-enter
Also: Remove special handling for alt-shift-D binding in diagnostics view that opens excerpts. Rely on alt-enter in all multi-buffers instead.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-02-25 16:49:28 -07:00
Antonio ScandurraandMax Brunsfeld 55ec98b42c Don't assume that cloning on split will reuse the same underlying model
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-02-25 18:30:04 +01:00
Antonio Scandurra d15fb9c3dc Use the new split pane's navigation history when cloning an item 2022-02-25 17:22:30 +01:00
Max BrunsfeldandNathan Sobo 20d923b53e Provide editor styling information separately from editor settings
* Since regular editors' font sizes and families are controlled by
  the settings and not the theme, don't store a dummy text style in
  the theme. Instead, only store a font color, and synthesize
  the text style for regular editors using both the theme and the
  settings.
* Style single-line and auto-height editors (now called "field
  editors") using a single function that takes the entire theme and
  selects a relevant sub-object.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-24 16:42:00 -08:00
Max Brunsfeld 0da0b2611e Automatically include current view id in element state ids 2022-02-17 13:44:46 -08:00
Antonio Scandurra 8d3b696cc4 Fix panic caused by reusing the same handler for diagnostic status 2022-02-15 10:49:03 +01:00
5eaa51fd07 Always call set_selections in mouse selection methods
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-11 09:52:18 -08:00
Nathan SoboandMax Brunsfeld d2c81a378b Pass the pending selection to update_selections and set_selections
This helps us preserve our invariant of always having at least a pending selection in set_selections when comparing old and new cursor positions.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-02-11 10:07:42 -07:00
Antonio Scandurra e035758ba9 Move Buffer::format to Project::format 2022-02-11 12:07:46 +01:00
39baa4d0a3 Don't open a multibuffer when code actions's edits are contained in the current editor
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-10 09:55:21 -08:00
Antonio Scandurra 310d43618b Allow editor to be saved when in multi-buffer mode
Also, this commit enables the customization of the title in a multi-buffer.
When specified, it will take precedence over a filename (or "untitled").
2022-02-10 09:35:19 +01:00
Max BrunsfeldandNathan Sobo db9b19b1be Allow inserting multiple excerpts in a batch
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-09 17:56:06 -08:00
Max BrunsfeldandNathan Sobo 689e2af025 Remove ExcerptProperties struct
Pass buffer and range as separate parameters

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-09 17:52:17 -08:00
Max BrunsfeldandNathan Sobo ffc2260958 Add MultiBufferItemHandle
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-09 17:09:03 -08:00
Max Brunsfeld ab8e3f8107 Get tests passing and project diagnostics view working w/ new excerpt headers 2022-02-09 13:51:52 -08:00
Antonio ScandurraandNathan Sobo f7fd68ef77 Render path headers in editor element
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-09 16:28:18 +01:00
Max BrunsfeldandNathan Sobo c477ca9308 Give the editor a handle to the project, not a weak handle to the workspace
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-08 15:48:44 -08:00
Max Brunsfeld 08061504d4 Consolidate logic for completion alongside code actions in Project
This way, completions are dealt with more consistently with code actions,
and the logic is not spread across so many places. The `language::File`
trait and the multibuffer no longer need to deal with completions. Completions
are no longer generic over an anchor type.
2022-02-08 14:24:45 -08:00
b485554e64 Take an Into<AnyViewHandle> in ChildView::new
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-27 17:54:45 +01:00
Antonio ScandurraandNathan Sobo df51f7ae0a Show non-disk-based diagnostics in project diagnostics
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-27 16:23:50 +01:00
Antonio Scandurra 34f4346530 Style empty project diagnostics state 2022-01-27 10:21:26 +01:00
Max Brunsfeld 3588e8276c Increase diagnostic editor's vertical scroll margin
This way, the first path header will always be fully visible when
you move your cursor to the beginning of the multibuffer.
2022-01-26 10:23:41 -08:00
Max Brunsfeld ecb419e20d Render header blocks as horizontall fixed (like the gutter)
Tweak editor layout to perform horizontal autoscroll before
laying out the blocks, so that they can access the scroll position.
2022-01-25 17:19:38 -08:00
Max BrunsfeldandNathan Sobo 88da36a94d Tweak diagnostic header styling
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-25 15:33:49 -08:00
Max Brunsfeld 2313283b26 Render diagnostic status bar icon with icons 2022-01-25 15:33:34 -08:00
Max BrunsfeldandNathan Sobo 8951a4d520 Show icons and counts in the project diagnostics tab
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-25 12:31:55 -08:00
Max Brunsfeld 0bee9ad4f8 Merge branch 'project-diagnostics-pinned-tab' into style-project-diagnostics 2022-01-25 12:20:37 -08:00
Max BrunsfeldandNathan Sobo d034a5d8dc Scale diagnostic header and message text with editor font
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-25 12:10:11 -08:00
Nathan SoboandMax Brunsfeld 764691a9cd Scale diagnostic headers icons with editor font and right align w/ line numbers
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-01-25 12:40:53 -07:00
Antonio ScandurraandNathan Sobo 5519a872ff Style block decorations
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-25 17:07:12 +01:00
Antonio Scandurra 78d341f74f Format messages within backticks using bold instead of with a background 2022-01-25 15:50:49 +01:00
Antonio Scandurra d6797092dc Show error code in diagnostic header 2022-01-25 15:23:58 +01:00
Antonio Scandurra 491f1f47d5 Display icon next to primary message 2022-01-25 15:15:03 +01:00
Antonio Scandurra 972d3a33ad Restyle diagnostic headers 2022-01-25 12:23:24 +01:00
Nathan Sobo 59bbb08068 Defer pane interaction when opening excerpts in diagnostics view
Activating a new item causes the current item to be deactivated. We're the current item, but we're on the stack, so we panic if we try to do this synchronously. If we use defer to wait until we're off the stack it works.
2022-01-22 13:23:08 -07:00
Antonio Scandurra 41100c4439 Make add_local_worktree private and use find_or_create_local_worktree
The former always adds a worktree, even if we have one already in the
project and that could be misused. The public API should always search
for a local worktree containing the requested path first so that the
project can uphold invariants about which worktrees it has.
2022-01-22 11:23:00 +01:00
Max BrunsfeldandNathan Sobo 9d088c0b76 Get diagnostics crate's tests passing
Update diagnostics on project instead of on worktree

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-21 18:02:10 -08:00
Max BrunsfeldandNathan Sobo 8d9db1f304 Move buffers from worktree to project
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-21 15:46:27 -08:00
Nathan Sobo 5e45a8f1aa Revert "Replace project_path with project_entry in workspace::{Item, ItemView}"
This reverts commit c5fe187527.
2022-01-21 11:07:10 -07:00
Antonio Scandurra ba96ca0b1b Remove weak worktrees from project when nobody references them
Also, avoid showing them in the project panel as well as in the
contacts panel.
2022-01-21 14:34:14 +01:00
a8684fe004 Make navigation history work with project diagnostics
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-20 18:21:48 +01:00
Antonio Scandurra 3c1b7e26c9 WIP 2022-01-20 18:11:37 +01:00
Antonio ScandurraandNathan Sobo ade37e946c Make "go to definition" work in project diagnostics
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-20 17:30:30 +01:00
Antonio Scandurra 95f2e7b36c Omit worktree id when emitting Event::DiskBasedDiagnosticsUpdated
Sometimes we will have more than one worktree associated with the same
language server and in that case it's unclear which worktree id we should
report an event for.
2022-01-20 10:13:27 +01:00
Antonio Scandurra ef78225a5d Return a Task<Result<()>> in {ItemView,Buffer,MultiBuffer}::save 2022-01-20 09:58:24 +01:00
Max Brunsfeld 7d9d20a661 Get tests passing, centralize more diagnostic logic in Project 2022-01-19 16:32:55 -08:00
Max Brunsfeld 575def57db Move logic for starting language servers to the project 2022-01-19 14:05:06 -08:00
Antonio ScandurraandMax Brunsfeld 841827f873 Route save_as via the Project
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-19 18:44:48 +01:00
Antonio Scandurra c5fe187527 Replace project_path with project_entry in workspace::{Item, ItemView} 2022-01-19 15:56:04 +01:00