Commit Graph

7636 Commits

Author SHA1 Message Date
Julia
3e136943c0
After first panic, ignore others and tear down process even if in thread (#2725)
Spent a bit in a deep dive into how to handle this and honestly the
situation is rather unfortunate. The core problem is that when we have a
panic anywhere we need to tear down the app, and we'd like to do that as
cleanly as possible, avoiding throwing any other panics along the way if
possible.

We've been seeing a number of panics being reported which are
nonsensical, seemingly pointing to being a fallout panic from a worker
thread panic-ing, at which point we would write multiple panics to the
panic file, and we could possibly upload either both or the wrong panic
causing a wild goose chase. Unfortunately I've been entirely unable to
reproduce the specific panic we've been seeing but I was able to read
through the code responsible and confirm that under specific situations
a panic on one worker can cause another worker or the main thread to
also panic.

An easy solution to this is just to ignore any panics after the first
one. I'm thinking that *hopefully* we can trust the first panic to reach
the panic hook first so that the flag doesn't accidentally filter out
the panic we actually care about.

That being said we were expecting that to have already been the case
about which panic gets written to the panic file first, the first one in
the file being the one we upload, which doesn't seem to have been the
case. I'm hoping it was IO silliness causing that and that the flag
shouldn't be race-y, however this is still a shot in the dark. 🤞

As for cleanly shutting down, there's not really much we can do. One
thread physically cannot cause another to unwind without somehow sending
a message which isn't super useful. The only way for a thread to shut
down all threads and the process is to go nuclear and abort/exit the
process. This will never unwind other threads, effectively having the
same effect on those threads as compiling with `panic = "abort"` would.

With some (mis)use of `std::panic::resume_unwind` we can at least say
that for whatever thread actually panic-ed we will unwind, and any other
threads that panic as a result will probably get at least partway
through unwinding. This is weird, almost a combination of panic
rewinding and aborting, and may actually be worse than just biting the
bullet and aborting immediately.

I'm really not a fan of where I've ended up but it does seem to at the
very least an improvement. The main question in my mind at this point is
whether it would be better to attempt to unwind what we can or go all in
on abort. I'd love some input on that.

Release Notes:
- Improved panic reporting when a background thread panics.
2023-07-17 13:52:33 -04:00
Julia
6770aeeb3c After first panic, ignore others and tear down process even if in thread 2023-07-17 13:43:43 -04:00
Kirill Bulatov
a4bf19c5bd Simplify NoAction filtering logic
co-authored-by: Max Brunsfeld <max@zed.dev>
2023-07-17 20:42:35 +03:00
Kirill Bulatov
4cc06748c9 Ignore keybindings with NoAction in config overrides 2023-07-17 18:34:39 +03:00
Conrad Irwin
f887a17ffe Merge branch 'main' into vim-search 2023-07-17 09:27:02 -06:00
KCaverly
cf0dd09b5c update vector_store to accomodate for full file parsing for JSON, TOML and YAML files 2023-07-17 10:04:32 -04:00
KCaverly
4bece54655 update jsx family of languages for preceeding comments and nested exports 2023-07-17 09:22:37 -04:00
Piotr Osiewicz
dd6b674e7e Remove dbg calls 2023-07-17 13:08:41 +02:00
Piotr Osiewicz
8642a1d074 Remove dbg! calls 2023-07-17 13:03:57 +02:00
Piotr Osiewicz
ee9123a7da Remove test 2023-07-17 12:56:25 +02:00
Piotr Osiewicz
5b6582a7c2 rustfmt 2023-07-17 12:51:00 +02:00
Piotr Osiewicz
6c7a6d43fc Cargo fix 2023-07-17 12:38:35 +02:00
Piotr Osiewicz
94796e943b Set language id for PHP. LSP works! 2023-07-17 12:36:08 +02:00
Piotr Osiewicz
11173b2199 Merge branch 'main' into piotr/z-2588-php 2023-07-17 11:47:08 +02:00
Piotr Osiewicz
dc557e1647 Add scaffolding of php language server 2023-07-17 11:43:32 +02:00
Kirill Bulatov
f5eac82e81 Reload menu after keybindings change 2023-07-17 12:30:42 +03:00
Kirill Bulatov
eaa8224076 Use id instead of type_id for actions
Currently, both are the same thing, so the logic is not changed.
2023-07-17 12:24:56 +03:00
Mikayla Maki
322ebc33d1
Simplify db tests 2023-07-14 16:09:02 -07:00
Joseph T. Lyons
c3e8ea304a Require only a single click to split pane when using cmd in project panel 2023-07-14 18:27:40 -04:00
Max Brunsfeld
dcc2cd8dff
Optimize two slow code paths (#2728)
Linear:
https://linear.app/zed-industries/issue/Z-2578/zed-launches-very-slow-for-user

I was searching for the cause of a slow startup time reported in the
above issue, and I don't think I found it, but I did find two very
noticeable slow code paths while profiling, and fixed them.

###  Notes

1. When starting the JSON language server, we provide it with a JSON
schema for our settings. For the `theme` setting, the JSON schema needs
to read all of the themes in the registry, to generate a list of valid
theme names. Previously, as part of this, we were deserializing each
theme from JSON, which took a lot of CPU. Now, we don't do that.
2. When an FS event occurs within a git repository, we reload the git
status for all entries in that git repository. Previously, we did that
via a separate `libgit2` call per FS entry (including ignored entries,
so many thousands in the case of the `zed` repo). Now we do one
`libgit2` call, asking for all of the statuses. Git carries an index of
all of the files with statuses, so this is fast.

Release Notes:

- Improved the the performance of starting up a  JSON language server.
- Improved the performance of handling changes to git repositories, such
as changing branches or committing.
2023-07-14 14:38:55 -07:00
Max Brunsfeld
b9e0074793 Perform only one git statuses call when reloading a git repo after it changes 2023-07-14 14:29:22 -07:00
Max Brunsfeld
c69d0d50cd Avoid deserializing all themes to compute settings JSON schema 2023-07-14 14:29:22 -07:00
Alex Viscreanu
c0b2326053
fix(flexes): reset flexes when collapsing axis
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2023-07-14 21:49:33 +02:00
Alex Viscreanu
c7669317ec
feat(workspace): allow alternative actions to open files and symbols in split
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2023-07-14 21:49:15 +02:00
Piotr Osiewicz
369ccc725c
branch_list: Bail in case of missing worktrees. (#2726)
Z-2632

Release Notes:
- Fixed a crash that occurred when opening a modal branch picker without
a corktree.
2023-07-14 21:41:11 +02:00
Kirill Bulatov
cde5b3952d
Select all matches (#2717)
Closes https://github.com/zed-industries/community/issues/75
Closes https://github.com/zed-industries/community/issues/1749

The PR 

* changes keybindings for `Editor && mode == auto_height` context:
before, `alt-enter` and `alt-shift-enter` added new lines in such
editors, including the one from buffer search.

New bindings are the same as in `Editor && mode == full` context.

* adds `search::SelectAllMatches` action and binds it to `Alt + Enter`
by default, to select all matches of a buffer search

The behavior mimics VSCode: we do not move the screen even if all
selections are out of the visible range (Cmd+G will navigate there) and
allow reselecting the results from both pane and search field, as long
as the search is not dismissed.

Release Notes:

- Added `search::SelectAllMatches` (`Alt + Enter` default) action to
place carets and select all buffer search results
([#75](https://github.com/zed-industries/community/issues/75),
[#1749](https://github.com/zed-industries/community/issues/1749)).
2023-07-14 21:37:04 +03:00
KCaverly
2dae42b1ba update embedding query for tsx to accomodate for leading comments 2023-07-14 14:25:08 -04:00
KCaverly
d4971e9ead update typescript parsing to manage for leading tsdoc comments 2023-07-14 13:47:10 -04:00
Piotr Osiewicz
c6195e6176 branch_list: Bail in case of missing worktrees.
Z-2632
2023-07-14 19:33:27 +02:00
Max Brunsfeld
0f5489397f
Fix syntax map issues that caused bugs in editing HEEx (#2723)
Fixes [Z-2575 : HEEX files are using deprecated commenting
sytle](https://linear.app/zed-industries/issue/Z-2575/heex-files-are-using-deprecated-commenting-sytle)

- Fixed a bug where comment toggling and bracket matching used the wrong
characters in templating languages like ERB and HEEx
([#1724](https://github.com/zed-industries/community/issues/1724)).
- Fixed a bug where interpolated code was sometimes not parsed correctly
within templating languages like ERB and HEEx.
2023-07-14 10:23:25 -07:00
Piotr Osiewicz
c466711cd1
branch_list: Ensure index is within list bounds. (#2724)
Z-2630


Release Notes:
- Fixed a crash in branch list that occurred when confirming a match in
empty list.
2023-07-14 19:11:24 +02:00
Piotr Osiewicz
9c150252aa branch_list: Ensure index is within list bounds.
Z-2630
2023-07-14 19:00:14 +02:00
Max Brunsfeld
31720d8825 Add randomized syntax map test with elixir within heex within elixir 2023-07-14 09:58:34 -07:00
Max Brunsfeld
21e7e35e73 Include newlines in between combined injection ranges on different lines 2023-07-14 09:25:56 -07:00
Max Brunsfeld
2f2ef7c165 Use workspace dependencies for tree-sitter grammars 2023-07-14 09:25:51 -07:00
Max Brunsfeld
2e2333107a Find the layer with the smallest enclosing node in language_scope_at 2023-07-14 09:11:56 -07:00
KCaverly
3a625d15d3 update c embedding query for preceding comments 2023-07-14 11:33:49 -04:00
Kirill Bulatov
b14cd5f56d Add a new button for the action 2023-07-14 17:32:10 +03:00
Kirill Bulatov
ccc78000bd Preserve serach index for multicaret selection editor events 2023-07-14 14:47:12 +03:00
Kirill Bulatov
f710efca3b Use a better name 2023-07-14 14:47:12 +03:00
Kirill Bulatov
29cbeb39bd Allow selecting all search matches in buffer 2023-07-14 14:47:12 +03:00
Mikayla Maki
f1b034d4f8
fmt 2023-07-13 22:32:29 -07:00
Mikayla Maki
ff8a89a075
Refine svelte queries to work with zed-style highlights
Bump scheme dependency:
2023-07-13 22:30:58 -07:00
Mikayla Maki
1424a7a56a
Add svelte language server
Add svelte tree sitter
Add svelte config file
Add svelte highlighting
2023-07-13 21:43:53 -07:00
Mikayla Maki
77c4fc98bd
Add line height settings for the editor 2023-07-13 16:14:33 -07:00
Mikayla Maki
b7ed467690
WIP: Resizing splits (#2715)
We're finally doing the thing. 


TODO:
- [x] Choose an approach 
- Decided to add a new element just for the pane axis, containing a
slimmed down copy of the flex code.
- [x] Wire through callbacks and pointers so that data goes where it
needs to
- [x] Do the flex juggling math on resize
- [x] Update the flexes when updating the split tree
- [x] Restore the active_pane_magnification setting
- [x] Serialize an axis' flexes

Release Notes:
- Made the center pane group splits resizable. Note that resizing is
disabled if the `active_pane_magnification` setting is changed from
default.
2023-07-13 15:29:34 -07:00
KCaverly
b38e3b804c remove reindexing subscription, and add status methods for vector store
Co-authored-by: maxbrunsfeld <max@zed.dev>
2023-07-13 18:14:44 -04:00
Mikayla Maki
50623c018c
Fix serialization error 2023-07-13 14:48:56 -07:00
Mikayla Maki
9da8f609cf
tidy up names 2023-07-13 14:34:32 -07:00
Mikayla Maki
331fd896b5
fmt 2023-07-13 14:21:30 -07:00
Mikayla Maki
5797282b98
Add resising serialization 2023-07-13 14:21:14 -07:00
KCaverly
d8fd0be598 update vector store to remove dummy embeddings 2023-07-13 17:01:56 -04:00
KCaverly
623cb9833c add tests for rust context parsing, and update rust embedding query
Co-authored-by: maxbrunsfeld <max@zed.dev>
2023-07-13 16:58:42 -04:00
KCaverly
0a0e40fb24 refactored code context retrieval and standardized database migration
Co-authored-by: maxbrunsfeld <max@zed.dev>
2023-07-13 16:34:32 -04:00
Mikayla Maki
00b04f1c85
Restore active pane magnification 2023-07-13 13:10:36 -07:00
KCaverly
5eab628580 Added go parsing for semantic search, and added preceeding comments on go and rust.
Co-authored-by: Alex <alexviscreanu@gmail.com>
Co-authored-by: maxbrunsfeld <max@zed.dev>
2023-07-13 14:33:31 -04:00
Mikayla Maki
d5f7ad08fa
Styled and refined behavior for split resizing 2023-07-13 11:28:21 -07:00
Nate Butler
ef7aa66959 Add first line pattern 2023-07-13 12:09:43 -04:00
Nate Butler
9a1a9813cb WIP 2023-07-13 11:56:53 -04:00
KCaverly
a56d454a07 added semantic search support for c 2023-07-13 10:10:24 -04:00
Piotr Osiewicz
608c16342c Update outline queries; add enum as a highlighted keyword 2023-07-13 12:23:49 +02:00
Mikayla Maki
26b9be628e
Add the math for pane resizing 2023-07-12 22:35:51 -07:00
Mikayla Maki
5385ca411b
Added the new elements and wired through the pointers to update the pane axis ratios 2023-07-12 17:53:01 -07:00
Joseph T. Lyons
6da5008f32 Fix screen sharing panic introduced by call events
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2023-07-12 16:12:07 -04:00
Mikayla Maki
488b41826b
WIP 2023-07-12 12:46:56 -07:00
Kirill Bulatov
d164034198
Allow all completions with preresolved additional text edits (#2711)
Deals with https://github.com/zed-industries/community/issues/752
Deals with https://github.com/zed-industries/community/issues/566

Currently, when converting from LSP to Zed objects, completions with
non-empty `additional_text_edits` are filtered out.
Later, all other completions form a list and the selected one gets the
`Editor::confirm_completion` call, which always queries an LSP
completion resolve request to get the `additional_text_edits` field.

Otherwise, `additional_text_edits` field is ignored entirely for the
rest of the completion lifetime — and we always pass the selected
completion through the resolve request.

The PR changes the logic, removing the `additional_text_edits` filtering
and instead of resolving every completion, now we check for
`additional_text_edits` in the completion before resolving: resolve
happens only if the data is absent.

Generally, feels like resolve has to happen before the completion
selection: LSP servers may send us markdown for completion documentation
preview pop ups and similar extra info.
Also, the server may lack resolve capabilities entirely, always sending
the request seems dangerous.
For now, the PR does not attempt to change either.

Release Notes:

- Brings rust-analyzer's postfix completions and others completions with
preresolved additional text edits
2023-07-12 22:10:18 +03:00
Kirill Bulatov
0c7949bdee Force resolve all completions, to ensure their edits are up-to-date
co-authored-by: Max Brunsfeld <max@zed.dev>
2023-07-12 21:10:01 +03:00
Piotr Osiewicz
1cc8ecad12 Fix HTML injections (Thanks Max!)
Co-authored-by: Max <max@zed.dev>
2023-07-12 19:33:09 +02:00
Joseph T. Lyons
af9506b21d v0.96.x dev 2023-07-12 13:30:28 -04:00
Kirill Bulatov
c732aa1617 Do not resolve completions if extra edits are available 2023-07-12 20:28:16 +03:00
KCaverly
c141519dba merged with main 2023-07-12 13:15:23 -04:00
Piotr Osiewicz
e69240cf13
Piotr/z 2556 add create branch button (#2696)
Release Notes:

- N/A
2023-07-12 18:46:33 +02:00
Nate Butler
001e848393 Update picker footer button style
Co-Authored-By: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2023-07-12 12:40:37 -04:00
Piotr Osiewicz
2ac485a6ec Merge branch 'main' into piotr/z-2556-add-create-branch-button 2023-07-12 18:11:52 +02:00
Piotr Osiewicz
6260d977fb Increase trailoff limit for modal branch picker.
Z-2601
2023-07-12 17:58:00 +02:00
Kirill Bulatov
6d96c6ef51 Draft the postfix completions support 2023-07-12 18:32:03 +03:00
Piotr Osiewicz
b9f5cb0301
recent_projects: Perform fuzzy search on compacted paths. (#2703)
Match highlighting for recent projects picker was off, because the path
representation was compacted - for a path '/Users/hiro/Projects/zed' we
compact it to use a tilde instead of home directory. However, the
highlight positions were always calculated for a full path, leading to a
mismatch in highlights. This commit addresses this by running fuzzy
search on compacted paths instead of using long paths. This might lead
to a slight performance hit, but given that recent projects modal
shouldn't have that many items in the first place, it should be okay.

Z-2546

Release Notes:

- Fixed result highlighting in "Recent projects" modal.
2023-07-12 11:47:28 +02:00
KCaverly
33e2b52a01 added test registration for project settings 2023-07-11 20:12:43 -04:00
KCaverly
297fa029e3 Merge branch 'main' of github.com:zed-industries/zed into vector_store 2023-07-11 20:05:29 -04:00
KCaverly
b68cd58a3b updated vector store settings to remove batch embeddings size 2023-07-11 19:54:03 -04:00
Max Brunsfeld
4b3bb2c661 Define semantic search action regardless of whether the feature is enabled 2023-07-11 15:02:43 -07:00
Max Brunsfeld
4a4dd39875 Fix TSX embedding query 2023-07-11 15:02:19 -07:00
Max Brunsfeld
d244c0fcea Get vector store test passing - wait for indexing
Co-authored-by: Kyle <kyle@zed.dev>
2023-07-11 14:30:11 -07:00
Max Brunsfeld
badf94b097 Update dot product test to use larger vectors
Co-authored-by: Kyle <kyle@zed.dev>
2023-07-11 14:29:48 -07:00
KCaverly
af7b2f17ae added initial keymap for toggle semantic search
Co-authored-by: maxbrunsfeld <max@zed.dev>
2023-07-11 17:13:58 -04:00
KCaverly
2ca4b3f4cc cleaned up warnings and added javascript 2023-07-11 16:41:08 -04:00
KCaverly
debe6f107e updated embedding queries for tsx and typescript 2023-07-11 16:22:40 -04:00
KCaverly
02f523094b expanded embeddable context to accomodate for struct context and file paths 2023-07-11 15:58:33 -04:00
Mikayla Maki
9165320390
Fix a bug where the terminal would not be closed by the terminal exiting (#2706)
Release Notes:

- Fixed a bug where terminal tabs in the panel would not close on tty
process exit.
2023-07-11 12:23:26 -07:00
Mikayla Maki
550aa2d6bd
fmt 2023-07-11 12:17:50 -07:00
Mikayla Maki
be881369fa
Fix a bug where the terminal panel's items wouldn't be hooked up properly to workspace actions 2023-07-11 12:12:37 -07:00
Kirill Bulatov
5483bd1404
Refactor LSP restart logic (#2705)
Instead of storing `initialization_options` in every LSP adapter as
before, store previous LSP settings in `Project` entirely.

This way, we can later have use multiple different project
configurations per single LSP with its associated adapter.

Release Notes:

- N/A
2023-07-11 22:09:40 +03:00
Kirill Bulatov
4b4d049b0a Refactor LSP restart logic
Instead of storing `initialization_options` in every LSP adapter as
before, store previous LSP settings in `Project` entirely.

This way, we can later have use multiple different project
configurations per single LSP with its associated adapter.

co-authored-by: Max Brunsfeld <max@zed.dev>
2023-07-11 21:56:55 +03:00
KCaverly
dd0dbdc5bd brought up to speed with main 2023-07-11 14:50:48 -04:00
KCaverly
1649cf81de added versioning to files table 2023-07-11 14:42:03 -04:00
Joseph T. Lyons
98a0113ac3 Add call events
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2023-07-11 13:58:55 -04:00
Kirill Bulatov
efe8b8b6d0 Revert "Fix language servers improper restarts"
This reverts commit 91832c8cd8.
2023-07-11 20:46:45 +03:00
KCaverly
298c2213a0 added opt-in default settings for vector store 2023-07-11 12:03:56 -04:00
Kirill Bulatov
748e7af5a2 Add a test 2023-07-11 17:10:34 +03:00
KCaverly
f5fec55930 updated vector_store to handle for removed files 2023-07-11 10:03:53 -04:00
Kirill Bulatov
91832c8cd8 Fix language servers improper restarts
Language servers mixed `initialization_options` from hardcodes and user
settings, fix that to ensure we restart servers on their settings
changes only.
2023-07-11 16:36:20 +03:00
Piotr Osiewicz
15010e94fd fixup! recent_projects: Perform fuzzy search on compacted paths. 2023-07-11 15:29:15 +02:00
Piotr Osiewicz
f164eb5289 recent_projects: Perform fuzzy search on compacted paths.
Match highlighting for recent projects picker was off, because the path representation was compacted - for a path '/Users/hiro/Projects/zed' we compact it to use a tilde instead of home directory. However, the highlight positions were always calculated for a full path, leading to a mismatch in highlights.
This commit addresses this by running fuzzy search on compacted paths instead of using long paths. This might lead to a slight performance hit, but given that recent projects modal shouldn't have that many items in the first place, it should be okay.

Z-2546
2023-07-11 15:23:17 +02:00
Piotr Osiewicz
1fbf09fe4c
branches: Add a modal branch list. (#2697)
Extract branch list into a separate vcs_menu crate akin to
recent_projects. Add current bind for a modal branch to branch popover's
tooltip.

Z-2555

Release Notes:
- N/A
2023-07-11 14:40:00 +02:00
Piotr Osiewicz
a1fe5abeaf Add rudimentary PHP syntax highlighting 2023-07-11 12:31:20 +02:00
Piotr Osiewicz
3c1ab3d0b8
Piotr/z 2590 search result marks jump around in scrollbar as cursor (#2700)
This closes ticket Z-2590 reported by @JosephTLyons . Thanks Joseph =)
Release Notes:

- N/A
2023-07-11 09:40:00 +02:00
Piotr Osiewicz
e83afdc5ab Rename background_highlights_in_range_for_key to background_highlights_in_range_for 2023-07-11 09:31:08 +02:00
Piotr Osiewicz
4f60679861 Highlight only search results 2023-07-11 09:28:34 +02:00
KCaverly
dce72a1ce7 updated tests to accomodate for new dot location 2023-07-10 18:19:29 -04:00
KCaverly
307d8d9c8d Reduced redundant database connections on each worktree change.
Co-authored-by: maxbrunsfeld <max@zed.dev>
2023-07-10 17:50:19 -04:00
KCaverly
82079dd422 Updated batching to accomodate for full flushes, and cleaned up reindexing.
Co-authored-by: maxbrunsfeld <max@zed.dev>
2023-07-10 16:33:14 -04:00
Piotr Osiewicz
a6d713eb3d editor: Keep scrollbar up if there are selections
Z-2556
2023-07-10 17:44:27 +02:00
Piotr Osiewicz
e00e73f608 branches: Add a modal branch list.
Extract branch list into a separate vcs_menu crate akin to recent_projects.
Add current bind for a modal branch to branch popover's tooltip.

Z-2555
2023-07-10 17:18:12 +02:00
Nate Butler
6739c31594
Update assistant styles (#2665)
Updates the assistant with some style quality of life changes.

## Changes

Restyled the conversation list

<img width="646" alt="CleanShot 2023-07-10 at 10 25 23@2x"
src="https://github.com/zed-industries/zed/assets/1714999/5c9a4f94-11c1-4d28-8aac-4d38141829a9">

Updated the assistant header to be a bit more compact, and use a new tab
bar icon style. The existing tab bar icons will be updated in a later
PR.

<img width="646" alt="CleanShot 2023-07-10 at 10 26 30@2x"
src="https://github.com/zed-industries/zed/assets/1714999/3ef9a053-59fa-4d34-9b76-3bb2701acb33">

Updated the remaining token indicator to have 3 steps:
<img width="662" alt="CleanShot 2023-07-10 at 10 29 51@2x"
src="https://github.com/zed-industries/zed/assets/1714999/13d31545-5b00-427c-b7da-b4dfeac037d6">

Updated role labels, added a hover state to make it more clear these are
interactive
<img width="984" alt="CleanShot 2023-07-10 at 10 32 28@2x"
src="https://github.com/zed-industries/zed/assets/1714999/24748495-dde4-4ee9-98f1-6a082f0c1d4d">


Release Notes:

- Improved the UI of some elements in the Assistant panel.
2023-07-10 10:54:20 -04:00
Piotr Osiewicz
a75a7e2b1d
Add tooltip to recent projects button (#2694)
Z-2545

Release Notes:

- N/A
2023-07-10 16:53:50 +02:00
Piotr Osiewicz
92a0a4e367 Add styles for branch create button 2023-07-10 16:51:18 +02:00
Nate Butler
4029481fd0 Merge branch 'main' into update-assistant-styles 2023-07-10 10:22:18 -04:00
KCaverly
0189742497 pulled treesitter parsing to own file for ease of testing and management 2023-07-10 10:06:07 -04:00
Piotr Osiewicz
3318896ad9 Display key bind of a modal project picker 2023-07-10 14:29:30 +02:00
Piotr Osiewicz
6c8cb6b2a9 project_search: display result count on cmd-enter
It also focuses the first result (just like a normal enter).
2023-07-10 14:21:55 +02:00
Piotr Osiewicz
6e24ded2bc
collab_ui: Add tooltip to branches popover (#2695)
Z-2554

Release Notes:

- N/A
2023-07-10 14:20:12 +02:00
Conrad Irwin
b4b0f622de Rebuild vim search experience on refactored code 2023-07-07 15:57:54 -06:00
Conrad Irwin
232d14a3ae Make search less magic
Co-Authored-By: Antonio <antonio@zed.dev>
2023-07-07 15:57:54 -06:00
Conrad Irwin
dea728a7e5 Better waiting in tests 2023-07-07 15:57:54 -06:00
Conrad Irwin
6cf13c62d1 vim: ? to search backwards, and /<enter> to repeat search 2023-07-07 15:57:52 -06:00
Conrad Irwin
dbec2ed1f1 vim: add */#/g*/g# for jumping to next word
As in vim, this toggles the normal search experience.
2023-07-07 15:57:35 -06:00
Conrad Irwin
96ce0bb783 vim: Enter/n/N to navigate search results 2023-07-07 15:57:14 -06:00
Conrad Irwin
2ffce24ef0 vim: Don't enter visual mode in search/go to definition
Fixes: zed-industries/community#1514
Contributes: zed-industries/community#1284
2023-07-07 15:56:37 -06:00
Conrad Irwin
75fe77c11d search: Allow running a search with different options
Refactor search options to use bitflags so that we can represent
the entire set of settings in one place.
2023-07-07 15:56:37 -06:00
Conrad Irwin
20d8a2a1ec vim: indent in visual mode uses only one <
Fixes: zed-industries/community#1562
2023-07-07 15:56:35 -06:00
Conrad Irwin
460bf93866
vim: { } to navigate by paragraph (#2668)
As part of this I added `assert_shared_state()` to the
NeovimBackedTestContext so that it is more like a drop-in replacement
for the VimTestContext.

The remaining part of zed-industries/community#682 is adding bracket
matching to plain text. It looks like the current logic requires there
to be a tree sitter language for the language in order to support
bracket matching. I didn't fix this in this PR because I was unsure
whether to try and work around that, or to try and add a plain text tree
sitter language.

Release Notes:

- vim: support `{` and `}` for paragraph motion
([#470](https://github.com/zed-industries/community/issues/470)).
- vim: fix `%` at the end of the line
([#682](https://github.com/zed-industries/community/issues/682)).
2023-07-07 14:59:06 -06:00
Conrad Irwin
362023ccf2
vim: keymap tweaks (#2674)
A few small tweaks to fix some of the community issues

Release Notes:

- vim: Fix `escape` in command palette
([#1347](https://github.com/zed-industries/community/issues/1347)).
- vim: Allow `^` as a motion in actions
([#856](https://github.com/zed-industries/community/issues/856)).
- vim: Allow `ctrl-c` to exit visual mode
([#1447](https://github.com/zed-industries/community/issues/1447)).
2023-07-07 14:58:01 -06:00
KCaverly
3f5667b101 merged main 2023-07-07 14:24:29 -04:00
Julia
caa29d57c2 Avoid checking for duplicate instance when local DB is disabled 2023-07-07 14:20:39 -04:00
Julia
b70b76029e Use different port and handshake for different release channels 2023-07-07 14:20:39 -04:00
Julia
66bf56fc4f Prevent duplicate instances by coordinating via a socket 2023-07-07 14:19:44 -04:00
Piotr Osiewicz
4a69c71167 fixup! vcs: Add 'create branch' button 2023-07-07 18:37:53 +02:00
Piotr Osiewicz
cb24cb1ea5 vcs: Add 'create branch' button 2023-07-07 18:36:55 +02:00
Piotr Osiewicz
d69b07bafd Add tooltip to recent projects button
Z-2545
2023-07-07 16:30:19 +02:00
Piotr Osiewicz
abf3b4a54e
chore: Replace lazy_static Mutex with const. (#2693)
Mutex::new() is const-stable as of Rust 1.63.

Release Notes:
- N/A
2023-07-07 15:07:12 +02:00
Antonio Scandurra
318deed25b Skip key down event if preceded by its key equivalent version
Previously, we would only track whether the previous key down event
was a key equivalent. However, this could cause issues when pressing
certain keystrokes in rapid succession, e.g.:

- Pressing `shift-right` (to select a character)
- Pressing a character (with or without `shift` held down)

This would cause GPUI to ignore the second event because it was
preceded by a key equivalent event. With this commit, we track the
last key equivalent event, and skip the key down event only if it
matches the last key equivalent event.
2023-07-07 12:02:08 +02:00
KCaverly
c03dda1a0c fixed bug on absolute vs relative path 2023-07-06 17:15:41 -04:00
KCaverly
6f1e988cb9 updated embedding treesitter query for python 2023-07-06 16:36:28 -04:00
KCaverly
7d634f66e2 updated vector_store to include extra context for semantic search modal 2023-07-06 16:33:54 -04:00
Kirill Bulatov
e6ec0af743 Remove redundant hint kind checks in tests 2023-07-06 23:27:25 +03:00
Kirill Bulatov
fff65968bf Restart LSP server on initialization options change 2023-07-06 23:27:22 +03:00
KCaverly
e57f6f21fe reindexing update to appropriately accomodate for buffer delay and persistent pending files list 2023-07-06 15:26:43 -04:00
Piotr Osiewicz
3ca0170264
Z 1332/show search results in scrollbar (#2687)
This PR adds highlighting of search results to the scrollbar.

Release Notes:

- Added highlighting of search results to the scrollbar.
2023-07-06 19:28:21 +02:00
KCaverly
a86b6c42c7 corrected batching order and managed for open ai embedding errors 2023-07-06 11:11:39 -04:00
Antonio Scandurra
b4ed0347b4
Filter out non-json files when loading conversations (#2688)
Fixes
https://linear.app/zed-industries/issue/Z-2540/filter-out-non-conversation-files-from-the-assistant-history
2023-07-06 16:51:52 +02:00
Kirill Bulatov
11ae99fbd6 Add a test 2023-07-06 17:16:34 +03:00
Antonio Scandurra
708852aa00 Clip left when finding preceding (line) boundary
This fixes an issue that was causing `alt-left` to not move the cursor
when it was located right after an inlay hint with a `Left` bias.
2023-07-06 16:25:27 +03:00
Antonio Scandurra
5408275c7a Filter out non-json files when loading conversations 2023-07-06 14:38:05 +02:00
Piotr Osiewicz
3e245fec90 Save a flushing line instead of discarding it 2023-07-06 13:52:03 +02:00
Piotr Osiewicz
5e7d9dc718 Add hunk merging 2023-07-06 13:31:45 +02:00
Piotr Osiewicz
b66453e771 fixup! Do not render multiple hunks for the same line 2023-07-06 12:11:08 +02:00
Kirill Bulatov
0b0a161626 Show inlay hints on startup for every language server with work events
Language servers such as typescript-language-servers report a single
work event, ending right after server's startup.

Other servers might send more similar event, also during startup.
The rest of the events are diagnostic-related and we filter them out.

React on such events with /refresh-like hint update, that will check
only the visible part of the editor for hints and might be replaced by
other /refresh requests, if needed.
2023-07-06 13:10:59 +03:00
Piotr Osiewicz
492b849ea1 Do not render multiple hunks for the same line 2023-07-06 12:09:33 +02:00
Piotr Osiewicz
8ced7ab00a Merge branch 'main' into Z-1292/show_search_results_in_scrollbar 2023-07-06 11:43:44 +02:00
Kirill Bulatov
c298cf7527
Use less padding for typescript parameter hints (#2684)
Part of https://linear.app/zed-industries/issue/Z-2537/inlay-hint-issues

Release Notes:

- N/A
2023-07-06 11:23:20 +03:00
Kirill Bulatov
1936bdebb3 Use less padding for typescript parameter hints 2023-07-06 11:16:39 +03:00
Antonio Scandurra
f6c96ec892 Fix panic when saved conversations directory changes
We were updating the view's state but missed a `notify`, which caused
the `UniformList` responsible for rendering the saved conversations
to panic when some files were deleted.
2023-07-06 09:53:34 +02:00
Mikayla Maki
801f41e68e
Move audio dependency to dev 2023-07-05 12:15:56 -07:00
Mikayla Maki
8b8bafef22
Remove spurious audio depedency 2023-07-05 12:05:16 -07:00
Mikayla Maki
594b6e8d64
collab 0.16.0 2023-07-05 11:47:17 -07:00
Joseph T. Lyons
6a15ae9c01 v0.95.x dev 2023-07-05 14:17:37 -04:00
Nate Butler
76873c508a
Z-2276/Z-2275: Project & Branch switchers (#2662)
This PR adds project and branch switchers in top left corner. 

Release Notes:
- Added a project & branch switcher under project name.
2023-07-05 13:09:40 -04:00
Piotr Osiewicz
b80281e556 cargo fmt 2023-07-05 18:57:06 +02:00
Nate Butler
1baa13561d Update project & git menus to be Toggleable<Interactive<ContainedText>>
Co-Authored-By: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2023-07-05 12:50:56 -04:00
KCaverly
afccf608f4 updated both embed and parsing tasks to be multi-threaded. 2023-07-05 12:39:08 -04:00
Nate Butler
de01fa1794
Update collaboration sounds, add sounds to screensharing (#2679)
Updates all collab sounds, add screen sharing sounds.

Release Notes:

- Improved collaboration sounds for joining and leaving a call, muting
and unmuting the mic.
- Added a sound when you start and stop screen sharing.
2023-07-05 12:30:47 -04:00
Piotr Osiewicz
0e0d78df84 Do not render recent paths in toolbar's project switcher 2023-07-05 18:04:40 +02:00
Piotr Osiewicz
ec47464bba branch_list: Show match count on the right hand side of a header.
Co-authored-by: Antonio <antonio@zed.dev>
2023-07-05 16:56:08 +02:00
Piotr Osiewicz
85add260f6 Track regions instead of clicks.
Get rid of superfluous params in RenderParams related to hover & click state.

Co-authored-by: Antonio <antonio@zed.dev>
2023-07-05 16:48:52 +02:00
KCaverly
eff0ee3b60 enabled batching for embedding calls 2023-07-05 10:02:42 -04:00
Piotr Osiewicz
cc88bff1ff Fix click-through behaviour of git panel
Co-authored-by: Antonio <antonio@zed.dev>
2023-07-05 15:25:33 +02:00
Kirill Bulatov
d7f6b5e1a0 Remove InlayProperties 2023-07-05 16:17:14 +03:00
Kirill Bulatov
6ba1c3071a Simplify inlay map data 2023-07-05 15:23:56 +03:00
Piotr Osiewicz
8b3b1a6074 fixup! Remove stacks from branch list header 2023-07-05 14:08:21 +02:00
Piotr Osiewicz
64b77bfa8d Remove stacks from branch list header
Co-authored-by: Antonio <antonio@zed.dev>
2023-07-05 14:04:16 +02:00
Antonio Scandurra
d5f0df94f7 Support assistant: quote selection on multibuffers 2023-07-05 11:41:24 +02:00
Antonio Scandurra
03a00df8b1 Restore focus to previously focused view when dismissing a modal 2023-07-05 09:40:26 +02:00
Antonio Scandurra
a8602b2a0c Add Modal::has_focus and introduce a ModalHandle trait object 2023-07-05 09:39:56 +02:00
Antonio Scandurra
25564ea058 Introduce a WindowContext::focus method that implies the window id 2023-07-05 09:39:04 +02:00
Nate Butler
a7ce602bac Update collaboration sounds, add sounds to screensharing 2023-07-04 16:18:42 -04:00
KCaverly
b6520a8f1d updated vector_store to reindex on save after timed delay 2023-07-04 14:42:12 -04:00
Kirill Bulatov
4c51ab8a25 Accept null as a valid action, to disable a keystroke
co-authored-by: Mikayla Maki <mikayla@zed.dev>
2023-07-04 21:11:28 +03:00
KCaverly
e45d3a0a63 WIP: initial reindexing logic worked out 2023-07-04 11:46:09 -04:00
Piotr Osiewicz
48371ab8b2 Remove PickerEvent::Dismiss emission from picker header 2023-07-04 16:30:17 +02:00
Piotr Osiewicz
e9b34de7c8 Fix click behaviour of vcs/project dropdowns 2023-07-04 16:00:59 +02:00
Conrad Irwin
0d18b72cf8 vim: Further improve ~ handling
Now works with Visual{line} mode, collapses selections like nvim,
and doesn't fall off the end of the line.
2023-07-03 23:58:09 -06:00
Nate Butler
a732b2e043 Remove unused color_scheme field in the theme
I totally didn't mean to commit this right to main T_T
2023-07-04 00:44:12 -04:00
Nate Butler
c409059dc4 Revert "Remove unused color_scheme field in the theme"
This reverts commit 5a1476a1e5.
2023-07-04 00:41:13 -04:00
Nate Butler
5a1476a1e5 Remove unused color_scheme field in the theme 2023-07-04 00:40:01 -04:00
Conrad Irwin
0733e8d50f Remove editor::Cancel binding from vim
When you hit <escape> in the command palette, it first editor::Cancel
because the command palette is also a focused editor; this binding was
catching before the `menu::Cancel` that you probably want.

From looking at the uses of editor::Cancel it seems like the only way to
trigger this is with <escape> in an editor. Rather than trying to hook
into the existing editor cancel and add vim-specific behaviour, we'll
instead take responsibility for binding directly to <escape> when
necessary.

Fixes: zed-industries/community#1347
2023-07-03 15:26:39 -06:00
Mikayla Maki
f8316dd127
Add sound effects to calls (#2673)
This PR adds joined, leaving, mute, and unmute sound effects to Zed. 

Release Notes:

- Added joined, leaving, mute, and unmute sound effects (preview-only)
2023-07-03 13:55:48 -07:00
Mikayla Maki
c700342a1c
Guard against uninstantiated globals in tests 2023-07-03 13:48:17 -07:00
Mikayla Maki
0e4c904091
Add joined sound effect when new participants join the room 2023-07-03 13:36:03 -07:00
Mikayla Maki
d2127825e3
Add first-pass sound support to Zed 2023-07-03 13:30:04 -07:00
Piotr Osiewicz
14eab4e94f branch list: dismiss correct window on PickerEvent.
Query proper window
2023-07-03 19:22:43 +02:00
Piotr Osiewicz
806268f0db Merge branch 'main' into git-menu 2023-07-03 16:25:36 +02:00
Kirill Bulatov
85701c9b80 Do not perform OnTypeFormating after pair brace insert
Co-Authored-By: Julia Risley <julia@zed.dev>
2023-07-03 17:21:44 +03:00
Piotr Osiewicz
4eedc3e646 Remove flex from underneath the pickers 2023-07-03 16:16:14 +02:00
Kirill Bulatov
43d4f04331 Do not add extra spaces to hints 2023-07-03 11:17:12 +03:00
Conrad Irwin
e36d5f41c8 Fix % when on the last character of the line
Contributes: zed-industries/community#682
2023-07-01 13:51:11 -06:00
Piotr Osiewicz
026ad191eb Dismiss dropdowns on click out 2023-07-01 01:49:00 +02:00
Piotr Osiewicz
525521eeb3 Render match count next to branch label 2023-07-01 01:38:36 +02:00
Mikayla Maki
138de37cbf
Add basic sound handling infrastructure 2023-06-30 16:10:49 -07:00
KCaverly
18a5a47f8a moved semantic search model to dev and preview only.
moved db update tasks to long lived persistent task.

Co-authored-by: maxbrunsfeld <max@zed.dev>
2023-06-30 18:41:19 -04:00
KCaverly
3408b98167 updated file compare in the semantic indexing engine, to work off of modified system times as opposed to file hashes
Co-authored-by: maxbrunsfeld <max@zed.dev>
2023-06-30 16:53:23 -04:00
KCaverly
36907bb4dc updated vector store indexing to only use languages with an embedding.scm treesitter query
Co-authored-by: maxbrunsfeld <max@zed.dev>
2023-06-30 16:14:11 -04:00
Kirill Bulatov
ae54e1d224 Remove excessive hint update queries
* Filter out queries for outdated buffers just before hint tasks spawn:
  multicared edits might empit standalone events simultaneously
* Only spawn inlay update tasks for visible buffers with corresponding
  language
* Do not spawn tasks for local projects' buffers without LSP servers
2023-06-30 22:03:21 +03:00
Max Brunsfeld
f83514cde4
Fix regression in handling git FS events (#2670)
As part of an optimization in
https://github.com/zed-industries/zed/pull/2663, I changed the way that
the worktree ignores FS events within unloaded directories. But this
accidentally prevented us from detecting some events that occur inside
of `.git` directories.

In this PR, I've made further tweaks to which FS events we can ignore.
We now explicitly opt *in* to scanning `.git` (shallowly) directories
(even though they are ignored). Note that we still don't recursively
scan the git directory (including all of the files inside `objects`
etc). This seems like the correct amount of work to do, and from my
testing (and our unit tests that use the real FS and real git
repositories), it seems to work correctly.

Release Notes:

- Fixed a bug where Zed would not detect some git repository changes
(preview only).
2023-06-30 11:40:49 -07:00
Max Brunsfeld
92df76e632 Fix accidental ignoring of git FS events 2023-06-30 11:20:50 -07:00
Piotr Osiewicz
7c2c1a279b Add missing rust-side definitions 2023-06-30 20:09:30 +02:00
Piotr Osiewicz
cec884b5a5 Add styles for project name/git menu 2023-06-30 20:07:44 +02:00
Piotr Osiewicz
a5d9a10d7b Focus dropdowns on open 2023-06-30 19:48:28 +02:00
KCaverly
0db0876289 implemented file deletes on project indexing 2023-06-30 11:01:35 -04:00
Piotr Osiewicz
ed75c31640 Improve styling of git menu 2023-06-30 16:38:38 +02:00
Piotr Osiewicz
b699e5c142 Add styles to git menu 2023-06-30 16:23:27 +02:00
KCaverly
e3ab54942e removed sleep from directory scanning as fixes upstream appear to be scanning correctly 2023-06-30 10:17:31 -04:00
KCaverly
1d737e490b Merge branch 'main' of github.com:zed-industries/zed into vector_store 2023-06-30 09:58:13 -04:00
Piotr Osiewicz
3be8977ee8 Switch branches within spawn() 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
c1a6292152 Add missing call to cx.notify 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
081e340d26 Do not query db on foreground thread.
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-06-30 14:05:55 +02:00
Piotr Osiewicz
818ddbc703 Make project dropdown exclusive wrt git menu 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
888d3b3fd6 Project dropdown menu 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
d000ea9739 Fix warning about unused variable 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
1eb0f3d091 Update toast for checkout failure 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
98f71a7fa3 Trail off project/branch name 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
e57364ede6 Remove unnecessary imports 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
aeafa6f6d6 Fix build after rebase 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
c84f3b3bfc Add toast for git checkout failure 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
54fad5969f List recent branches 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
3027e4729a Add timestamps to branches 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
6747acbb84 Trail off branch names 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
ac6e9c88e9 Render header and footer of git menu 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
d8d0bdc479 WIP: git menu 2023-06-30 14:05:55 +02:00
Mikayla Maki
3d6e063a6d
Fix method header 2023-06-29 23:53:57 -07:00
Mikayla Maki
d22a576f5e
fix failing test 2023-06-29 23:50:24 -07:00
Conrad Irwin
abb58c41db vim: Fix edge-case in } when trailing newline is absent
Added .assert_shared_state() to NeovimBackedTestContext – although it's
not strictly necessary to show the expected behaviour in the test file
(as we can just compare to neovim's JSON recording), it makes it much
easier to understand what we're testing.
2023-06-29 23:31:22 -06:00
Conrad Irwin
9ee2707d43 vim: Add }/{ for start/end of paragraph
Fixes: zed-industries/community#470
2023-06-29 23:31:22 -06:00
Mikayla Maki
a9a51ab3ad
Added more tests and minimal file updates 2023-06-29 18:21:35 -07:00
Mikayla Maki
a6dabf7acf
Make path updates minimal 2023-06-29 18:15:40 -07:00
Mikayla Maki
787412b545
fmt and update dependency 2023-06-29 17:49:42 -07:00
Mikayla Maki
cd670e340f
Fix edge case with absolute file paths 2023-06-29 17:48:01 -07:00
Mikayla Maki
33f5248d4f
Add the ability to make new directories by adding slashes to a file name 2023-06-29 17:35:22 -07:00
Mikayla Maki
f6b64dc67a
Add click out events to GPUI (#2659)
This PR adds a new mouse event type for catching when a click happens
outside of a given region.

This was added because I noticed a 'race condition' between the context
menu and the buttons which deploy a context menu. Buttons use on
an`on_click()` handler to deploy the context menu, but the context menu
was closing itself with an `on_down_out()` handler. This meant that the
order of operations was:

0. Context menu is open
1. User presses down on the button, _outside of the context menu_ 
2. `on_down_out()` is fired, closing the context menu
3. User releases the mouse
4. `click()` is fired, checks the state of the context menu, finds that
it's closed, and so opens it

You can see this behavior demonstrated with this video with a long-click
here:


https://github.com/zed-industries/zed/assets/2280405/588234c3-1567-477f-9a12-9e6a70643527

~~Switching from `on_down_out()` to `on_click_out()` means that the
click handler for the button can close the menu before the context menu
gets a chance to close itself.~~

~~However, GPUI does not have an `on_click_out()` event, hence this
PR.~~

~~Here's an example of the new behavior, with the same long-click
action:~~


https://github.com/zed-industries/zed/assets/2280405/a59f4d6f-db24-403f-a281-2c1148499413

Unfortunately, this `click_out` is the incorrect event for this to
happen on. This PR now adds a mechanism for delaying the firing of a
cancel action so that toggle buttons can signal that this on_down event
should not result in a menu closure.

Release Notes:

* Made context menus deployed from buttons toggle, instead of
hide-and-re-show, visibility on click
2023-06-29 17:33:37 -07:00
Mikayla Maki
73b0f3b23d
fmt 2023-06-29 17:19:35 -07:00
Mikayla Maki
5366631173
Remove on_click_out handler from context menu
Add 'delay_cancel()' method and on_down handler to relevant buttons
2023-06-29 17:10:51 -07:00