Commit Graph

15203 Commits

Author SHA1 Message Date
Kyle Kelley
6563330239
Supermaven (#10788)
Adds a supermaven provider for completions. There are various other
refactors amidst this branch, primarily to make copilot no longer a
dependency of project as well as show LSP Logs for global LSPs like
copilot properly.

This feature is not enabled by default. We're going to seek to refine it
in the coming weeks.

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Max <max@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2024-05-03 12:50:42 -07:00
Conrad Irwin
610968815c
Fix backwards mouse selection in vim mode (#11329)
Fixes: #8492

Release Notes:

- vim: Fixed last character of reversed mouse selections (#8492)
2024-05-03 10:29:30 -06:00
Thorsten Ball
55555bb41f
Enable first version of auto-updates on Linux (#11348)
This downloads Nightly/Preview releases on Linux and copies the contents
the `zed-<channel>.app` to `~/.local`.

What's missing:

- Check if we're not installed in ~/.local and abort
- Update `.desktop` file


Release Notes:

- N/A
2024-05-03 16:43:28 +02:00
Kirill Bulatov
f5e155b5a9
When clicking on a hunk expand it, do not move the caret (#11350)
Release Notes:

- N/A
2024-05-03 16:44:33 +03:00
Bennet Bo Fenner
36055505cd
project panel: Allow confirming prompt with keyboard (#11346)
The ability to confirm the file deletion prompt by pressing "Enter" was
broken in #11015

Release Notes:

- Restored the ability to confirm a prompt by pressing "Enter" when
deleting/trashing files
2024-05-03 15:15:39 +02:00
Thorsten Ball
9348e6f7fb
lsp: More information in error if server fails to start (#11343)
We do log that information, but we don't put it in the error message
where it's really useful.



Release Notes:

- N/A
2024-05-03 13:23:52 +02:00
José Olórtegui
f987ff05fd
Improve JSDoc injection in comments (#10800)
This PR improves JSDoc injection for syntax highlighting. Now we are
only injecting JSDoc in block comments. The regex was mostly adapted
from nvim-treesitter's implementation (lua) to a rust regex.


eb93c3b2fb/queries/ecma/injections.scm (L1-L6)

**Before:**
<img width="441" alt="Screenshot 2024-04-20 at 5 51 04 AM"
src="https://github.com/zed-industries/zed/assets/20072509/8e77851d-22ad-4dc4-8e10-9ac558d3cf40">

**After:**
<img width="441" alt="Screenshot 2024-04-20 at 5 52 05 AM"
src="https://github.com/zed-industries/zed/assets/20072509/a607c219-6973-40c3-958c-44a003d008c3">

Release Notes:

- Changed detection of JSDoc to only do syntax highlighting in block
comments. Improved previous work done in #7826.
2024-05-03 11:43:10 +02:00
adorabilis
2306e3cd50
Add brackets and missing operators to Python grammar (#11180)
Release Notes:

- Fixed #4341 

Before:

![before](https://github.com/zed-industries/zed/assets/16101408/34672e47-5131-481a-803e-064db8126cc9)

After:

![after](https://github.com/zed-industries/zed/assets/16101408/7d2405c6-d04f-4738-ad2e-a9424b1c9d19)
2024-05-03 11:37:44 +02:00
Kirill Bulatov
cd03e473c8
Improve deleted hunk blocks' behavior (#11340)
* clear their selections on focus lost
* allow reverting diff hunks when the caret is inside of the deleted
hunk diff editor block

Release Notes:

- N/A
2024-05-03 12:18:50 +03:00
Thorsten Ball
e69e25c171
linux: Use app_id as filepath for desktop file (#11337)
This undoes the changes from #11333 and uses the path of the `.desktop`
file instead.

According ot the spec
(https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html)
the filename and path of the `desktop` file are used to determine the
desktop file ID.

This is enough to match the windows (which have the same WMClass/app-id)
with the desktop entry.

Release Notes:

- N/A
2024-05-03 11:03:55 +02:00
Thorsten Ball
61a60d37a2
Tie the Zed application ID to the release channel (#11335)
Since we do want to have different versions of Zed running on the same
Linux install, we need to give them different application IDs so they're
not grouped together as the same application.

This changes the app_id depending on the releaes channel and, crucially,
it also matches them up with the bundle identifiers that we use on
macOS.

Release Notes:

- N/A
2024-05-03 10:48:35 +02:00
Matthias Grandl
4024b9ac4d
gpui: Fix start_display_link leading to resource leak on hidden windows (#11289)
Release Notes:

- N/A

While developing [Loungy](https://loungy.app), I noticed that everytime
I wake my laptop, Loungy starts consuming 100% CPU. I traced it down to
`start_display_link` as there was this error message at the time of wake
up:

```
[2024-05-02T05:02:31Z ERROR util] /Users/matthias/zed/crates/gpui/src/platform/mac/window.rs:420: could not create display link, code: -6661
```

The timeline is this:

1. The application is hidden with `cx.hide()`
2. The system is put to sleep and later woken up
3. `window_did_change_screen` would trigger immediately after wakeup,
calling `start_display_link`
4. `start_display_link` fails catastrophically as `DisplayLink::new`
starts hogging all the CPU for some reason?
5. throws the error message above
6. Once the window is opened, `window_did_change_occlusion_state` it
retriggers `start_display_link` and the CPU issue subsides
2024-05-03 10:35:51 +02:00
Kirill Bulatov
b523ee6980
Use Rope instead of String for buffer diff base (#11300)
As an attempt to do things better when showing diff hunks, store diff
base as Rope, not String, to have cheaper clones when the diff base text
is reused, e.g. creating another buffer with the diff base text for hunk
diff expanding.

Release Notes:

- N/A
2024-05-03 11:18:43 +03:00
Thorsten Ball
5f0046b923
linux: Set StartupWMClass in .desktop file (#11333)
This has to match the WMClass/AppID, which was added here: #10909

Release Notes:

- N/A
2024-05-03 10:17:30 +02:00
Max Linke
155a80c6a5
Rename test (#11317)
This naming makes the purpose of the test clearer to people new to the
project.
2024-05-02 19:56:34 -06:00
Fernando Tagawa
7bc1025d91
Wayland: Fix segfault when exiting with ctrl+q (#11324)
Release Notes:

- N/A

When closing with `ctrl-q`, drop_window is not called and results in a
segfault.
2024-05-02 16:39:08 -07:00
Nathan Sobo
b58bf64f0a
Increase rate limits for computing embeddings (#11326)
- Also, remove the rate limit for getting cached embeddings entirely.

Release Notes:

- N/A
2024-05-02 16:36:45 -07:00
Nate Butler
47b38a0428
Tidy Assistant2 composer (#11321)
Release Notes:

- N/A
2024-05-02 17:54:55 -04:00
Kyle Kelley
1915a756a0
Allow codebase search to be turned on or off within the composer for assistant2 (#11315)
![image](https://github.com/zed-industries/zed/assets/836375/e03d2357-e2e4-49f1-86d6-7593bce13618)


![image](https://github.com/zed-industries/zed/assets/836375/3d769622-82e1-4e6f-bdec-4dce81e43423)


![image](https://github.com/zed-industries/zed/assets/836375/bf79a4ec-1660-47b1-8525-e741575dc5d4)

Release Notes:

- N/A
2024-05-02 13:26:46 -07:00
Max Brunsfeld
43ad470e58
Use outline queries to chunk files syntactically (#11283)
This chunking strategy uses the existing `outline` query to chunk files.
We try to find chunk boundaries that are:

* at starts or ends of lines
* nested within as few outline items as possible

Release Notes:

- N/A
2024-05-02 12:28:21 -07:00
Conrad Irwin
1abd58070b
Slicker remote project creation (#11309)
Inline the editor into the modal

Release Notes:

- N/A

---------

Co-authored-by: Bennet <bennetbo@gmx.de>
2024-05-02 12:46:52 -06:00
Nate Butler
78a8a58ee2
Iterate on Assistant 2 composer UI (#11306)
- Change project index tool rendering in composer
- Update composer UI style

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-05-02 13:01:21 -04:00
Conrad Irwin
9bac64a9c1
Rename RemoteProject -> DevServerProject (#11301)
Co-Authored-By: Mikayla <mikayla@zed.dev>

In a fit of ill-advisedness I called these things remote projects;
forgetting that remote project is also what we call collaboratively
shared projects.

Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Bennet <bennetbo@gmx.de>
2024-05-02 11:00:08 -06:00
Joseph T. Lyons
98ea5e172e
Add convert to opposite case command (#11290) 2024-05-02 08:37:13 -04:00
Kirill Bulatov
092869d1fa
Use default allocator as a default (#11293) 2024-05-02 14:05:42 +03:00
Kirill Bulatov
aeff468e9c
Fix text offset in the expanded deleted hunk (#11295) 2024-05-02 13:38:42 +03:00
Thorsten Ball
23f191450e
Do not show inline blame information on empty lines (#11294)
cc @iamnbutler 

Release Notes:

- Changed inline git blame information to not show up on empty lines.

Demo/proof:



https://github.com/zed-industries/zed/assets/1185253/e506cf1f-81b1-407b-8dc7-1666b31ae142
2024-05-02 12:22:51 +02:00
Tarun Verghis
edff78e722
Allow ignoring soft wraps when moving to line ends (#11153)
Release Notes:

- Fixed #10888

This patch addresses behavior of
`Editor::move_to_{beginning|end}_of_line`. It adds a setting,
`stop_at_soft_wraps` when defining a keymap for the
`editor::MoveToBeginningOfLine` and `editor::MoveToEndOfLine` actions.
When `true`, it causes movement to the either end of the line (via, for
example Home or End), to go to the logical end, as opposed to the
nearest soft wrap point in the respective direction.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2024-05-02 12:30:45 +03:00
Thorsten Ball
c81230405f
typescript: Complete function calls with snippets (#11157)
This allows function call (i.e. snippet) completion with
`typescript-language-server`. So far that didn't work, because
`typescript-language-server` doesn't respond with `insertText` when
getting the completions, but only when then sending
`completionItem/resolve` requests. See:
https://github.com/hrsh7th/nvim-cmp/issues/646#issuecomment-992765479

What this PR does is to support text edits in the response to
`completionItem/resolve`, which means updating the completion item.

It then enables this feature by default for
`typescript-language-server`.


TODOs:

- [x] Make this work over collab
- [x] Test that this doesn't break existing language server support
- [x] Refactor duplicated code

Release Notes:

- Added support for function call completion when using
`typescript-language-server`. This will result in parameters being
added, which can then be changed and navigated with `<tab>`. For this to
work with `typescript-language-server`, the documentation for a given
completion item needs to be resolved, meaning that if one types very
quickly and accepts completion before `typescript-language-server` could
respond with the documentation, no full function completion is used.

Demo:


https://github.com/zed-industries/zed/assets/1185253/c23ebe12-5902-4b50-888c-d9b8cd32965d
2024-05-02 10:50:01 +02:00
Conrad Irwin
b487f2ce6f
Don't iterate over all system processes (#11281)
Release Notes:

- Fixed a UI beachball when gathering process information
2024-05-01 20:08:56 -06:00
Conrad Irwin
3b5fd4ea66
Only keep one blame up-to-date (#11274)
I was experiencing hang, and we blamed it on spawning a few hundred git
processes
simultaneously.

cc @MrNugget

Release Notes:

- Fixed slowness with hundreds of buffers open doing git blame.
2024-05-01 16:25:26 -06:00
Conrad Irwin
eb0f1e71f7
Show dev server in the titlebar for remote projects (#11276)
Co-Authored-By: Mikayla <mikayla@zed.dev>

Release Notes:

- Show server name in the titlebar for remote projects

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-05-01 16:24:58 -06:00
Marshall Bowers
74f8ef0364
Clean up Indicator (#11275)
This PR cleans up the `Indicator` component:

- Renamed `IndicatorStyle` to `IndicatorKind` and made it private.
- Fixed `Indicator::bar()` to construct an indicator using the right
`IndicatorKind`.
- Removed the `IndicatorIcon`, since we didn't actually end up using it.

Release Notes:

- N/A
2024-05-01 18:10:35 -04:00
Conrad Irwin
fa0253bc5a
Disallow adding folders to projects and opening the terminal in remote projects (#11261)
Release Notes:

- Fixed broken UI in remote projects

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-05-01 16:04:59 -06:00
Conrad Irwin
e5b88ac8c2
Use HIGH priority to wake blocked timers (#11269)
One contributor to some beach-balls was that the main thread was calling
block_with_timeout, but the timeout never fired.

Release Notes:

- Reduced main thread hangs under very high system load
2024-05-01 16:03:27 -06:00
Marshall Bowers
4739797e5d
Add the ability to render icons as indicators (#11273)
This PR adds the ability to render `Icon`s as an `Indicator`.

Release Notes:

- N/A

Co-authored-by: Nate Butler <nate@zed.dev>
2024-05-01 17:52:26 -04:00
Marshall Bowers
4f5312804d
Replace rem size literals with constant (#11272)
This PR replaces the rem size literals with the `BASE_REM_SIZE_IN_PX`
constant.

This way we can retain our source of truth for the rem size that we're
designing against.

Release Notes:

- N/A
2024-05-01 17:46:43 -04:00
Max Brunsfeld
a194c0aa6e
Compile and instantiate wasm modules on a background thread (#11270)
Release Notes:

- Fixed a hang that could occur when loading some extensions, by loading
extensions on a background thread.
2024-05-01 14:34:54 -07:00
Marshall Bowers
fb0d2e948f
assistant2: Use new icon in status bar (#11268)
This PR updates the new assistant to use the new (temporary) icon in the
status bar to distinguish it.

We added the icon in #11257, but hadn't wired it up.

Release Notes:

- N/A
2024-05-01 16:52:09 -04:00
Joseph T. Lyons
aa1b4c7868
Add an explore extensions button to welcome screen (#11265)
We are still getting comments from users saying they didn't know we had
extensions until just now. This doesn't fix anything for existing users,
but it helps make new users more aware, earlier on. There's probably
more we need to do for discoverability, but this feels like it should
help.

Release Notes:

- N/A
2024-05-01 16:07:24 -04:00
Max Linke
dad3cbb960
Enable random_channel_buffer_tests to run on Linux (#10863)
With this patch applied I can see the following line in the test output:

test tests::random_channel_buffer_tests::test_random_channel_buffers has
been running for over 60 seconds

Without it I run in a failure with 'Invalid keystroke `cmk-,`



Release Notes:

- N/A

---------

Co-authored-by: Max Linke <kain88-de@users.noreply.github.com>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-05-01 15:49:18 -04:00
Kirill Bulatov
caa0d35b8b
Allow to toggle git hunk diffs (#11080)
Part of https://github.com/zed-industries/zed/issues/4523

Added two new actions with the default keybindings

```
"cmd-'": "editor::ToggleHunkDiff",
"cmd-\"": "editor::ExpandAllHunkDiffs",
```

that allow to browse git hunk diffs in Zed:


https://github.com/zed-industries/zed/assets/2690773/9a8a7d10-ed06-4960-b4ee-fe28fc5c4768


The hunks are dynamic and alter on user folds and modifications, or
toggle hidden, if the modifications were not adjacent to the expanded
hunk.


Release Notes:

- Added `editor::ToggleHunkDiff` (`cmd-'`) and
`editor::ExpandAllHunkDiffs` (`cmd-"`) actions to browse git hunk diffs
in Zed
2024-05-01 22:47:36 +03:00
Max Brunsfeld
5831d80f51
Return an error from project index tool when embedding query fails (#11264)
Previously, a failure to embed the search query (due to a rate limit
error) would appear the same as if there were no results.

* Avoid repeatedly embedding the search query for each worktree
* Unify tasks for searching all worktree

Release Notes:

- N/A
2024-05-01 12:15:44 -07:00
Andrew Lygin
4b767697af
Fix scrollbar auto-show for cursors out of sight (#11244)
This PR fixes scrollbar auto-show feature when there're not visible
cursors. The intial behavior was broken in #11147.

The problem is that `selections` only contains visible selections, so
the `if` with `non_visible_cursors |= true` is only visited in rare edge
cases when we have at least part of the selection still visible on the
screen. But when we scroll far enough from the cursor,
`non_visible_cursors` keeps its default `false` value, which is
incorrect.

Release Notes:

- N/A
2024-05-01 21:57:10 +03:00
Marshall Bowers
3dc5d48e0c
assistant2: Add ChatNotice component (#11262)
This PR adds a new `ChatNotice` component for displaying notices within
the assistant.

We will be able to use this for allowing the user to confirm a project
index request.

<img width="518" alt="Screenshot 2024-05-01 at 2 41 31 PM"
src="https://github.com/zed-industries/zed/assets/1486634/3beaeeaf-6046-4284-ac0a-4248e1f9ac20">

Release Notes:

- N/A
2024-05-01 14:51:28 -04:00
Nate Butler
97512be378
Add wiring for UI density (#11260)
Note: You shouldn't use the `unstable.ui_density` setting – it is only
being added for testing and to enable new UI components to be built with
density in mind. Don't expect this to work well, or at all right now.

Adds some of the basic wiring we'll need to start scaling UI elements
throughout the app based on a desired density setting.

Release Notes:

- N/A
2024-05-01 14:28:52 -04:00
Conrad Irwin
0fce20d8da
More element arena (#11258)
Co-Authored-By: Mikayla <mikayla@zed.dev>

My Zed was running out with collab + chat + recent projects + two splits
on a large monitor


Release Notes:

- N/A

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-05-01 12:00:27 -06:00
Nate Butler
779f67506a
Assistant 2 temp icon (#11257)
Release Notes:

- N/A
2024-05-01 12:56:27 -04:00
Bennet Bo Fenner
8907d111e3
project panel: Adjust formatting of trash/delete action (#11252)
This PR removes a confusing quotation mark when trashing/deleting a
file, introduced in #10875.
Also makes it clear that the file is actually going into trash instead
of being deleted permanently

Before (trash):
<img width="266" alt="image"
src="https://github.com/zed-industries/zed/assets/53836821/f94a6257-62d0-4a3f-bc44-19e36bb28f67">

After (trash):
<img width="285" alt="image"
src="https://github.com/zed-industries/zed/assets/53836821/becb8143-06cf-4b5e-a52e-be2726df5955">

Before (delete):
<img width="263" alt="image"
src="https://github.com/zed-industries/zed/assets/53836821/e109a127-5f9c-4eeb-950e-4c4d5157061b">


After (delete):
<img width="260" alt="image"
src="https://github.com/zed-industries/zed/assets/53836821/246d0d94-e3d2-4279-84e2-74b313fe00a7">



Release Notes:

- Fixed formatting of prompt action when trashing/deleting a file
2024-05-01 18:07:19 +02:00
Joseph T. Lyons
32c9714a63 v0.135.x dev 2024-05-01 11:33:03 -04:00