Commit Graph

179 Commits

Author SHA1 Message Date
Nate Butler
bcc554a3db Merge branch 'main' into theme-improvements 2022-07-19 20:12:02 -04:00
Nate Butler
46384e71b7 Add icon sets for sizes 8, 12 and 16, remove old icons 2022-07-19 17:11:15 -04:00
K Simmons
8add81350e Rework presenter and MouseRegion to use Handler hashmap rather than individual fields 2022-07-17 23:19:32 -07:00
Nate Butler
4ca4449394 Update icons in rust
Updated icons
- Diagnostic states
- Sidebar icons (project, contacts)
- Navigation arrows
2022-07-16 11:51:10 -04: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
Antonio Scandurra
b937c1acec Move autosave logic up into Workspace and Pane 2022-07-06 16:33:22 +02:00
Antonio Scandurra
5654684d30 Fix editor tests after changing the semantics of is_dirty 2022-06-17 12:57:40 +02:00
Antonio Scandurra
d02bc2f9f8 Add tooltip for project diagnostics 2022-06-15 17:12:47 +02:00
Antonio Scandurra
666ea61dbc Introduce a new BlockStyle field for blocks
This new field allows blocks to specify how they want to be laid out:

- If `Fixed` they can take up all the width they want and they will impact
the scroll width of the editor. This is useful for diagnostic messages and
allows scrolling the editor further to the right to visualize the entire message.
- If `Flex` they can extend all the way to the scroll width without impacting it
any further. This is useful for the rename editor that we insert as a block
decoration when hitting `F2`.
- If `Sticky`, they will be as wide as the editor element and won't participate
in the horizontal scrolling of the editor. This is useful for headers in general,
where we want e.g. the filename and the jump button to always be visible
independently of how much the user has scrolled to the right.
2022-06-10 13:47:40 +02:00
Antonio Scandurra
712d47d94f Render a "Jump to Buffer" icon on all excerpt headers 2022-06-08 15:31:29 +02:00
Antonio Scandurra
c2eaf6128e Move ProjectDiagnosticsEditor::jump to Editor::jump 2022-06-08 15:08:11 +02:00
Antonio Scandurra
15b13fe511 Introduce an optional primary field to ExcerptRange 2022-06-08 12:23:12 +02:00
Antonio Scandurra
ffb75b0f02 Extract an ExcerptRange containing a context field in multi_buffer
This lays the groundwork for adding an optional `primary` field that can
be supplied to provide the "jump to" feature.
2022-06-08 12:13:04 +02: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
3a69943df3 Require that PartialEq is implemented for Action 2022-06-06 09:18:44 +02:00
Antonio Scandurra
6979e67bed Use anchors to jump to diagnostic whenever possible 2022-06-02 09:30:07 +02:00
Antonio Scandurra
cc028cca78 Simplify usage of tooltip
Now you simply specify a text, an action and a style and GPUI will
take of rendering it properly. This is simpler compared to always
providing a custom element and should make tooltip more consistent
across the UI.
2022-06-02 09:12:50 +02:00
Antonio Scandurra
b3242417b3 Show tooltip when hovering over jump to diagnostic icon 2022-06-01 09:55:45 +02:00
Antonio Scandurra
d180f7a2c3 Jump to primary diagnostic when clicking on header's jump icon 2022-05-31 16:25:14 +02:00
Antonio Scandurra
4f9c207425 Show a clickable jump icon for each diagnostic group header 2022-05-31 15:57:22 +02:00
Antonio Scandurra
aefdde66a6 Pass a &mut BlockContext when rendering blocks
This wraps and derefs to `RenderContext<Editor>`, so that we can
easily use `MouseEventHandler`s in blocks.
2022-05-31 15:50:34 +02:00
Nathan Sobo
b110fd5fb7 Render a context menu when right-clicking in project panel
It doesn't currently do anything, but I managed to get it rendering in an absolutely positioned way.
2022-05-26 09:59:25 +02:00
Max Brunsfeld
0becbe482a Distinguish between singleton and non-singleton workspace items
* Prompt to save singleton items before non-singleton ones
* Don't prompt to save multi-buffers if they contain excerpts to items that are open elsewhere and not being closed.

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-05-23 16:03:00 -07:00
Max Brunsfeld
fbd589b589 Start work on handling multibuffers properly when closing unsaved buffers 2022-05-22 16:48:33 -07: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
Keith Simmons
a2fd41174f Reduce accessibility of multibuffer read to reduce risk of borrowing snapshot and buffer refcells twice 2022-05-13 16:58:30 -07:00
Keith Simmons
45ea3d4c38 Review fixes 2022-05-13 15:55:27 -07:00
Keith Simmons
c3a36e6d8a Rename selected_ranges and selected_display_ranges to remove redundant selected 2022-05-13 15:55:27 -07:00
Keith Simmons
de9dc27980 store buffer and display_map model handles on selections collection 2022-05-13 15:55:27 -07:00
Keith Simmons
db0a9114c2 Passing tests and removed local argument. Also pulled autoscroll argument out to change_selections 2022-05-13 15:55:27 -07:00
Keith Simmons
c9dcfff607 Move selection helpers to SelectionCollection, add update_anchor_selections, add a number of invariant preserving mutation functions to the MutableSelectionCollection 2022-05-13 15:55:17 -07:00
Antonio Scandurra
61346f734d WIP 2022-05-05 15:15:58 +02:00
Max Brunsfeld
8481834847 Give hover state to picker items, keystrokes in command palette 2022-04-28 15:17:56 -07:00
Max Brunsfeld
e48a975b1e Give no-error diagnostic indicator a hover state 2022-04-28 12:35:20 -07:00
Max Brunsfeld
772f4579fc Restructure status bar theme to style interactive elements more concisely
Introduce an `Interactive` wrapper type that allows themes to selectively
override properties of items in a hovered or active state.
2022-04-28 10:59:32 -07:00
Max Brunsfeld
a3700e0dd8 Combine diagnostic status w/ diagnostic message indicators
Improve the indicator styling
2022-04-27 14:25:39 -07:00
Max Brunsfeld
9e87be722e Start re-styling diagnostic indicator in status bar 2022-04-27 14:25:39 -07:00
Max Brunsfeld
949fbe7cd3 Allow dumping the project diagnostic view's state as JSON
Also, improve DebugElements action so that it shows the JSON in an editor.

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-04-11 19:51:46 -07:00
Max Brunsfeld
9a4b8e3d8c Load all keybindings from JSON file 2022-04-10 14:29:45 -07:00
Max Brunsfeld
5242a3a6dc Restructure action macro to assign a namespace to every action
Also, allow arbitrary types to be used as Actions via the impl_actions macro

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-07 16:20:49 -07:00
Max Brunsfeld
f73de202d0 Fix diagnostic updates after restarting an LSP w/ a pending diagnostic job 2022-04-06 22:02:27 -07:00
Max Brunsfeld
ec837fa6d7 Update breadcrumbs when multibuffers' excerpts change 2022-04-06 17:12:36 -07:00
Max Brunsfeld
866ffdd4ae Move Settings to its own crate
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-06 10:23:33 -07:00
Antonio Scandurra
703f1c3be0 Introduce workspace::Item::reload to manually trigger a reload 2022-04-01 14:02:49 +02:00
Keith Simmons
92c7b5d6ef Remove result from anchor cmp functions
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-03-24 11:48:31 -07:00
Keith Simmons
ab631cf6c3 Change language::min() to a constant
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-03-24 10:41:33 -07:00
Keith Simmons
f6805eb802 Make rename highlights work across multibuffer excerpts
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-03-24 10:22:47 -07:00
Antonio Scandurra
5cd94b5b92 WIP 2022-03-23 19:05:46 +01:00
Max Brunsfeld
845457e2c4 Always read project entry id from workspace::Item
We cannot store a workspace item's project entry id separately,
since buffers' entry ids can change (for example when doing
a *save as*).

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-17 10:58:20 -07:00