Commit Graph

3027 Commits

Author SHA1 Message Date
Antonio Scandurra
845c79ee05 Respond to join project request before sharing project completes
This ensures the guest doesn't observe a huge delay when joining.
2022-06-30 14:29:06 +02:00
Antonio Scandurra
09bb3ddeb8 Split worktree updates and only send 256 entries at a time 2022-06-30 14:06:41 +02:00
Antonio Scandurra
5df0a6a425 Coalesce as many fs events as possible before processing them 2022-06-30 10:20:46 +02:00
Antonio Scandurra
b96962005e Keep looking for a newer snapshot before broadcasting it 2022-06-30 09:54:14 +02:00
Mikayla Maki
06107afdd4 Added background colors and matched the cursor color 2022-06-29 18:50:08 -07:00
Mikayla Maki
5bc0acd88c Directly qualified function makes cargo happy 2022-06-29 18:34:02 -07:00
Mikayla Maki
ab5247c62e Actually correctly flag tests 2022-06-29 18:31:52 -07:00
Mikayla Maki
75a4556244 Fixed unused import 2022-06-29 18:29:36 -07:00
Mikayla Maki
cde11fe4e7 Support for all 24 bits of colors 2022-06-29 18:27:27 -07:00
Max Brunsfeld
336d69fc61 Update contacts panel test to reflect new RPC message flow 2022-06-29 17:58:18 -07:00
Max Brunsfeld
b5d862abfe Only send one UpdateProject msg when changing project's online status 2022-06-29 17:58:02 -07:00
Max Brunsfeld
ae61a24ad3 Show LSP status and auto update status in one status bar indicator 2022-06-29 16:54:01 -07:00
Mikayla Maki
1c038b81ab Finished current working directory stuff 2022-06-29 16:22:05 -07:00
Max Brunsfeld
87124b959d
Merge pull request #1257 from zed-industries/vscode-pane-bindings
Adjust pane, tab, panel management bindings to match VS Code
2022-06-29 15:49:25 -07:00
Max Brunsfeld
67414deb82 Add split actions to the application menu 2022-06-29 15:40:32 -07:00
Max Brunsfeld
581c9af395 Adjust pane, tab, panel management bindings to match VS Code 2022-06-29 15:33:46 -07:00
Mikayla Maki
bc728c160d Properly fixed the issues with the grid :D 2022-06-29 13:19:25 -07:00
Mikayla Maki
93dfc63f1c Added a test with max, cludged a fix for resizing 2022-06-29 13:07:44 -07:00
Keith Simmons
c9d23dba6c Update command palette filter from vim mode more proactively 2022-06-29 11:58:12 -07:00
Mikayla Maki
ff44ddc077 Fixed warnings 😓 2022-06-29 09:38:02 -07:00
Antonio Scandurra
5eaa45363d Order by total duration in Db::get_top_users_activity_summary
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-06-29 18:28:43 +02:00
Antonio Scandurra
7bae759a02 Send extension counts when metadata changes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-29 17:58:11 +02:00
Antonio Scandurra
d1cdacdf14 Skip ignored entries when recording worktree extensions
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-29 17:00:16 +02:00
Antonio Scandurra
639cd71a3b Record worktree extensions every 5 minutes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-29 16:58:19 +02:00
Antonio Scandurra
f9e0fec396 Maintain extension counts on local worktrees
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-29 16:38:24 +02:00
Antonio Scandurra
09f4262fd4 Don't share a project unless it's online and we're allowing a request 2022-06-29 15:16:55 +02:00
Antonio Scandurra
e3cfc7b3ce Register project activity for offline projects as well 2022-06-29 14:55:04 +02:00
Antonio Scandurra
a52de770b1 Increase coalesce threshold in Db::get_user_activity_timeline 2022-06-29 14:26:02 +02:00
Mikayla Maki
db95c0d0e1 Removed dead clear code 2022-06-28 18:45:26 -07:00
Mikayla Maki
e3834409dd Fixed focus issues with scrolling and input 2022-06-28 18:28:13 -07:00
Mikayla Maki
38ed70d5cc Added theme support 2022-06-28 17:07:18 -07:00
Mikayla Maki
f28fb5797f Fixed scrolling and cursor location 2022-06-28 15:45:27 -07:00
Mikayla Maki
24d671ed3f First bits of polish 2022-06-28 15:45:27 -07:00
Mikayla Maki
2b1fa07e89 Working on selection 2022-06-28 15:45:27 -07:00
Mikayla Maki
9e55c60b6a working on selection and scrolling in terminals 2022-06-28 15:45:27 -07:00
Mikayla Maki
f58a15bbb1 Removed final stuff from theme.rs 2022-06-28 15:45:27 -07:00
Mikayla Maki
31bc758f35 Forgot to commit last night 2022-06-28 15:45:27 -07:00
Mikayla Maki
b36bf0c56d Finally on solid conceptual ground, able to move ahead confidently with Alacritty code 2022-06-28 15:45:27 -07:00
Max Brunsfeld
14d7375149 Add rest API for user activity timeline 2022-06-28 15:40:48 -07:00
Max Brunsfeld
1d10e45282 🎨 Tweak some names dealing with user activity
* Rename `project_activity_summary` to `top_users_activity_summary`
to make clearer the distinction between it and the per-user summary.
* Rename `user_activity_summary` to `user_activity_timeline`, since
its output is structured a bit differently than the courser-grained
"summary" returned by the top-user query.
* Rename `ActivityDuration` -> `ActivityPeriod`
2022-06-28 15:37:56 -07:00
Antonio Scandurra
5cc5e15f4d Implement Db::summarize_user_activity
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-06-28 15:11:34 -07:00
Max Brunsfeld
806da0e9ba 0.42.0 2022-06-28 14:33:19 -07:00
Keith Simmons
26215a0d6e
Merge pull request #1254 from zed-industries/command-palette-filter
Command palette filter
2022-06-28 14:31:21 -07:00
Max Brunsfeld
fc3ec6966b
Merge pull request #1235 from zed-industries/diagnostics-in-hidden-worktrees
Allow diagnostics to be published for hidden worktrees
2022-06-28 14:29:41 -07:00
Max Brunsfeld
8fe6809932 Exclude hidden worktrees from project's diagnostic summaries 2022-06-28 14:23:24 -07:00
Keith Simmons
cea7d3f5a2 add test for filter 2022-06-28 13:45:34 -07:00
Keith Simmons
f6292437fa Add command palette filter global and update it when vim mode is enabled/disabled 2022-06-28 13:35:43 -07:00
Max Brunsfeld
f05e94d0de Allow diagnostics to be published for hidden worktrees 2022-06-28 13:31:04 -07:00
Max Brunsfeld
fae1cc36d6 In most languages, use prev non-empty line as basis for preserving indent 2022-06-28 12:21:54 -07:00
Antonio Scandurra
431d71fe92 v0.41.0 2022-06-28 11:21:06 +02:00
Antonio Scandurra
a53de67e6f
Merge pull request #1247 from zed-industries/ignore-non-created-progress-tokens
Ignore tokens that were not created via `WorkDoneProgressCreate`
2022-06-28 10:14:42 +02:00
Antonio Scandurra
6cf9514e00
Merge pull request #1246 from zed-industries/python-autoindent
Fix Python auto-indent using new auto-indent features
2022-06-28 10:14:22 +02:00
Antonio Scandurra
ca1d0a6e59 Ignore tokens that were not created via WorkDoneProgressCreate
With the new version of rust-analyzer, we were seeing stray `WorkDoneProgress::End`
messages that create an imbalance in the `pending_diagnostic_updates` that never
resolves. This was causing the diagnostic status bar item to never update because
we wouldn't emit `DiskBasedDiagnosticsStarted` nor `DiskBasedDiagnosticsFinished`.

This commit fixes the above situation by only acknowledging progress report for tokens
that have explicitly been created via the `WorkDoneProgressCreate` request, as stated
by the protocol.

In addition to that, we are replacing the `pending_diagnostic_updates: isize` with
a `has_pending_diagnostic_updates: bool`. We added it at some point to prevent a similar
issue where we would observe begin/end reports in a seemingly random order, which would cause
us to permanently display a `checking...` message in the status bar. I believe this commit
fixes that as well because the `isize` was just a less general solution for the same
underlying issue. As the protocol states: "the token provided in the create request should
only be used once (e.g. only one begin, many report and one end notification should be sent
to it)."
2022-06-28 10:08:43 +02:00
Antonio Scandurra
c127eb56ce
Merge pull request #1241 from zed-industries/reopen-closed-item
Introduce `pane::ReopenClosedItem` bound to `cmd-shift-t`
2022-06-28 08:09:03 +02:00
Antonio Scandurra
57f34c6992 💄 2022-06-28 08:04:39 +02:00
Max Brunsfeld
929615964d Add new indentation features to support Python 2022-06-27 22:34:14 -07:00
Keith Simmons
1eb8351440 add hover popover setting 2022-06-27 16:21:22 -07:00
Keith Simmons
a477733bcb Address hover panic and add hint to install go when language server failed to install 2022-06-27 15:48:15 -07:00
Keith Simmons
bc82d98ae5
Merge pull request #1237 from zed-industries/jump-to-definition
Mouse jump to definition
2022-06-27 15:20:07 -07:00
Max Brunsfeld
095f18d661 Upgrade Tree-sitter, Tree-sitter-python 2022-06-27 15:12:31 -07:00
Keith Simmons
f73af85218 bump protocol version and fix panic from storing display points instead of anchors 2022-06-27 15:10:36 -07:00
Keith Simmons
a0577f5f46 Fix usage of existing definitions 2022-06-27 10:07:44 -07:00
Antonio Scandurra
c6e7ae528f Add test for reopening closed items 2022-06-27 17:59:25 +02:00
Antonio Scandurra
0652542f60 Introduce pane::ReopenClosedItem bound to cmd-shift-t 2022-06-27 17:44:33 +02:00
Antonio Scandurra
7bfd7093b1 Don't stop scanning directory if reading one of the children errors 2022-06-27 08:40:37 +02:00
Keith Simmons
a8ea1048cf Change mouse cursor when link is visible 2022-06-24 21:55:57 -07:00
Keith Simmons
a190eb0537 fix rebase merge error 2022-06-24 15:11:57 -07:00
Keith Simmons
92ab107fc9 working jump to definition with tests 2022-06-24 15:09:31 -07:00
Keith Simmons
848445455d Working underline based on symbol origin 2022-06-24 15:05:35 -07:00
Keith Simmons
4286a9b564 wip 2022-06-24 15:03:24 -07:00
Keith Simmons
f78b55f92d wip 2022-06-24 15:03:24 -07:00
Nathan Sobo
4da3005b5c Allow users with no invites to be fetched from the API 2022-06-24 09:57:52 -06:00
Antonio Scandurra
b0eb692760 WIP 2022-06-24 17:21:58 +02:00
Antonio Scandurra
9fcebe783c
Merge pull request #1236 from zed-industries/reduce-server-memory-footprint
Reduce memory footprint on server
2022-06-24 09:34:04 +02:00
Antonio Scandurra
fc5517b6be Gather metrics only when /metrics endpoint is retrieved 2022-06-24 09:28:52 +02:00
Antonio Scandurra
a04adbcac1 Don't trace message payload 2022-06-24 09:27:22 +02:00
Max Brunsfeld
4f643baeee 0.40.0 2022-06-23 13:29:32 -07:00
Max Brunsfeld
c91451a1b2
Merge pull request #1234 from zed-industries/fix-editor-cloning
Clone fold and selection state correctly when splitting an editor
2022-06-23 13:27:40 -07:00
Max Brunsfeld
fb2a7787a1 Clone fold and selection state correctly when splitting an editor 2022-06-23 13:15:50 -07:00
Keith Simmons
755636d10e Use NonZeroU32 to ensure settings tabsize cannot be zero 2022-06-23 12:55:38 -07:00
Max Brunsfeld
1720933597
Merge pull request #1228 from zed-industries/python
Add Python support
2022-06-23 11:25:18 -07:00
Max Brunsfeld
dc056fc46f Treat .pyi files as Python 2022-06-23 11:14:11 -07:00
Max Brunsfeld
4d4db6ec4b Syntax-highlight Python project symbols and completions 2022-06-23 11:14:01 -07:00
Max Brunsfeld
981e53784d Upgrade tree-sitter-python for error recovery improvement 2022-06-23 11:13:30 -07:00
Antonio Scandurra
555847449b Use BTreeMap in Server so we release memory when maps are cleared
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-23 18:02:17 +02:00
Antonio Scandurra
2cb8a3ccfb Don't override top-level settings with language defaults
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-23 16:40:57 +02:00
Antonio Scandurra
90102f22fd Improve testing of window edit state 2022-06-23 14:41:47 +02:00
Antonio Scandurra
a21dbdd0d6 Update window edited status when pane item is removed 2022-06-23 14:28:10 +02:00
Antonio Scandurra
2dae0ddcdb Add test to verify closing window via the mouse 2022-06-23 14:18:53 +02:00
Antonio Scandurra
d9b5357234 Always prevent window from closing and manually invoke Workspace::close
This ensures we ask the user to save their state if there are unsaved
changes.
2022-06-23 11:44:14 +02:00
Antonio Scandurra
06033d7fa9 Introduce ViewContext::on_window_should_close
This is a new callback that can be used to interrupt closing the window
when the user has unsaved changes.
2022-06-23 11:43:19 +02:00
Antonio Scandurra
ca8ddcdeec Set window's edited = true when there are unsaved changes 2022-06-23 10:59:50 +02:00
Antonio Scandurra
01349e1d42 Fix panic when Text contained carriage returns 2022-06-23 10:21:21 +02:00
Max Brunsfeld
11f73bfa4e Integrate pyright language server 2022-06-22 16:58:19 -07:00
Max Brunsfeld
c0dbd8f9b9 Add python outline and bracket queries 2022-06-22 16:28:09 -07:00
Max Brunsfeld
074caa09c2 Make python indent query more general
Upgrade Tree-sitter for a query bugfix that I found while
writing this indent query.
2022-06-22 16:18:52 -07:00
Max Brunsfeld
4cb68b2966 Prioritize keepalive pings over incoming message handling in Peer 2022-06-22 14:44:05 -07:00
Max Brunsfeld
36f8c68099 Remove redundant run_until_parked call in Foreground::advance_clock 2022-06-22 14:43:21 -07:00
Max Brunsfeld
a14b626927 Enable env log in peer tests 2022-06-22 14:42:20 -07:00
Antonio Scandurra
2d8ffbdfa2 Don't wait for host's worktree updates if they disconnected
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-06-22 19:45:55 +02:00
Antonio Scandurra
48ff443d10 Remove stray log statement when contacts are updated
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-06-22 19:40:52 +02:00
Antonio Scandurra
f2d134917e Remove non-determinism from Peer caused by smol's timeout helper 2022-06-22 18:39:12 +02:00
Antonio Scandurra
071d940a88 Ensure receive timeout is triggered before waiting on disconnection 2022-06-22 18:02:42 +02:00
Antonio Scandurra
9b521d6097 Use Arc<Deterministic> to understand which await points are parking 2022-06-22 17:39:34 +02:00
Antonio Scandurra
62521531a6 💄 2022-06-22 15:06:22 +02:00
Antonio Scandurra
fb2590d913 Use a FuturesUnordered to process foreground messages
This prevents deadlocks when e.g., client A performs a request to client B and
client B performs a request to client A. If both clients stop processing further
messages until their respective request completes, they won't have a chance to
respond to the other client's request and cause a deadlock.

This arrangement ensures we will attempt to process earlier messages first, but fall
back to processing messages arrived later in the spirit of making progress.
2022-06-22 15:04:17 +02:00
Antonio Scandurra
6eb3e72c36 Add test demonstrating hang when peers wait on each other's response 2022-06-22 14:41:14 +02:00
Antonio Scandurra
2f09a4af16 Update project metadata when releasing a worktree's weak handle
When a project was getting unshared, we would remove invisible worktrees
from the project's state without notifying the server, which was causing
the randomized tests to fail.

This commit calls `Project::remove_worktree` when a worktree's handle gets
released. Doing so ensures that we update both our local metadata database
as well as the state on the server.
2022-06-22 10:26:10 +02:00
Max Brunsfeld
34351c0a51 Start work on Python support 2022-06-21 17:04:54 -07:00
Keith Simmons
484e98c0bb
Merge pull request #1216 from zed-industries/hover-context-menu-fix
Don't trigger hover popover action when mouse is over context menu
2022-06-21 13:43:24 -07:00
Keith Simmons
19feb627d8
Add comment linking to long term plan 2022-06-21 12:38:27 -07:00
Max Brunsfeld
dc8d5f4ae3
Merge pull request #1217 from zed-industries/fix-lsp-statuses-for-guests
Report running language servers when sharing project for the first time
2022-06-21 11:50:58 -07:00
Antonio Scandurra
83f38aa1ba
Merge pull request #1215 from zed-industries/suggest-upgrade-on-reconnect
Show upgrade required message when reconnecting after a protocol change
2022-06-21 20:41:36 +02:00
Antonio Scandurra
69aa3d848e Report running language servers when sharing project for the first time
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-06-21 20:39:54 +02:00
Max Brunsfeld
e9d19457d6 Add failing test for replication of lsp statuses
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-21 11:27:08 -07:00
Keith Simmons
057a7ec989 Don't trigger hover popover action when mouse is over context menu 2022-06-21 11:23:25 -07:00
Max Brunsfeld
30d75620f1 Fix error when worktree has no file extensions
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-21 11:02:13 -07:00
Keith Simmons
fb881b2eda hide hover on editor blur 2022-06-21 10:37:59 -07:00
Max Brunsfeld
6a2c5e0dc1 Show upgrade required message when reconnecting after a protocol change
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-21 10:26:34 -07:00
Antonio Scandurra
db77601aa2 Expose project metadata via GET /project_metadata 2022-06-21 18:06:31 +02:00
Antonio Scandurra
ebaf3224fd Exclude staff from activity recording 2022-06-21 16:07:59 +02:00
Antonio Scandurra
c90e8c08a6 Accept a datetime range when querying project activity 2022-06-21 14:03:10 +02:00
Antonio Scandurra
95a629d200 Unregister project from db when user disconnects or manually does so 2022-06-21 10:37:34 +02:00
Antonio Scandurra
7acebc4eb8 Register projects in the database and record worktree extensions 2022-06-21 10:29:26 +02:00
Max Brunsfeld
44160869eb Add an API that returns the most active users and the projects where they've been active 2022-06-20 19:46:37 -07:00
Antonio Scandurra
0e20782b53 Highlight files ending in mdx as Markdown
This is clearly a stopgap solution but it'll make our life easier
while hacking on zed.dev.
2022-06-20 15:53:45 +02:00
Antonio Scandurra
d425d9fa64 Allow wrapping selected text with ' in Rust 2022-06-20 11:56:46 +02:00
Antonio Scandurra
6040429f93 Auto-close ' for TypeScript and don't do so for Rust 2022-06-20 11:55:40 +02:00
Antonio Scandurra
d5efae609e Respect close in language configuration when autoclosing bracket 2022-06-20 11:50:44 +02:00
Antonio Scandurra
d6c630f8eb Add missing auto-close brackets from various languages 2022-06-20 11:38:12 +02:00
Antonio Scandurra
137a3996a1 Replace "Remove Folder from Project" label with "Remove from Project` 2022-06-20 10:53:26 +02:00
Max Brunsfeld
71534d4412 Avoid holding a strong project handle in an on_click callback 2022-06-17 15:41:48 -07:00
Max Brunsfeld
6359535c52 v0.39.0 2022-06-17 14:22:49 -07:00
Antonio Scandurra
a35d7c5e15 Use BOOL instead of Rust booleans in handle_key_equivalent 2022-06-17 17:19:18 +02:00
Antonio Scandurra
8f6d081de8 Override performKeyEquivalent to handle key events
This lets us bypass the application menu and invoke the event handler
in Zed first. If that doesn't handle the event, the application menu
item corresponding to the shortcut will be actioned. Prior to this
commit the opposite would happen, which would dramatically limit the
throughput at which we could handle events.
2022-06-17 17:12:56 +02:00
Antonio Scandurra
607903eed5 Return true in the Window::on_event callback if event was handled 2022-06-17 17:09:16 +02:00
Antonio Scandurra
ae2273b40a
Merge pull request #1204 from zed-industries/accurate-is-dirty
Determine `Buffer::is_dirty` based on the rope's fingerprint
2022-06-17 16:08:07 +02:00
Antonio Scandurra
4f215a77cd Don't compute fingerprint for every text summary 2022-06-17 15:15:27 +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
052222c91c Bump protocol version 2022-06-17 12:39:59 +02:00
Antonio Scandurra
6f7a893ec9 Determine Buffer::is_dirty based on the rope's fingerprint 2022-06-17 12:38:25 +02:00
Antonio Scandurra
c31a233aad Introduce a new fingerprint field to TextSummary
This is calculated in `Rope` and uses the `bromberg_sl2` homomorphic
hash function to determine the fingerprint of a single chunk and
compose each chunk fingerprint into a single fingerprint for the entire
rope that is equivalent to hashing all the rope's bytes at once.
2022-06-17 12:12:37 +02:00
Max Brunsfeld
21ecbce9b8 Add a Zed > Preferences submenu with prefs, bindings, theme 2022-06-16 17:50:44 -07:00
Max Brunsfeld
2c61bc2b1f Always use capital letters when rendering a keystroke 2022-06-16 17:48:10 -07:00
Max Brunsfeld
a3b17ffd15 Allow creating application menus with submenus 2022-06-16 17:47:39 -07:00
Max Brunsfeld
216a275ef2 Disable auto-indent entirely for markdown 2022-06-16 14:20:09 -07:00
Max Brunsfeld
dd7b874039 Return focus to the workspace center on escape 2022-06-16 11:30:02 -07:00
Antonio Scandurra
cef85f5d84
Merge pull request #1198 from zed-industries/keyboard-toggle-search-options
Toggle search options via the keyboard
2022-06-16 14:49:37 +02:00
Antonio Scandurra
88d8696414 Display tooltip for select prev/next match buttons 2022-06-16 14:37:33 +02:00
Antonio Scandurra
649185da9c Allow toggling search options via the command palette 2022-06-16 14:28:37 +02:00
Antonio Scandurra
29e57c8e3c Toggle project search options via the keyboard 2022-06-16 14:18:45 +02:00
Antonio Scandurra
d0d6c27ae9 Don't select next match when toggling buffer search option 2022-06-16 14:06:47 +02:00
Antonio Scandurra
a835dcefa2 Toggle buffer search options via the keyboard 2022-06-16 13:44:00 +02:00
Antonio Scandurra
dc75b70724 Use word boundaries instead of syntax to infer completion edit ranges 2022-06-16 11:27:22 +02:00
Antonio Scandurra
35889add40 Add failing test for wrong typescript completion 2022-06-16 11:26:35 +02:00
Antonio Scandurra
edd758eb67 Cap context menu's width to cover at most 70% of the window 2022-06-16 10:40:12 +02:00
Antonio Scandurra
e09a6890f3 Remove unnecessary dependencies from lsp_status crate 2022-06-16 10:02:23 +02:00
Antonio Scandurra
4e4210ac39 Open a buffer for every language server error when clicking on status 2022-06-16 10:00:29 +02:00
Antonio Scandurra
d02bc2f9f8 Add tooltip for project diagnostics 2022-06-15 17:12:47 +02:00
Antonio Scandurra
516bd13474 Add tooltip to follow collaborators 2022-06-15 17:08:39 +02:00
Antonio Scandurra
8a146e49ca Use a different fit mode for tooltips 2022-06-15 16:45:04 +02:00
Antonio Scandurra
f2a48c6b02 Add tooltips for sidebar buttons 2022-06-15 13:50:04 +02:00
Antonio Scandurra
4750727586 Autoscroll to newest selection when adding it via the cursor 2022-06-15 13:21:01 +02:00
Antonio Scandurra
da1eb91935 Replace pane::Split action with Split{Left,Up,Right,Down}
This allows us to show them in the command palette.
2022-06-15 13:06:59 +02:00
Antonio Scandurra
7a81983c62 Fix surrounding text with bracket pairs with multiple selections
This was probably a regression that was introduced with the new batched
`Buffer::edit` API and was caused by providing selection ranges in a
non-ordered fashion (we were passing all the starts first and then all the
ends).

With this commit we are adding a unit test to verify the behavior of
`Editor::surround_with_bracket_pair` and changing the order in which
we pass edit ranges to respect the selection order.
2022-06-15 11:48:21 +02:00
Antonio Scandurra
197a4342d0 Fix tests 2022-06-15 11:16:26 +02:00
Antonio Scandurra
a85f9e74b1 Harvest the latest metrics when /metrics is requested
Now that we track active projects, if nothing happens to the store
during the activity timeout we would still serve some old metrics
that may not account for the staleness of a project.

This commit changes it so that we grab a mutable reference to the store
before serving the metrics, which has the side effect of updating
all the metrics.
2022-06-15 10:54:51 +02:00
Antonio Scandurra
e373e05d27 🎨 2022-06-15 10:42:37 +02:00
Antonio Scandurra
3a1d0dd692 Track active projects in metrics
An active project is defined as a project where there has been at
least a buffer edit, a join request/response, or a follow update
in the last minute.
2022-06-15 10:33:20 +02:00
Antonio Scandurra
6d93a41f40 Exclude admins from collected metrics 2022-06-14 16:26:00 +02:00
Antonio Scandurra
f89977ba41 Bump protocol version 2022-06-14 15:21:37 +02:00
Antonio Scandurra
68093342e7 Broadcast only visible worktree root names 2022-06-14 15:15:23 +02:00
Antonio Scandurra
cfbd8b94d1 Prevent setting files from showing up in project and contacts panels 2022-06-14 14:47:16 +02:00
Antonio Scandurra
5dd28b7e57 🎨 2022-06-14 14:03:25 +02:00
Antonio Scandurra
a5a4246e6c Attempt to open new entry only if it is a file 2022-06-14 14:01:49 +02:00
Antonio Scandurra
572e295854 Open files in project panel using enter instead of right 2022-06-14 13:56:56 +02:00
Antonio Scandurra
146e2b5089 Open files when creating them in project panel 2022-06-14 13:49:47 +02:00
Antonio Scandurra
76da93d260
Merge branch 'main' into users-api 2022-06-14 11:14:16 +02:00
Antonio Scandurra
49d7b4bc12 Allow specifying query, limit and page when hitting /api/users
This is needed to introduce pagination and search in our admin panel.
2022-06-13 17:30:01 +02:00
Antonio Scandurra
fe1a861bf3 Expose a new POST /api/bulk_users API to create many users at once
This API will accept a vector of JSON entries containing the GitHub login,
the email address and the invite count. If that user already exist, the
invite count will be updated to the new one.
2022-06-13 15:18:18 +02:00
Antonio Scandurra
b1e8e81513
Merge pull request #1172 from zed-industries/more-logs
Add more logging to `collab` to better understand user behavior
2022-06-13 09:22:37 +02:00
Antonio Scandurra
502625c570 Exclude ignored files from the logged extension count 2022-06-13 09:16:16 +02:00
Antonio Scandurra
dcdc6311df Don't retain message payloads in span, just log the payload instead 2022-06-13 09:06:58 +02:00
Antonio Scandurra
3b8388dcdd Log extension counts when worktree is updated 2022-06-13 08:57:21 +02:00
Max Brunsfeld
1bc2bc0e95
Merge pull request #1171 from zed-industries/prompt-save-before-quit
Prompt to save changes before quitting the app
2022-06-10 17:32:57 -07:00
Max Brunsfeld
b9eb875bf4 Prompt to save changes before quitting the app 2022-06-10 17:26:33 -07:00
Max Brunsfeld
e2935100db Move prometheus annotations from deployment to pod spec 2022-06-10 14:32:36 -07:00
Max Brunsfeld
2311534c3c Add DataDog OpenMetrics annotations to collab k8s deployment
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-10 13:35:52 -07:00
Max Brunsfeld
2e6fa889ea Add OpenMetrics endpoint exposing the basic RPC store metrics as guages
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-10 13:32:56 -07:00
Max Brunsfeld
4032e517f9 v0.38.0 2022-06-10 10:19:21 -07:00
Antonio Scandurra
63fdf1398a WIP: Start adding more logs 2022-06-10 18:17:02 +02:00
Antonio Scandurra
f91fb48a4c Simplify EditorElement::layout_blocks 2022-06-10 13:57:43 +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
Keith Simmons
02f0fee6ae Always delay hover display 2022-06-09 18:08:23 -07:00
Keith Simmons
e21d1b1acb Merge fix 2022-06-09 17:07:32 -07:00
Keith Simmons
3cec157335 fix compile error in EditorLspTestContext 2022-06-09 17:03:45 -07:00
Keith Simmons
8378590d57 Test fixes 2022-06-09 17:03:45 -07:00
Keith Simmons
93158bfcff Fix delayed lsp request 2022-06-09 17:03:45 -07:00
Keith Simmons
722023e347 test and build fixes 2022-06-09 17:03:45 -07:00
Keith Simmons
dddfc7beae Add hover test and tweak dismiss logic 2022-06-09 17:03:45 -07:00
Keith Simmons
1da1853a76 Hide hover when font changes, and handle case where delay was preventing hover with large symbol range 2022-06-09 17:03:44 -07:00
Keith Simmons
b51bd87c10 Rework hover delay, respect editor font size, and enable hover in multibuffers 2022-06-09 17:03:44 -07:00
Keith Simmons
ee33fb03f2 wip 2022-06-09 17:03:44 -07:00
Max Brunsfeld
87ba68e3ea
Merge pull request #1155 from zed-industries/golang
Add Go support
2022-06-09 14:18:37 -07:00
Max Brunsfeld
924e9648e9 Tweak golang outline query 2022-06-09 13:31:30 -07:00
Max Brunsfeld
9495717421 Add project symbol labels for Go 2022-06-09 13:16:08 -07:00
Max Brunsfeld
861f4c7230 Add syntax highlighting for Go completions 2022-06-09 13:08:18 -07:00
Max Brunsfeld
4ce4c0ef03 Ignore completions from gopls that we can't yet handle
We only support additionalEdits if they are provided when resolving the
completion, not if they are provided immediately.
2022-06-09 13:08:08 -07:00
Max Brunsfeld
7bb7187619 Add tests and fix bugs for editor indent/outdent commands w/ hard tabs 2022-06-09 10:26:09 -07:00
Max Brunsfeld
77b9ab0885 Add buffer test for autoindent with hard tabs 2022-06-09 09:05:07 -07:00
Antonio Scandurra
ea8b5016f7 Snap overlay's bottom/right edge to same window's edge on overflow 2022-06-09 13:48:02 +02:00
Antonio Scandurra
213b31607c Remove language server statuses synchronously when stopping a server 2022-06-09 10:59:02 +02:00
Antonio Scandurra
69170fc33a Add unit test to ensure changing enable_language_server works 2022-06-09 10:48:06 +02:00
Antonio Scandurra
36a1a7a819 Start/stop language servers when enable_language_server changes 2022-06-09 10:08:11 +02:00
Antonio Scandurra
55cc8631cc Introduce a new language-overrideable enable_language_server setting 2022-06-09 10:07:31 +02:00
Antonio Scandurra
9d7476afc6 Extract a Project::stop_language_server method when restarting server
This will be useful later to stop a language server when detecting
configuration changes.
2022-06-09 10:05:35 +02:00
Antonio Scandurra
0408a8259e Add ModelContext::observe_global 2022-06-09 10:05:00 +02:00
Max Brunsfeld
f62fd3cddd Add support for hard tabs
* Add a `hard_tabs` setting that causes indentation to be performed
  using a tab instead of multiple spaces.
* Change Buffer's indentation-related APIs to return an `IndentSize`
  struct with a length and a kind, instead of just a single u32.
* Use hard tabs by default in Go.
2022-06-08 18:30:10 -07:00
Max Brunsfeld
129fc515ef Add parser and queries for go
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-08 10:44:13 -07:00
Max Brunsfeld
36ce3eb5ef Handle messages associated with LSP WorkDoneProgress::Begin messages
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-08 10:26:41 -07:00
Max Brunsfeld
a41f164ffe Launch gopls with the right arguments
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-08 10:25:58 -07: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
5fdafbe8c9 Expose a unique key: usize in ExcerptBoundary 2022-06-08 15:02:52 +02:00
Antonio Scandurra
eda569d6b2 Snapshot file instead of path when creating a buffer snapshot 2022-06-08 14:29:14 +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
a26af194e7 Use visible bounds to determine hit bounds for cursor/mouse regions 2022-06-08 10:17:22 +02:00
Antonio Scandurra
d8b885e3ec Provide tab_size when formatting document using LSP range formatting 2022-06-08 09:56:11 +02:00
Antonio Scandurra
494a1b332f Reduce log level on collab
This is generating way too much data and doesn't seem very cost-effective
to investigate the issues we've had with the stale contacts panel.
2022-06-08 09:06:13 +02:00
Max Brunsfeld
8f4387a252 Start work on installing gopls 2022-06-07 18:38:37 -07:00
Max Brunsfeld
209ff619ef Simplify interface of latest_github_release helper function 2022-06-07 16:26:01 -07:00
Max Brunsfeld
8311458931 Add status bar link and Help menu item to open an issue on feedback repo 2022-06-07 15:48:12 -07:00
Keith Simmons
9d5111e86a
Merge pull request #1078 from zed-industries/lsp-hover
LSP Hover Information
2022-06-07 14:45:43 -07:00
Max Brunsfeld
26cd20e38b
Merge pull request #1132 from zed-industries/refresh-on-save
Don't refresh the project diagnostics until the user saves
2022-06-07 14:28:07 -07:00
Keith Simmons
1b66e1e185 Add integration test and fix hovering over the wire 2022-06-07 14:22:02 -07:00
Max Brunsfeld
b53f887ecc
Merge pull request #1129 from zed-industries/update-notification
Show a notification after Zed auto-updates
2022-06-07 13:16:04 -07:00
Keith Simmons
a6c0ee472c Add vim bindings for hover
Allow scrolling in hover popover
2022-06-07 13:07:53 -07:00
Keith Simmons
67d9abc00f Move highlighting to editor code and implement proto message types for hover response 2022-06-07 11:54:52 -07:00
Keith Simmons
c7cc07aafb working markdown rendering 2022-06-07 11:54:51 -07:00
Isaac Clayton
efd798f5f6 Quick documentation pass 2022-06-07 11:54:33 -07:00
Keith Simmons
b014352740 Syntax highlighting working. Getting started on markdown support 2022-06-07 11:54:33 -07:00
Isaac Clayton
863a3b1886 Clean up impl a bit 2022-06-07 11:54:33 -07:00
Isaac Clayton
d529a1deb4 Add basic debounce, fix flickering 2022-06-07 11:54:31 -07:00
Keith Simmons
560dff7329 Pull hover popover out of context menu 2022-06-07 11:54:00 -07:00
Isaac Clayton
470c70d394 Get minimal POC working 2022-06-07 11:52:52 -07:00
Isaac Clayton
24ad60a651 Add hover action and style context menu 2022-06-07 11:50:49 -07:00
Keith Simmons
0ed8a42bb4 WIP 2022-06-07 11:49:28 -07:00
Keith Simmons
0c4f798a2d WIP jump to definition with mouse 2022-06-07 11:47:23 -07: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
6b4e7da7d6 Prepopulate project search query when deploying it from an editor 2022-06-07 10:02:04 +02:00
Max Brunsfeld
c86b12e1b6 Show a notification after Zed auto-updates 2022-06-06 17:42:31 -07:00
Max Brunsfeld
ce080e9520 Update connected users' invite info when they are granted invite codes 2022-06-06 11:14:01 -07:00
Max Brunsfeld
6899eacf3d v0.37.0 2022-06-06 10:37:27 -07:00
Max Brunsfeld
075dd83a43
Merge pull request #1115 from zed-industries/offset-out-of-range
Fix `offset out of range` panic during `FoldMap::sync`
2022-06-06 10:32:18 -07:00
Max Brunsfeld
436c989e4b
Merge pull request #1109 from zed-industries/fix-vim-clearing-selections
Avoid collapsing selections on editor creation when vim_mode is disabled
2022-06-06 10:32:12 -07:00
Antonio Scandurra
1ecc51f035 Fix warnings 2022-06-06 16:23:49 +02:00
Antonio Scandurra
70afc06666 Handle out-of-order edits coming from LSP 2022-06-06 16:15:11 +02:00
Antonio Scandurra
8826ad5ddd Make Buffer::edit and MultiBuffer::edit resilient to inverted ranges
Previously, we would accept edits containing out-of-order ranges. When
generating such ranges in our randomized tests, many invariants started
breaking causing e.g. undo/redo to misbehave and operation application
to panic.

In theory, we should never pass inverted ranges, but this commit changes
the above functions to swap the start and the end when that occurs to avoid
breaking the entire system and panicking.
2022-06-06 15:22:36 +02:00
Antonio Scandurra
c22aedfe69 Fix tests 2022-06-06 09:29:42 +02:00
Antonio Scandurra
22dd68fbfb Add keystroke for menu item only when action is equal to binding
This fixes a bug where we would show `cmd-e` instead of `cmd-f` for
`Edit -> Find` because both bindings would have the `buffer_search::Deploy`
action and we were mistakenly selecting the former.
2022-06-06 09:26:33 +02:00
Antonio Scandurra
3a69943df3 Require that PartialEq is implemented for Action 2022-06-06 09:18:44 +02:00
Antonio Scandurra
492cc716d3 Don't manipulate selections when syncing options if vim-mode is disabled
Previously, we were always mutating selections when `sync_editor_options`
was called. This seems to happen every time vim is enabled/disabled, but also
when vim is disabled and editors are simply focused/blurred.

This commit changes it so that we only manipulate selections when vim-mode is active.
2022-06-06 08:14:49 +02:00
Max Brunsfeld
905fbacbc7 vim: Avoid collapsing selections on editor creation when vim_mode is disabled 2022-06-04 15:01:43 -07:00
Antonio Scandurra
74aa9c1320 Capture mouse events when rendering disconnected overlay
We do so by replacing `EventHandler::capture` with a new `::capture_all` method.
After switching to mouse regions as part of zed-industries/zed#1081, overriding
`dispatch_event` on `EventHandler` wasn't enough anymore because mouse interactions
take place on a privileged code path that runs *before* dispatching any event.

With this change, `EventHandler` will now push a mouse region that intercepts all
mouse interactions, as well as pushing a cursor region that resets the cursor style
to `Arrow`.

One interesting change as part of this is that we've removed the ability to see which
event we are capturing: we were not using this capability anyway and `capture_all` provides
a simpler interface, so I went with that. In the future, we can opt into capturing specific
events or mouse interactions if there's a code path that needs that.
2022-06-04 10:41:29 +02:00
Max Brunsfeld
ff3e3d0799
Merge pull request #1084 from zed-industries/private-projects
Offline projects
2022-06-03 17:14:46 -07:00
Max Brunsfeld
41b7fd4a27 Rename a public/private to online/offline in a few more places 2022-06-03 17:08:44 -07:00
Max Brunsfeld
ed14fd6e0d Add setting to make projects online/offline by default 2022-06-03 17:01:15 -07:00
Max Brunsfeld
24aafde1e8 Avoid persisting project's state before it has been initialized 2022-06-03 16:40:16 -07:00
Max Brunsfeld
e18bc24989 Rename project's 'public'/'private' flag to 'online'/'offline' 2022-06-03 14:39:06 -07:00
Max Brunsfeld
b2aa831017 Store a FakeFs on TestClient 2022-06-03 13:49:47 -07:00
Max Brunsfeld
8bd4a0ab81 Don't store Project on TestClient in integration tests 2022-06-03 13:00:56 -07:00
Max Brunsfeld
afdd386057 Move persistence and restoration logic from workspace into project
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-03 11:52:14 -07:00
Max Brunsfeld
6a3a3a1124 Add tooltip to the toggle public button in the contacts panel
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-03 10:36:29 -07:00
Antonio Scandurra
55fc2341d8 Consolidate C and C++ LSP adapters
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-06-03 18:05:43 +02:00
Antonio Scandurra
1db4970c5a Implement CppLspAdapter::name by delegating to CLspAdapter::name
This makes it more evident that both languages share the same language
server.

Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-06-03 17:49:31 +02:00
Antonio Scandurra
416496225e Syntax-highlight project-wide symbols for C++ 2022-06-03 11:47:56 +02:00
Antonio Scandurra
c6e6a9f1eb Show prettier completions for C++ 2022-06-03 11:33:03 +02:00
Antonio Scandurra
8ca0127658 Make LspAdapter::process_diagnostics optional 2022-06-03 10:56:26 +02:00
Antonio Scandurra
d4da5135f4 Introduce support for C++ 2022-06-03 10:52:34 +02:00
Max Brunsfeld
98b54763b9 Bump protocol version 2022-06-02 18:06:29 -07:00
Max Brunsfeld
36a4d31b5b Keep unregistered projects' ids until pending contact updates are done 2022-06-02 18:04:54 -07:00
Max Brunsfeld
db97dcd76f Don't update contacts when a project is first registered
Until the host has sent an UpdateProject message to populate the project's
metadata, there is no reason to update contacts.
2022-06-02 17:41:21 -07:00
Max Brunsfeld
f7e7a7c6a7 Use rocksdb to store project paths' public/private state 2022-06-02 17:38:33 -07:00
Max Brunsfeld
724affc442 Upgrade deps to avoid multiple versions of transitive deps
* env_logger
* prost-build
* bindgen
2022-06-02 17:38:33 -07:00
Max Brunsfeld
d45db1718e Style the contact panel while public/private operations are in-flight 2022-06-02 17:38:33 -07:00
Max Brunsfeld
d11beb3c02 Change project registration RPC APIs to smooth out UI updates
* Make `UnregisterProject` a request. This way the client-side project can wait
  to clear out its remote id until the request has completed, so that the
  contacts panel can avoid showing duplicate private/public projects in the
  brief time after unregistering a project, before the next UpdateCollaborators
  message is received.
* Remove the `RegisterWorktree` and `UnregisterWorktree` methods and replace
  them with a single `UpdateProject` method that idempotently updates the
  Project's list of worktrees.
2022-06-02 17:32:43 -07:00
Max Brunsfeld
4d4ec793e2 Remove stray println 2022-06-02 17:32:43 -07:00
Max Brunsfeld
b70396b8fb Disconnect FakeServer when dropping it
This prevents memory leak errors in tests, due to parked tasks waiting
for RPC responses.
2022-06-02 17:32:43 -07:00
Max Brunsfeld
3ea061a11e Allow making projects private 2022-06-02 17:32:42 -07:00
Max Brunsfeld
8f676e76b3 Fix mismatched client/context in integration test 2022-06-02 17:29:11 -07:00
Max Brunsfeld
8d46edd26c Avoid holding RefCell borrow while calling TestAppContext::spawn callback 2022-06-02 17:29:11 -07:00
Max Brunsfeld
7ef9de32b1 Show private projects in the contacts panel
Introduce a ProjectStore that lets you iterate through all open projects.
Allow projects to be made public by clicking the lock.
2022-06-02 17:29:11 -07:00
Max Brunsfeld
a60fef52c4 Start work on private projects 2022-06-02 17:29:11 -07:00
Antonio Scandurra
7ecc67bcd5 Report the correct app version when sending panics to server
Previously, we were just relying on the `ZED_APP_VERSION` environment
variable without consulting `Platform::app_version`. That would always
report "dev" as the app version because `ZED_APP_VERSION` is only used
for testing.
2022-06-02 13:00:21 +02:00
Antonio Scandurra
a8cde09070 v0.36.1 2022-06-02 12:11:49 +02:00
Antonio Scandurra
6baf8b033b Don't reuse the same diagnostic group id across buffers
This lets us use the group id as the key for an `ElementState`, which
fixes a panic that would occur in project diagnostics when opening it
while there were multiple diagnostic groups with the same id.
2022-06-02 12:05:28 +02:00
Antonio Scandurra
12267308e4 Don't dismiss context menu when right-clicking project panel again 2022-06-02 10:00:52 +02:00
Antonio Scandurra
701e2090cd Align context menu to fit within the window bounds 2022-06-02 09:47:06 +02:00
Antonio Scandurra
f1964cf2a0
Merge pull request #1089 from zed-industries/jump-to-diagnostic
Jump to diagnostic
2022-06-02 09:35:57 +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
ba6be46e82 v0.36.0 2022-06-02 08:38:36 +02:00
Max Brunsfeld
b9dc476e74 Avoid sending unnecessary messages for local projects that aren't shared 2022-06-01 14:49:12 -07:00
Antonio Scandurra
0e1307fb23 📝 2022-06-01 10:18:10 +02:00
Antonio Scandurra
238827642a Align tooltip based on the available window space 2022-06-01 10:03:46 +02:00
Antonio Scandurra
b3242417b3 Show tooltip when hovering over jump to diagnostic icon 2022-06-01 09:55:45 +02:00
Antonio Scandurra
982de971fa Introduce a new Tooltip element and a with_tooltip helper 2022-06-01 09:55:25 +02:00
Antonio Scandurra
94fc28b29d WIP: start on tooltips 2022-05-31 19:00:44 +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
Antonio Scandurra
1ce8682b94 Clear language server and worktree statuses when unsharing on server 2022-05-31 11:22:41 +02:00
Antonio Scandurra
339069b1d3 Cap MessageStream buffer size to 1MB
We temporarily let it grow when the message size exceed the limit,
but restore the buffer's capacity shortly after. This ensures that,
for each connection in its entire lifetime, we only ever use 1MB.
2022-05-31 11:16:32 +02:00
Antonio Scandurra
da46d78ea5
Merge pull request #1081 from zed-industries/project-panel-with-new-mouse-events
Introduce context menu to project panel
2022-05-31 10:40:42 +02:00
Antonio Scandurra
34bf248614 Avoid notifying views that have been removed 2022-05-31 10:36:10 +02:00
Antonio Scandurra
e067212ad4 Always re-render visible elements in List 2022-05-31 09:52:44 +02:00
Antonio Scandurra
0fd47da880 Prevent mouse down events from piercing through overlays 2022-05-31 09:34:37 +02:00
Antonio Scandurra
e4641da598 Don't show "add/remove folder to/from project" for remote projects 2022-05-31 08:17:52 +02:00
Antonio Scandurra
1eb03f2f4e Bump protocol version 2022-05-31 08:13:05 +02:00
Antonio Scandurra
354488ebdf Don't eagerly populate copied subdirectory
This can race anyway with snapshot updates, so we just eagerly refresh
the root entry and wait for updates to come in to populate it.
2022-05-31 08:11:07 +02:00
Max Brunsfeld
365cda0fab Remove opentelemetry tracing subscriber
We'll see if this stops the server from leaking memory. We still
have spans in our logs.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-05-30 09:58:25 -07:00
Antonio Scandurra
06ab2ace72 Don't steal focus from context menu when dispatching an action 2022-05-30 18:36:36 +02:00
Antonio Scandurra
f832c0074f Fix memory leak in ListState 2022-05-30 18:29:51 +02:00
Antonio Scandurra
20e1044d49 Merge branch 'main' into project-panel-with-new-mouse-events 2022-05-30 18:29:46 +02:00
Antonio Scandurra
88fdd8606a Eagerly populate child entries when copying a directory via RPC 2022-05-30 18:01:46 +02:00
Antonio Scandurra
51adc6517e WIP: start on an integration test for copy_entry 2022-05-30 14:53:10 +02:00
Antonio Scandurra
3336bc6ab3 Implement copy paste for ProjectPanel 2022-05-30 14:52:34 +02:00
Antonio Scandurra
37a0c7f046 Implement cut/paste for ProjectPanel 2022-05-30 12:23:21 +02:00
Antonio Scandurra
6c145b2abc Show keystrokes as uppercase 2022-05-30 12:23:03 +02:00
Antonio Scandurra
63900612b0 Dismiss context menu when one of its action is dispatched 2022-05-30 10:05:21 +02:00
Antonio Scandurra
2b9015c096 Introduce {MutableAppContext,ViewContext}::observe_actions 2022-05-30 10:01:23 +02:00
Antonio Scandurra
e7ab61d125 Dismiss context menu when (right-)mousing down outside of it 2022-05-28 08:51:46 +02:00
Antonio Scandurra
fb26f8195b Sort mouse regions by their stacking context's depth 2022-05-28 08:45:10 +02:00
Max Brunsfeld
bc6f8da029 Move integration tests into their own file 2022-05-27 17:20:05 -07:00
Max Brunsfeld
8393ae88b7 Clean up integration tests
* Use 'build_local_project' helper to reduce boilerplate
* Peform the setup steps in a consistent order
2022-05-27 17:10:45 -07:00
Max Brunsfeld
1c932ae4ce Add help menu items to visit zed.dev and the zed twitter page 2022-05-27 13:18:00 -07:00
Max Brunsfeld
df4f3051bc Add app menu items for opening settings and keymap 2022-05-27 13:06:35 -07:00
Max Brunsfeld
e1a05d451f Add "Reset Zoom" action and application menu item 2022-05-27 13:06:12 -07:00
Nathan Sobo
44c8ee5709 Add mouse down out handlers
These will fire whenever the left/right mouse button is pressed down outside a specific region. I'll use these to cancel the context menu in the next commit.
2022-05-27 12:56:44 -06:00
Keith Simmons
4a5317b6e4 Remove unused context_menu file in rust crate 2022-05-27 11:32:15 -07:00
Keith Simmons
48abbb7e63
Merge pull request #1019 from zed-industries/vim-visual-line-mode
Vim visual line mode
2022-05-27 11:22:56 -07:00
Max Brunsfeld
b2adff63e7
Merge pull request #1073 from zed-industries/window-menu
Add a Window application menu
2022-05-27 11:22:13 -07:00
Nathan Sobo
9909fc529b Allow context menu to be cancelled after deploying it twice
Previously, two right clicks would cause an issue with cancelling the context menu via escape.
2022-05-27 12:00:11 -06:00
Nathan Sobo
c3baf2748f Block hovering behind overlays 2022-05-27 11:54:51 -06:00
Max Brunsfeld
23cd948b5f Adjust test to flush effects between splitting pane and following
Panes now emit an event when adding the first item, so we need to flush
effects between splitting and following in order to avoid accidentally
cancelling the follow.
2022-05-27 10:53:14 -07:00
Max Brunsfeld
a88b4eb3c5 Populate the window title whenever worktrees or active path change
* Refactor the way the project's active entry is assigned. Assign it
  together with the window title, as opposed to on every notification
  from a pane.
* Emit the ActiveItem event from panes consistently, even when adding
  the first item to an empty pane.
2022-05-27 10:51:14 -07:00
Max Brunsfeld
e6be151a64 Emit the WorktreeRemoved event when removing a worktree from a project 2022-05-27 10:49:10 -07:00
Max Brunsfeld
a1a4c70845 Emit an event when adding a worktree to a project 2022-05-27 10:48:47 -07:00
Max Brunsfeld
04bd57b2c7 Add an API for setting a window's title
This controls how the window appears in the Window menu.
2022-05-27 10:45:55 -07:00
Nathan Sobo
5413a97c7e Restrict multiple hovered regions to a single stacking context
We won't hover regions from stacking contexts that are below the one being hovered.
2022-05-27 11:09:07 -06:00
Antonio Scandurra
9099c40364 Merge branch 'mouse-events' into project-panel-context-menu 2022-05-27 12:07:00 +02:00
Antonio Scandurra
82d6e606fc Use a MouseEventHandler for activating tabs on mouse down
Previously, we were using an `EventHandler` which doesn't take into
account other mouse regions floating above the rendered element. This
was problematic because, when clicking the `x` icon on a tab that was
not active, we were first activating it and then closing it.
2022-05-27 11:43:58 +02:00
Antonio Scandurra
98de269b4a Don't focus editor when clicking on sidebar resize handle 2022-05-27 11:36:37 +02:00
Antonio Scandurra
be0e66ef21 Invoke mouse_down and right_mouse_down callbacks 2022-05-27 11:20:39 +02:00
Antonio Scandurra
7c7917494c Don't dispatch events down the tree if they were handled by mouse region 2022-05-27 11:20:32 +02:00
Antonio Scandurra
1d7fc12229 Add right-click support to MouseEventHandler 2022-05-27 10:47:54 +02:00
Antonio Scandurra
307eb1726c Compute dispatch path based on the view id that dispatched the action 2022-05-27 09:59:24 +02:00
Nathan Sobo
aedfd74d30 Use the hit bounds when painting mouse regions 2022-05-26 20:05:20 -06:00
Nathan Sobo
893f15ddab Switch MouseEventHandler to use MouseRegions
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-05-26 20:00:01 -06:00
Nathan Sobo
50edcb06dd Add drag callbacks to mouse regions
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-05-26 18:59:38 -06:00
Nathan Sobo
bd62a68234 Eliminate ElementStateContext trait
We now always have a RenderContext when rendering MouseEventHandlers or scrollable Flex columns/rows.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-05-26 18:37:28 -06:00
Nathan Sobo
b6b16fc9c3 In UniformList, guard against misbehavior of append_items
If for some reason the handle got dropped and we call it, we'll deal with it somewhat gracefully.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-05-26 18:30:28 -06:00
Nathan Sobo
8dd82fdce1 Take a RenderContext in ListState's build item callback
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-05-26 18:23:44 -06:00
Nathan Sobo
2ea085b178 Pass a RenderContext to UniformList
In some cases, we need to render during layout. Previously, we were rendering with a LayoutContext in some cases, but this commit adds the ability to retrieve a render context with a given handle and we use that feature in UniformList.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-05-26 18:03:34 -06:00
Keith Simmons
8e7c6871db Track selection changes in mutable selections collection 2022-05-26 17:02:05 -07:00
Max Brunsfeld
42cd2ae142 Avoid switching to visual mode when following in vim mode
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-05-26 17:02:05 -07:00
Max Brunsfeld
c53412efcb Bump protocol version 2022-05-26 17:02:05 -07:00
Keith Simmons
d11bc2a4b7 Fixup paste locations 2022-05-26 17:02:05 -07:00
Keith Simmons
e104cb94e7 fix bug in marked_range utils 2022-05-26 17:02:05 -07:00
Keith Simmons
98f9575653 WIP 2022-05-26 17:02:05 -07:00
Keith Simmons
e93c49f4f0 Unify visual line_mode and non line_mode operators 2022-05-26 17:02:05 -07:00
Keith Simmons
11569a869a in progress working on aborting operators on unhandled editor input 2022-05-26 17:02:05 -07:00
Keith Simmons
61f0daa5c5 Visual line mode handles soft wraps 2022-05-26 17:02:05 -07:00
Keith Simmons
33940b5dd9 Add visual line mode operator tests 2022-05-26 17:02:05 -07:00
Keith Simmons
082036161f Enable copy and paste in vim mode 2022-05-26 17:02:05 -07:00
Keith Simmons
d094d1d891 WIP copy on delete 2022-05-26 17:02:05 -07:00
Keith Simmons
f8f316cc64 Working change and delete in line mode 2022-05-26 17:02:05 -07:00
Keith Simmons
d7d17b2148 WIP line mode operations 2022-05-26 17:02:05 -07:00
Keith Simmons
125d83b3ec Fix failing seed bin build and add bin builds to ci pipeline 2022-05-26 15:41:24 -07:00
Nathan Sobo
d69776585d Add mouse_state method to RenderContext
We can use this to determine if a region is hovered or clicked.
2022-05-26 13:22:23 -06:00
Nathan Sobo
3a59d2a331 Allow hovered and clicked mouse regions to be tracked in the presenter 2022-05-26 12:44:52 -06:00
Nathan Sobo
0866f0ed55 Introduce CursorRegion struct
This will blend in with an upcoming MouseRegion struct that sits next to it in the scene.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-05-26 11:00:10 -06:00
Antonio Scandurra
eedb29963c Implement CopyPath 2022-05-26 16:45:41 +02:00
Antonio Scandurra
5b2d6e41f3 Introduce keyboard navigation in context menus 2022-05-26 16:36:30 +02:00
Antonio Scandurra
991eb742b0 Start adding project panel context menu actions 2022-05-26 15:23:40 +02:00
Antonio Scandurra
82ddac8e7e Restore focus when closing context menu 2022-05-26 15:21:55 +02:00
Antonio Scandurra
a5044ccbba WIP 2022-05-26 11:17:10 +02:00
Antonio Scandurra
580f1a4125 Style context menu 2022-05-26 10:40:53 +02:00
Nathan Sobo
c0aafac387 Put keystrokes in their own column
This requires rendering the menu for measurement in a totally different way, where the top level is a flex row. We don't want to render the menu like this for presentation because of hovers / highlights on individual items needing to include the keystrokes.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-05-26 09:59:25 +02:00
Antonio Scandurra
a8483ba458 WIP 2022-05-26 09:59:25 +02:00
Antonio Scandurra
85ed7b41f1 Select right-clicked entry before deploying context menu
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-05-26 09:59:25 +02:00
Antonio Scandurra
3b2f1644fb Constrain context menu to the width of the widest item
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-05-26 09:59:25 +02:00
Antonio Scandurra
f403d87eff WIP 2022-05-26 09:59:25 +02:00
Nathan Sobo
dcee8439b6 Start on context_menu crate 2022-05-26 09:59:25 +02:00
Nathan Sobo
b428d0de38 Break context menu items out in theme 2022-05-26 09:59:25 +02:00
Nathan Sobo
6b96822c1a Fix editor tests 2022-05-26 09:59:25 +02:00
Nathan Sobo
5b7825d5de Add MutableAppContext::keystrokes_for_action
This can be used to lookup keystrokes that will dispatch an action based on the currently focused view. There might be multiple, but we return the first found, meaning the most recently added bindings matching that action for the closest view to the focused view in the hierarchy.
2022-05-26 09:59:25 +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