Commit Graph

16373 Commits

Author SHA1 Message Date
Marshall Bowers
1307a80e07
rpc: Add regression tests for encoding/decoding public keys (#15054)
This PR adds some tests to ensure we don't regress in our public key
encoding/decoding capabilities when making changes in this area.

Release Notes:

- N/A
2024-07-23 19:58:47 -04:00
Kyle Kelley
9d11a6ff78
repl: Detect Conda and Python environments with their own kernel specs (#15047)
Detect kernels in conda and python environments.

Release Notes:

- N/A
2024-07-23 15:23:24 -07:00
Marshall Bowers
6769e55ce0
Revert "chore: Bump async-tungstenite to 0.23 (and tungstenite to 0.20.1) (#15039)" (#15048)
This reverts commit 4d65f7eea3.

Reverting because it causes auth with collab to break.

Release Notes:

- N/A
2024-07-23 18:22:37 -04:00
Mikayla Maki
855048041d
Update http crate name (#15041)
Release Notes:

- N/A
2024-07-23 15:01:05 -07:00
Marshall Bowers
d36ebc8c74
Add global Fs instance (#15044)
This PR adds a global `Fs` instance to the app context.

This will make it easier to access the filesystem in some cases instead
of having to thread it around.

Release Notes:

- N/A
2024-07-23 17:59:55 -04:00
Kyle Kelley
5062bf0b4d
repl: Pad the table rows with a fraction of the line height (#15042)
Compute the final height using the number of rows and the constant
fraction.

Ensures we don't accidentally overlap lines below table output.

<img width="663" alt="image"
src="https://github.com/user-attachments/assets/fe24b08d-2271-4dcc-88c7-8702ba4c68b0">


Release Notes:

- N/A
2024-07-23 14:42:58 -07:00
Piotr Osiewicz
4d65f7eea3
chore: Bump async-tungstenite to 0.23 (and tungstenite to 0.20.1) (#15039)
Release Notes:

- N/A
2024-07-23 23:18:00 +02:00
Conrad Irwin
7ae305ac0d
Make vim::test_remap less flaky on linux (#15040)
Release Notes:

- N/A
2024-07-23 15:16:45 -06:00
Piotr Osiewicz
ba4ff1df59
chore: Remove clap3 dependency by disabling default features of cbindgen (#15037)
cbindgen pulled that in, but we don't really need it (Plus it pulls in a
dep with an advisory)

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-07-23 22:49:49 +02:00
Max Brunsfeld
5f7881fc1e
Improve ssh remote error handling and logging (#15035)
Release Notes:

- N/A
2024-07-23 13:29:56 -07:00
Conrad Irwin
b0c525af5f
inotify alert (#15027)
Release Notes:

- linux: Show an error and troubleshooting steps for inotify limits
(#10310)
2024-07-23 14:21:56 -06:00
Conrad Irwin
41a3e78b1e
Don't try to connect to X11/Wayland when headless (#15028)
Release Notes:

- remote development: Stopped logging every 16ms when connected to a
remote server with a badly configured X server.
2024-07-23 14:11:47 -06:00
Stanislav Alekseev
5021397c01
Fix diagnostic popups flickering when moving cursor in the boundaries of the symbol (#14870)
This PR just uses ranges returned by an LSP to work, the subsequent PR
would focus on trying to fall back onto tree-sitter in case of info
hovers. I'm also unsure if I'm supposed to use `local_diagnostic` or
`primary_diagnostic` when both are available
Release Notes:

- Fix diagnostic popups flickering when moving cursor in the boundaries
of the symbol

Before:


https://github.com/user-attachments/assets/4905a7e5-c333-453b-b204-264b3ef79586

After:


https://github.com/user-attachments/assets/c742c424-fb20-450d-8848-baaf1937dd47
2024-07-23 14:10:19 -06:00
Kirill Bulatov
b2b9d4ccb6
Extend task templates with shell and hide fields to use custom shells and custom close behavior (#15031) 2024-07-23 22:58:36 +03:00
Piotr Osiewicz
fa76d8edcf
chore: Bump dependencies (#15029)
Release Notes:


- N/A
2024-07-23 21:38:47 +02:00
Marshall Bowers
5f8e799d60
repl: Fix a small typo in a variable name (#15030)
This PR fixes a small typo in a variable name.

Release Notes:

- N/A
2024-07-23 15:09:40 -04:00
Max Brunsfeld
38e3182bef
Handle buffer diff base updates and file renames properly for SSH projects (#14989)
Release Notes:

- N/A

---------

Co-authored-by: Conrad <conrad@zed.dev>
2024-07-23 11:32:37 -07:00
Piotr Osiewicz
3d1bf09299
Allow user to use multiple formatters (#14846)
Fixes #4822
- [x] Release note
- [ ] Surface formatting errors via a toast
- [x] Doc updates
- [x] Have "language-server" accept an optional name of the server.

Release Notes:

- `format` and `format_on_save` now accept an array of formatting
actions to run.
- `language_server` formatter option now accepts the name of a language
server to use (e.g. `{"language_server": {"name: "ruff"}}`); when not
specified, a primary language server is used.

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-07-23 20:05:09 +02:00
Kyle Kelley
53b711c2b4
repl: Make the terminal background transparent (#15022)
Keeps the background the same as the output area background by making
the terminal background be `Hsla::transparent_black()`.

Release Notes:

- N/A

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2024-07-23 11:03:22 -07:00
Bennet Bo Fenner
d0f52e90e6
assistant: Overhaul provider infrastructure (#14929)
<img width="624" alt="image"
src="https://github.com/user-attachments/assets/f492b0bd-14c3-49e2-b2ff-dc78e52b0815">

- [x] Correctly set custom model token count
- [x] How to count tokens for Gemini models?
- [x] Feature flag zed.dev provider
- [x] Figure out how to configure custom models
- [ ] Update docs

Release Notes:

- Added support for quickly switching between multiple language model
providers in the assistant panel

---------

Co-authored-by: Antonio <antonio@zed.dev>
2024-07-23 19:48:41 +02:00
Thorsten Ball
17ef9a367f
zed: Add ability to restore last session w/ multiple windows (#14965)
This adds the ability for Zed to restore multiple windows after
restarting. It's now the default behavior.

Release Notes:

- Added ability to restore all windows that were open when Zed was quit.
Previously only the last used workspace was restored. This is now the
default behavior. To get back the old behavior, add the following to
your settings: `{"restore_on_startup": "last_workspace"}` (Part of
[#4985](https://github.com/zed-industries/zed/issues/4985) and
[#4683](https://github.com/zed-industries/zed/issues/4683))

Demo:



https://github.com/user-attachments/assets/57a375ec-0c6a-4724-97c4-3fea8f18bc2d

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-07-23 19:44:02 +02:00
Antonio Scandurra
53f828df7d
Avoid inserting extra newlines when evaluating code (#15018)
When the evaluation range ends at the start of a line, back it up to the
end of the previous line. This avoids inserting extra newlines below the
evaluation range when they already exist.

Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>
2024-07-23 19:03:15 +02:00
Marshall Bowers
7d0386eff9
settings_ui: Add placeholder view (#15019)
This PR adds a placeholder view for the settings UI. It does not contain
any functionality, as of yet.

This view is staff-shipped behind a feature flag.

Release Notes:

- N/A
2024-07-23 12:50:11 -04:00
Conrad Irwin
bdf1d4edea
linux: Better GPU debugging (#14706)
Release Notes:

- linux: Added GPU information to `editor: Copy System Specs to
Clipboard`
- linux: Show a prominant warning before running under llvmpipe and
similar.
2024-07-23 09:56:45 -06:00
Marshall Bowers
c262c81e52
repl: Filter commands out of command palette when REPL is disabled (#15016)
This PR makes it so the `repl: ` commands don't appear in the command
palette when the REPL feature is disabled.

Release Notes:

- N/A
2024-07-23 11:49:56 -04:00
Kirill Bulatov
a5cb66f0e1
Allow to regenerate a summary of the assistant context (#14964)
Both manual and LLM-through ways are supported:


https://github.com/user-attachments/assets/afb0d2b3-9a9b-4f78-a909-1e663e686323


Release Notes:

- Improved assistant panel summarization usability
2024-07-23 17:51:49 +03:00
Antonio Scandurra
728650f94a
Fix interaction with Anthropic models when using it via zed.dev (#15009)
Release Notes:

- N/A

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-07-23 15:47:38 +02:00
Antonio Scandurra
dde9d37cf9
Remove completion dependency from collab (#15006)
This was causing CI to fail when trying to deploy collab.

Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-07-23 11:44:07 +02:00
Benjamin Westphal
1fae99a7c4
vim: Add motion support for toggle comments (#14919)
### Summary

This PR adds support for count and object motions to the toggle comments
action in Vim mode. The relevant issue is
[#14337](https://github.com/zed-industries/zed/issues/14337).

For example, `2 g c j` will toggle comments three lines downward. `g c g
g` will toggle comments from the current cursor position up to the start
of the file.

Notably missing from this PR are `g c b` (toggle comments for the
current block) as well as `g c p` (toggle comments for the current
paragraph). These seem to be non-standard.

The new module `normal/toggle_comments.rs` has been copied almost
verbatim from `normal/indent.rs`. Maybe that ought to be abstracted over
but I feel I lack the overview.

Release Notes:

- vim: Added support for count and object motion to the toggle comments
action ([#14337](https://github.com/zed-industries/zed/issues/14337)).
2024-07-22 21:22:10 -06:00
CharlesChen0823
eb210ca248
linux: Fix crash in Wayland when dragging and dropping a tab not belonging to Zed (#14995)
close #14189 

Release Notes:

- N/A
2024-07-22 21:20:53 -06:00
Nate Butler
4ba430b16c
repl: Design tweaks (#14988)
- Add spinner to "Executing..."
- Update Queued label to match others.

Release Notes:

- N/A
2024-07-22 19:05:36 -04:00
Marshall Bowers
fe1f55cbfd
repl: Iterate on design of REPL sessions view (#14987)
This PR iterates on the design of the REPL sessions view.

We now use the same component for both available kernels and running
ones to provide some consistency between the two modes:

<img width="1208" alt="Screenshot 2024-07-22 at 6 49 08 PM"
src="https://github.com/user-attachments/assets/8b5c3600-e438-49fa-8484-cefabf4b44f1">

<img width="1208" alt="Screenshot 2024-07-22 at 6 49 14 PM"
src="https://github.com/user-attachments/assets/5125e9b3-6465-4d1e-9036-e6ca270dedcb">

Release Notes:

- N/A
2024-07-22 19:02:11 -04:00
Kyle Kelley
01392c1329
repl: Enable jupyter by default, allow disabling (#14985)
Enables the jupyter feature by default, which is shown only when we have
a kernelspec or know that we (can) support it well (Python,
Deno/TypeScript).

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-07-22 17:30:21 -04:00
Marshall Bowers
a9397834eb
quick_action_bar: Add menu entry to view REPL sessions (#14984)
This PR adds a new menu entry in the REPL item in the quick action bar
to open up the REPL sessions view:

<img width="232" alt="Screenshot 2024-07-22 at 4 54 36 PM"
src="https://github.com/user-attachments/assets/acc60a25-7722-4331-9b80-fab9cca65842">

This makes this more discoverable than having to know that the command
exists.

Release Notes:

- N/A
2024-07-22 17:05:05 -04:00
Marshall Bowers
4227a3d3e0
repl: Remove unused repl_panel::ToggleFocus action (#14983)
This PR removes the `repl_panel::ToggleFocus` action, as we don't need
it anymore.

Release Notes:

- N/A
2024-07-22 16:45:04 -04:00
Marshall Bowers
2a69420c42
repl: Do some cleanup (#14982)
This PR cleans up the REPL implementation a bit.

Release Notes:

- N/A
2024-07-22 16:39:32 -04:00
Marshall Bowers
d8a42bbf63
repl: Replace REPL panel with sessions view (#14981)
This PR removes the REPL panel and replaces it with a new sessions view
that gets displayed in its own pane.

The sessions view can be opened with the `repl: sessions` command (we
can adjust the name, as needed).

There was a rather in-depth refactoring needed to extricate the various
REPL functionality on the editor from the `RuntimePanel`.

<img width="1136" alt="Screenshot 2024-07-22 at 4 12 12 PM"
src="https://github.com/user-attachments/assets/ac0da351-778e-4200-b08c-39f9e77d78bf">

<img width="1136" alt="Screenshot 2024-07-22 at 4 12 17 PM"
src="https://github.com/user-attachments/assets/6ca53476-6ac4-4f8b-afc8-f7863f7065c7">

Release Notes:

- N/A
2024-07-22 16:22:50 -04:00
Kevin Wang
a20e92a8c1
Truncate line when accepting inline suggestions for Supermaven (#13884)
Configures inline completions to delete the remaining text on the given
line. This doesn't affect the github copilot inline completion provider
since it seems to only generate suggestions if the cursor is at the end
of the line but fixes the usability issues related to Supermaven.




https://github.com/user-attachments/assets/1b8bc9a3-4666-4665-a436-96e4beee01bb





Release Notes:

- Fixed https://github.com/zed-industries/zed/issues/13039

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-07-22 11:59:38 -07:00
Conrad Irwin
a955968de3
Don't panic on GPU hang (#14974)
Fixes: #12766
Fixes: #14022

Release Notes:

- linux: Fix panic when GPU is temporarily unavailable.
2024-07-22 12:21:28 -06:00
Kirill Bulatov
f597c29432
Position X for deleted hunks better (#14973)
Release Notes:

- N/A
2024-07-22 20:24:24 +03:00
Marshall Bowers
28baa56e3d
repl: Factor out ReplStore (#14970)
This PR factors a `ReplStore` out of the `RuntimePanel`.

Since we're planning to remove the `RuntimePanel` and replace it with an
ephemeral tab that can be opened, we need the kernel specifications and
sessions to have somewhere long-lived that they can reside in.

Release Notes:

- N/A
2024-07-22 12:46:33 -04:00
Conrad Irwin
2e23527e09
Refactor key dispatch (#14942)
Simplify key dispatch code.

Previously we would maintain a cache of key matchers for each context
that
would store the pending input. For the last while we've also stored the
typed prefix on the window. This is redundant, we only need one copy, so
now
it's just stored on the window, which lets us avoid the boilerplate of
keeping
all the matchers in sync.

This stops us from losing multikey bindings when the context on a node
changes
(#11009) (though we still interrupt multikey bindings if the focus
changes).

While in the code, I fixed up a few other things with multi-key bindings
that
were causing problems:

Previously we assumed that all multi-key bindings took precedence over
any
single-key binding, now this is done such that if a user binds a
single-key
binding, it will take precedence over all system-defined multi-key
bindings
(irrespective of the depth in the context tree). This was a common cause
of
confusion for new users trying to bind to `cmd-k` or `ctrl-w` in vim
mode
(#13543).

Previously after a pending multi-key keystroke failed to match, we would
drop
the prefix if it was an input event. Now we correctly replay it
(#14725).

Release Notes:

- Fixed multi-key shortcuts not working across completion menu changes
([#11009](https://github.com/zed-industries/zed/issues/11009))
- Fixed multi-key shortcuts discarding earlier input
([#14445](https://github.com/zed-industries/zed/pull/14445))
- vim: Fixed `jk` binding preventing you from repeating `j`
([#14725](https://github.com/zed-industries/zed/issues/14725))
- vim: Fixed `escape` in normal mode to also clear the selected
register.
- Fixed key maps so user-defined mappings take precedence over builtin
multi-key mappings
([#13543](https://github.com/zed-industries/zed/issues/13543))
- Fixed a bug where overridden shortcuts would still show in the Command
Palette
2024-07-22 10:46:16 -06:00
Piotr Osiewicz
865904a0c9
lsp: Pass back diagnostic .data when querying code actions for it (#14962)
Per the LSP spec, we should pass .data field of diagnostics into code
action request:
```
	/**
	 * A data entry field that is preserved between a
	 * `textDocument/publishDiagnostics` notification and
	 * `textDocument/codeAction` request. *
	 * @since 3.16.0 */ data?: LSPAny;
```


Release Notes:

- Fixed rare cases where a code action triggered by diagnostic may not
be available for use.
2024-07-22 17:49:11 +02:00
Floyd Wang
1ea363b020
Fix typo in font-weight setting story (#14958)
Release Notes:

- N/A
2024-07-22 07:49:27 -04:00
Antonio Scandurra
0155435142
Allow using a custom model when using zed.dev (#14933)
Release Notes:

- N/A
2024-07-22 12:25:53 +02:00
Kirill Bulatov
31d283932c
Allow to input spaces in the outline panel filter input (#14951)
Release Notes:

- Fixed outline panel's filter not accepting spaces
2024-07-22 12:02:25 +03:00
Luke Naylor
0ef19dedd2
Correct escaping in snippets (#14912)
## Release Notes:

- Fixed issue with backslashes not appearing in snippets
([#14721](https://github.com/zed-industries/zed/issues/14721)),
motivated by a snippet provided by the latex LSP
([texlab](https://github.com/latex-lsp/texlab)) not working as intended
in Zed ([extension
issue](https://github.com/rzukic/zed-latex/issues/5)).

[Screencast from 2024-07-21
14-57-19.webm](https://github.com/user-attachments/assets/3c95a987-16e5-4132-8c96-15553966d4ac)

## Fix details:

Only $, }, \ can be escaped by a backslash as per [LSP spec (under
grammar
section)](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/\#snippet_syntax).
Technically, commas and pipes can also be escaped only in "choice"
tabstops but it does not look like they are implemented in Zed yet.

## Additional tests added for cases currently not covered:
- backslash not being used to escape anything (so just a normal
backslash)
- backslash escaping a backslash (so that the second does not escape
what follows it)

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-07-22 00:57:34 +02:00
Marshall Bowers
83f6a7f228
assistant: Use square buttons for the inline assist model selector (#14928)
This PR updates the model selector buttons in the inline assistant to
use `IconButtonShape::Square`.

Release Notes:

- N/A
2024-07-21 13:59:21 -04:00
Marshall Bowers
2d96bba61f
assistant: Respect ui_font_weight setting for inline assist in the terminal (#14924)
This PR updates the terminal inline assist to respect the
`ui_font_weight` setting.

Release Notes:

- N/A
2024-07-21 13:09:25 -04:00
Ryan Hawkins
a4baba7edd
Add button to copy SHA from Git blame (#14883)
The git blame dialog doesn't give the user a way to quickly copy the SHA
of the associated commit for a line. Adding an option for users to
quickly access this SHA is helpful for user's to do any more git-fu they
might need, such as viewing the full changes themselves within git,
checking the commit out, bisecting off the commit, etc.

This is also very handy for user's of self-hosted git providers.
Determining what provider a self-hosted repository is using could be
quite difficult and this presents an easy option to allow users to look
up more about a commit without having to memorize the short SHA.

Release Notes:

- Added a button to copy the SHA from a Git blame entry.

<img width="1552" alt="A screenshot showing the new copy SHA button
within the Zed editor's inline blame "
src="https://github.com/user-attachments/assets/9365950d-3a3f-4c11-b119-ab02654f5669">

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-07-21 12:02:16 -04:00
Marshall Bowers
cb2c334358
Use defaults for unchanged TextStyle fields (#14918)
This PR updates a number of spots where we were setting all of the
`TextStyle` fields even if we were not changing the values from the
defaults.

We now use `..Default::default()`.

Release Notes:

- N/A
2024-07-21 11:55:45 -04:00
Max Brunsfeld
e8bcc412b5
Fix usability issues with ssh connection modal (#14917)
Release Notes:

- N/A
2024-07-21 08:43:59 -07:00
张小白
9c26d07f7a
Ensure ExtensionBuilder respects the proxy settings (#14899)
Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-07-21 10:46:43 -04:00
Marshall Bowers
0a9d50bf01
http: Refactor construction of HTTP clients with a proxy (#14911)
This PR refactors the `http` crate to expose a better way of
constructing an `HttpClient` that contains a proxy.

Release Notes:

- N/A
2024-07-21 10:15:38 -04:00
Marshall Bowers
c7331b41e9
gpui: Include image URI in ImageCacheError::BadStatus (#14910)
This PR updates the `ImageCacheError::BadStatus` variant to include the
URI of the image that failed to load.

This helps contextualize the resulting error logs.

Release Notes:

- N/A
2024-07-21 10:13:31 -04:00
Mag Mell
70f7f2d2da
theme_importer: Output logs to stderr (#14890)
Will allow writing directly to a file without logging via `cargo run -p
theme_importer -- /path/to/file`

Release Notes:

- N/A
2024-07-21 08:53:37 -04:00
Kyle Kelley
cd9b25d827
repl: Increase accuracy of error output line height (#14880) 2024-07-20 15:59:54 -07:00
Kyle Kelley
781633fb1a
repl: Ensure that the output's computed line height is at least 1 (#14877) 2024-07-20 15:59:28 -07:00
Kyle Kelley
6dfb0a4a70
repl: Push button to clear outputs (#14873) 2024-07-20 11:32:03 -07:00
versecafe
48c253feb8
Expand terminal menu actions (#14828)
<img width="422" alt="image"
src="https://github.com/user-attachments/assets/73195894-81a7-4b8e-b5cf-ae60bf5b1fb9">

Release Notes:

- Added `Copy`, `Paste`, `Select All`, & `New Terminal` into terminal's context menu
2024-07-20 12:20:53 +03:00
Kevin Wang
46b7fa9bcb
Add Sign Out link for Supermaven (#14834)
Adds a menu item to sign out from a linked Supermaven account.


![image](https://github.com/user-attachments/assets/6af3c39f-9ca4-4ac2-a5c0-c7cb3c3aaac2)


Release Notes:

- Added the ability to sign out of a Supermaven account ([#12715(https://github.com/zed-industries/zed/issues/12715))
2024-07-20 03:53:24 +03:00
Max Brunsfeld
022e662815 Start work on showing progress when initializing ssh remoting 2024-07-19 17:25:28 -07:00
Max Brunsfeld
d89e2592a1
Fix file name conflict when downloading app update (#14847)
This fixes broken auto-updates on nightly. Unfortunately, nightly users
will need to re-download.

Release Notes:

- N/A
2024-07-19 16:33:41 -07:00
Fabian
a072caab0b
node_runtime: Bump downloaded Node.js version to Current (Jod) (#14687)
This PR bumps the hard-coded Node.js version from v18.x (Hydrogen), which was LTS until October 2023, to v22.x (Jod) which will be the next LTS release in October 2024.

Release Notes:

- Updated Zed's node version (v18.x -> v22.x)
2024-07-20 01:18:56 +03:00
Max Brunsfeld
fbe30c6f2e
Fixes for SSH remoting infrastructure (#14844)
* Fixed mis-named macOS remote server archives in actions and packaging
scripts
* Fixed an issue with the ask pass script on linux
* Download nightly versions of remote servers in dev mode (not stable)

Release Notes:

- N/A
2024-07-19 15:08:10 -07:00
Marshall Bowers
a5b8094082
editor: Implement From instead of Into for converting BlockIds to ElementIds (#14839)
This PR replaces the `Into<ElementId> for BlockId` implementation with
`From<BlockId> for ElementId`.

This keeps in line with Rust's guidance for preferring implementing
`From`, and gives us more flexibility when converting.

Release Notes:

- N/A
2024-07-19 16:24:12 -04:00
Conrad Irwin
d2efa12e16
vim: Fix gv after actions (#14829)
Fixes: #13720

Co-Authored-By: <tobbe@tlundberg.com>



Release Notes:

- vim: Fixed `gv` after `y`, `d`, etc.
([#13760](https://github.com/zed-industries/zed/issues/13760)).
2024-07-19 13:26:55 -06:00
Marshall Bowers
5e635b8914
ui: Remove absolute positioning for tab slots (#14836)
This PR reworks the `Tab` component to not use absolute positioning in
order to position the tab slots.

This should make any further adjustments we want to make to the spacing
easier to do.

Release Notes:

- N/A
2024-07-19 15:11:27 -04:00
Jason Lee
0a02691778
Fix tooltips sometimes continuously displaying when the button is selected (#14832)
Release Notes:

- Fixed sometime tooltip will continuously display when the button is
selected.

---

@mrnugget The #13857 This change has led into a bug, the selected item
before tooltip will continuous display if there are no other tooltips.



https://github.com/user-attachments/assets/06b4a9a4-dede-4c18-b020-e20b6090341f
2024-07-19 12:49:08 -06:00
Conrad Irwin
1dc4d4200f
Add command aliases (#14826)
Co-Authored-By: <tobbe@tlundberg.com>

Release Notes:

- Added `"command_aliases"` setting to let you abbreviate commands
2024-07-19 12:48:48 -06:00
Richard Feldman
ec487d8f64
Extract completion provider crate (#14823)
We will soon need `semantic_index` to be able to use
`CompletionProvider`. This is currently impossible due to a cyclic crate
dependency, because `CompletionProvider` lives in the `assistant` crate,
which depends on `semantic_index`.

This PR breaks the dependency cycle by extracting two crates out of
`assistant`: `language_model` and `completion`.

Only one piece of logic changed: [this
code](922fcaf5a6 (diff-3857b3707687a4d585f1200eec4c34a7a079eae8d303b4ce5b4fce46234ace9fR61-R69)).
* As of https://github.com/zed-industries/zed/pull/13276, whenever we
ask a given completion provider for its available models, OpenAI
providers would go and ask the global assistant settings whether the
user had configured an `available_models` setting, and if so, return
that.
* This PR changes it so that instead of eagerly asking the assistant
settings for this info (the new crate must not depend on `assistant`, or
else the dependency cycle would be back), OpenAI completion providers
now store the user-configured settings as part of their struct, and
whenever the settings change, we update the provider.

In theory, this change should not change user-visible behavior...but
since it's the only change in this large PR that's more than just moving
code around, I'm mentioning it here in case there's an unexpected
regression in practice! (cc @amtoaer in case you'd like to try out this
branch and verify that the feature is still working the way you expect.)

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-07-19 13:35:34 -04:00
Max Brunsfeld
b9a53ffa0b
Add the ability to edit remote directories over SSH (#14530)
This is a first step towards allowing you to edit remote projects
directly over SSH. We'll start with a pretty bare-bones feature set, and
incrementally add further features.

### Todo

Distribution
* [x] Build nightly releases of `zed-remote-server` binaries
    * [x] linux (arm + x86)
    * [x] mac (arm + x86)
* [x] Build stable + preview releases of `zed-remote-server`
* [x] download and cache remote server binaries as needed when opening
ssh project
* [x] ensure server has the latest version of the binary


Auth
* [x] allow specifying password at the command line
* [x] auth via ssh keys
* [x] UI password prompt

Features
* [x] upload remote server binary to server automatically
* [x] opening directories
* [x] tracking file system updates
* [x] opening, editing, saving buffers
* [ ] file operations (rename, delete, create)
* [ ] git diffs
* [ ] project search

Release Notes:

- N/A

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-07-19 10:27:26 -07:00
Marshall Bowers
edddc68da6
client: Remove leftover http.rs file (#14822)
This PR removes an empty `http.rs` file that was leftover from a
previous PR.

Release Notes:

- N/A
2024-07-19 12:22:31 -04:00
Thorsten Ball
5de5d5bc56
go: Fix quoting of targeting expression for non-fish shells (#14821)
This fixes #14818.

The change in #14055 broke the tasks in `zsh` (and I suspect in `bash`,
`sh` too), because what was executed was NOT

    $ go test . -run '^TestThis$'

but instead this:

    $ go test . -run \'^TestThis$\'

And in `zsh` this means that `'` is part of the argument passed to `go`,
which means the targeting string is wrong.

Since the problem in `fish` doesn't seem to be the `^` but the `$`, we
can only escape that, which makes the escaped string work in `zsh` and
`fish` and `bash` (in which I've tested this change here)

Release Notes:

- go: Fix running single tests by changing the quoted expression in the
`go test` command to work again in `bash`, `zsh`, etc.
([#14818](https://github.com/zed-industries/zed/issues/14818))
2024-07-19 18:05:31 +02:00
Kyle Kelley
5467e18a5b
repl: Refactor editor registration (#14819)
Cleans up action registration with the editors and also fixes a major
bug where only one workspace's panel was getting session info (due to my
not understanding that `cx.observe_new_views` is for the whole app).

Release Notes:

- N/A

Co-authored-by: Conrad <conrad@zed.dev>
2024-07-19 08:58:57 -07:00
Antonio Scandurra
4c7f1032a4
Allow an initial prompt to be associated with inline assist (#14816)
Release Notes:

- Added the ability to create custom inline assist bindings that
pre-fill a prompt from your keymap, e.g.:
    ```json
    [
        {
            "context": "Editor && mode == full",
            "bindings": {
                "ctrl-shift-enter": [
                    "assistant::InlineAssist",
                    { "prompt": "Build a snake game" }
                ]
            }
        }
    ]
    ```

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-07-19 17:13:48 +02:00
Antonio Scandurra
d61eaea4b9
Avoid losing focus when block decorations go offscreen (#14815)
Release Notes:

- Fixed a bug that caused focus to be lost when renames and inline
assists were scrolled offscreen.

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-07-19 17:04:18 +02:00
Richard Feldman
f5d50f2b1e
Delete obsolete and unused remote_projects.rs (#14811)
See
https://github.com/zed-industries/zed/pull/11301#issuecomment-2234239630
for context

Release Notes:

- N/A
2024-07-19 08:50:49 -06:00
Kyle Kelley
be4b19babb
repl: Create action to refresh kernelspecs (#14786)
Adds a command to refresh kernelspecs. Also added the kernelspecs to the
runtime panel when none are running. That's just for now until we move
out of the panel completely.

Release Notes:

- N/A
2024-07-19 07:42:18 -07:00
Marshall Bowers
e3d5eff858
Use ui::prelude::* in a few more spots (#14807)
This PR updates a couple files to make use of the `ui::prelude::*`
import.

Release Notes:

- N/A
2024-07-19 08:57:51 -04:00
Jason Lee
fb541accb2
gpui: Update Menu name to use SharedString type to support more types (#14791)
Release Notes:

- N/A
2024-07-19 08:51:31 -04:00
Marshall Bowers
836f623800
Update icon positioning in tabs (#14804)
This PR updates the icon positioning in tabs to make give them even
spacing on either side.

Without file icons:

<img width="901" alt="Screenshot 2024-07-19 at 7 55 39 AM"
src="https://github.com/user-attachments/assets/89cc80cd-1323-424e-90a5-79d8586e8725">

With file icons:

<img width="956" alt="Screenshot 2024-07-19 at 7 55 52 AM"
src="https://github.com/user-attachments/assets/c5b47b4e-e6c3-4dbd-aeb3-fb09a0032105">

Release Notes:

- N/A
2024-07-19 08:04:57 -04:00
Kirill Bulatov
18c2e8f6ca
Rework mouse handling of git hunks diff (#14727)
Closes https://github.com/zed-industries/zed/issues/12404

![Screenshot 2024-07-18 at 14 02
31](https://github.com/user-attachments/assets/a8addd22-0ed9-4f4b-852a-f347314c27ce)

![Screenshot 2024-07-18 at 14 02
43](https://github.com/user-attachments/assets/0daaed10-b9f3-4d4b-b8d7-189aa7e013b9)

Video:


https://github.com/user-attachments/assets/58e62527-da75-4017-a43e-a37803bd7b49


* now shows a context menu on left click instead of expanding the hunk
diff
* hunk diffs can be toggled with a single cmd-click still
* adds a X mark into gutter for every hunk expanded
* makes `editor::ToggleDiffHunk` to work inside the deleted hunk editors

Additionally, changes the way editor context menus behave when the
editor is scrolled — right click and diff hunks context menu now will
stick to the place it was invoked at, instead of staying onscreen at the
same pixel positions.

Release Notes:

- Improved the way git hunks diff can be toggled with mouse
([#12404](https://github.com/zed-industries/zed/issues/12404))

---------

Co-authored-by: Nate Butler <nate@zed.dev>
Co-authored-by: Conrad Irwin <conrad@zed.dev>
2024-07-19 13:48:04 +03:00
Antonio Scandurra
4d177918c1
Start on adding support for editing via the assistant panel (#14795)
Note that this shouldn't have any visible user-facing behavior yet. The
feature is incomplete but we wanna merge early to avoid a long-running
branch.

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-07-19 11:13:15 +02:00
Conrad Irwin
87457f9ae8
Fix off-by-one errors in syntax highlighting (#14780)
In the case that a line ended with a 0-length run, we would get our
highlights offset by one position.

Release Notes:

- Fixed syntax highlights being offset from syntax in diagnostics
popovers.
2024-07-18 22:37:30 -06:00
Vishal Bhavsar
be45f32753
vim: Fix 'Y' to yank to end of line (#14783)
Instead of yanking the entire line.

Release Notes:

- vim: Updated `Y` to yank to end of line (like neovim)
https://github.com/zed-industries/zed/issues/14771
2024-07-18 22:34:40 -06:00
versecafe
18b5a87298
Add gpt-4o-mini as an available model (#14770)
Release Notes:

- Fixes #14769
2024-07-18 22:32:56 -06:00
Kyle Kelley
48211e8ce2
repl: Check process status and propagate to output (#14782)
<img width="582" alt="image"
src="https://github.com/user-attachments/assets/14bd321d-f5fc-4cc0-9386-f435423057ad">

Release Notes:

- N/A
2024-07-18 19:35:05 -07:00
Conrad Irwin
5008a388e6
Use -f in ssh remoting too (#14773)
Release Notes:

- N/A
2024-07-18 19:24:59 -06:00
versecafe
3c417864e6
typescript: Highlight using keyword (#14772)
Release Notes:

- Added syntax highlighting for the `using` keyword in TypeScript
([#14762](https://github.com/zed-industries/zed/issues/14762)).
2024-07-18 17:33:13 -04:00
Marshall Bowers
ad3055076d
assistant: Allow /docs to perform JIT indexing when run (#14768)
This PR updates the `/docs` slash command with the ability to
just-in-time index a package when there are not yet any results in the
index.

When running a `/docs` slash command, we fist check to see if there are
any results in the index that would match the search.

If there are, we go ahead and return them, as we do today.

However, if there are not yet any results we kick off an indexing task
as part of the command execution to fetch the results.

Release Notes:

- N/A
2024-07-18 17:01:48 -04:00
Kyle Kelley
cb217381ce
repl: Scroll down after running code (#14759)
Go to the next line after running code. Allows for fluid coding and
running.


https://github.com/user-attachments/assets/d11ac05d-7801-4191-b275-3b20302e54c5

Release Notes:

- N/A
2024-07-18 11:22:43 -07:00
Kevin Wang
862f5a0561
Handle supermaven account status messages (#14749)
Sets the account status state to allow the Supermaven button to move out
of the "Supermaven is initializing..." state. We also need to add the
ability to sign out and change tiers but I will do that in a separate
PR.

Release Notes:

- Improved Supermaven status messages
([#12715](https://github.com/zed-industries/zed/issues/12715)).
2024-07-18 11:22:30 -07:00
Hans
7d30175527
vim: Add repeat support for add_surround (#14746)
Fix: #14242

At present, we don't trigger the method `start_recording(cx)` to start
recording when typing add_surround, so it can't be repeated well, delete
and change actually don't increase, but when entering `d` and `c`, it
happens that these two operations are recorded, I think maybe we also
need to call `start_recording(cx)` when calling delete_surround and
change_surround, otherwise when the user modifies their shortcuts, these
two functions may not be supported by repeat

Release Notes:

- N/A
2024-07-18 11:54:59 -06:00
Hans
d044685706
vim: Adjust surrounding_markers method (#14752)
At present, when calculating some ranges, we take the `tuple_windows` to
iterate forward, which will cause some problems when the cursor is being
front, because `tuple_windows` iteration cannot iterate to the very
beginning, so there will be some cases that cannot be calculated, adjust
this method, and now it can calculate more perfectly, and the execution
speed is about the same

Release Notes:

- N/A
2024-07-18 11:53:51 -06:00
Marshall Bowers
c19e71f51e
languages: Remove lingering Elm file (#14754)
This PR removes a leftover file from when Elm support was done natively.

Elm was extracted into an extension in #10432.

Release Notes:

- N/A
2024-07-18 12:41:18 -04:00
Thorsten Ball
3a83fecea9
gpui: Prefer removable over integrated Metal devices (#14744)
For context, see:

-
https://github.com/zed-industries/zed/issues/5124#issuecomment-2227743811
-
https://github.com/zed-industries/zed/pull/14738#issuecomment-2236613976

Short version: on Intel MacBooks it's better to prefer integrated
(`is_low_poer()`) GPUs, except when a user has an eGPU plugged-in, in
which case they very likely want to prefer that.

Before this change, we'd always prefer the integrated GPU, even if an
eGPU was available.

Now, with this change, if a user has

- eGPU
- integrated GPU
- discrete GPU

We'd first prefer eGPU, then integrated, then discrete.



Release Notes:

- Changed preference for GPUs on macOS so that eGPUs are now preferred
over integrated ones (and both of which are preferred over discrete
GPUs) on Intel Macs.
2024-07-18 16:52:38 +02:00
CharlesChen0823
bac4a0428d
project_panel: Select the newly created file when copy/pasting a file (#14705)
Closes: #14361 

Release Notes:

- Improved project panel to select newly created file on copy/paste ([#14361](https://github.com/zed-industries/zed/issues/14361))
2024-07-18 17:26:33 +03:00
Kirill Bulatov
ed3d3dc690
Improve same line diagnostic rendering (#14741)
Follow-up of https://github.com/zed-industries/zed/pull/14515

Fixed certain visual artifacts, related to multi line diagnostics and
block toggle rendering.
Also enabled diagnostics toolbar controls for the experimental view too.


Release Notes:

- N/A
2024-07-18 17:22:38 +03:00
Marshall Bowers
24d9374744
Add text_color helper for tab contents (#14737)
This PR adds a `text_color` method to `TabContentParams` to more easily
compute the text color to be used for tab contents.

This consolidates a number of conditionals that were scattered all over
the place to give us a singular source of truth for these colors.

Release Notes:

- N/A
2024-07-18 09:27:05 -04:00