Commit Graph

2267 Commits

Author SHA1 Message Date
Nathan Sobo
87d93033d1
Support Jupytext-style line comments for REPL evaluation ranges (#15073)
This adds support for detecting line comments in the
[Jupytext](https://jupytext.readthedocs.io/) format. When line comments
such as `# %%` is present, invoking `repl: run` will evaluate the code
between these line comments as a unit.

/cc @rgbkrk 

```py
# %%
# This is my first block
print(1)
print(2)

# %%
# This is my second block
print(3)
```

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-07-24 11:53:58 +02:00
Marshall Bowers
c84da37030
rpc: Add support for OAEP-based encryption format (#15058)
This PR adds support for a new encryption format for exchanging access
tokens during the authentication flow.

The new format uses Optimal Asymmetric Encryption Padding (OAEP) instead
of PKCS#1 v1.5, which is known to be vulnerable to side-channel attacks.

**Note: We are not yet encrypting access tokens using the new format, as
this is a breaking change between the client and the server. This PR
only adds support for it, and makes it so the client and server can
decrypt either format moving forward.**

This required bumping the RSA key size from 1024 bits to 2048 bits. This
is necessary to be able to encode the access token into the ciphertext
when using OAEP.

This also follows OWASP recommendations:

> If ECC is not available and RSA must be used, then ensure that the key
is at least 2048 bits.
>
> —
[source](https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html#algorithms)

Release Notes:

- N/A
2024-07-23 21:25:25 -04:00
Marshall Bowers
edf7f6defe
Upgrade rsa to v0.9.6 (#15055)
This PR upgrades the `rsa` crate to v0.9.6.

The version we were using was rather old, and for something
security-sensitive we should be using a recent version.

No behavioral changes have been made, just updates to account for
changes in the crate's API.

Release Notes:

- N/A
2024-07-23 20:11:48 -04: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
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
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
Conrad Irwin
d034d73af9
Try blade#144 (#15036)
This pulls in https://github.com/kvark/blade#144 to see if it results in
fewer bad GPU configurations selected

Release Notes:

- linux: Improved graphics card detection
2024-07-23 14:37:22 -06:00
Max Brunsfeld
5f7881fc1e
Improve ssh remote error handling and logging (#15035)
Release Notes:

- N/A
2024-07-23 13:29:56 -07:00
Marshall Bowers
4a43084cb7
Bump wasmtime and wasmtime-wasi to v19.0.2 (#15033)
This PR bumps `wasmtime` and `wasmtime-wasi` to v19.0.2 for some bug
fixes.

https://github.com/bytecodealliance/wasmtime/releases/tag/v19.0.2

Release Notes:

- N/A
2024-07-23 15:55:15 -04:00
Piotr Osiewicz
fa76d8edcf
chore: Bump dependencies (#15029)
Release Notes:


- N/A
2024-07-23 21:38:47 +02: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
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
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
Fabian
a0d687c24a
astro: Ensure Typescript is present (#14849)
The current Astro Extension fails to load properly if it can't find a
`tsserver.js` file in the current workspaces' `node_modules` folder.
This happens pretty frequently, either if `typescript` is not installed
in the project (which it isn't by default), or if `node_modules` is not
in the workspace root.

This PR adds a fallback method of installing `typescript` alongside the
extensions' language server if it is not found in the workspaces'
`node_modules`, as well as correctly setting the `tsdk` path in the
initialization options.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-07-23 10:39:25 -04:00
Marshall Bowers
5f57efb266
astro: Align version numbers in extension.toml and Cargo.toml (#15011)
This PR aligns the version numbers in `extension.toml` and `Cargo.toml`
for the Astro extension, as they had gotten out-of-sync.

Release Notes:

- N/A
2024-07-23 10:28:09 -04:00
Marshall Bowers
6398b45084
astro: Upgrade zed_extension_api to v0.0.6 (#15010)
This PR upgrades the Astro extension to use v0.0.6 of the
`zed_extension_api`.

Release Notes:

- N/A
2024-07-23 10:12:40 -04:00
Piotr Osiewicz
5d77a7dc6c
Ruff: Do not pass --preview flag, respect binary settings (#15001)
Bumps version to 0.0.2 as well.

Release Notes:

- N/A
2024-07-23 09:57:42 +02: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
Marshall Bowers
7d063aa10b
erlang: Upgrade zed_extension_api to v0.0.6 (#14914)
This PR upgrades the Erlang extension to use v0.0.6 of the
`zed_extension_api`.

Release Notes:

- N/A
2024-07-21 10:59:05 -04: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
Piotr Osiewicz
1218a846c1
extensions: Add Ruff extension (#14198)
Release Notes:

- Added extension for [Ruff](https://docs.astral.sh/ruff/), an extremely fast Python linter and code formatter, written in Rust.
2024-07-20 15:18:02 +02: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
272be98ec8
php: Bump to v0.1.2 (#14808)
This PR bumps the PHP extension to v0.1.2.

Changes:

- #14806

Release Notes:

- N/A
2024-07-19 09:13:23 -04: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
Marshall Bowers
f7ff9b0811
vue: Bump to v0.1.0 (#14748)
This PR bumps the Vue extension to v0.1.0.

Changes:

- https://github.com/zed-industries/zed/pull/14747

Release Notes:

- N/A
2024-07-18 11:39:30 -04:00
Marshall Bowers
be1ff8aee9
vue: Install a global version of TypeScript if not present in the project (#14747)
This PR updates the Vue extension with support for installing and using
its own copy of TypeScript if it can't find one in the project.

The way we resolve `typescript` is as follows:

- We check the project's `package.json` for `typescript` in either the
`devDependencies` or `dependencies`
- If found, we set the `typescript.tsdk` to
`node_modules/typescript/lib` to use the project's copy of TypeScript
- If not found, we install the latest version of `typescript` (if not
already downloaded) to the extension's `package.json` and use that
version for `typescript.tsdk`

This should resolve instances where Vue projects that do not have an
explicit `typescript` dependency—such as those using Vue with plain
JavaScript—fail to load the language server due to TypeScript not being
found.

Release Notes:

- N/A
2024-07-18 11:32:46 -04: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
Vitaly Slobodin
80558a3986
ruby: Bump to v0.0.8 (#14707)
Bump version of the Ruby extension to 0.0.8.

Changes:

- https://github.com/zed-industries/zed/pull/12642
- https://github.com/zed-industries/zed/pull/13216
- https://github.com/zed-industries/zed/pull/14661
- https://github.com/zed-industries/zed/pull/14693

Release Notes:

- N/A
2024-07-18 08:13:36 -04:00
apricotbucket28
013c9f0420
linux: Implement local time zone support (#14610)
I decided to remove the GPUI APIs since `chrono` already provides this
functionality, and is already been used for this purpose in other parts
of the code (e.g.
[here](80402a6840/crates/zed/src/main.rs (L756))
or
[here](80402a6840/crates/ui/src/utils/format_distance.rs (L258)))

These usages end up calling the `time_format` crate, which takes in a
`UtcOffset`. It's probably cleaner to rewrite the crate to take in
`chrono` types, but that would require rewriting most of the code there.

Release Notes:

- linux: Use local time zone in chat and Git blame
2024-07-18 13:42:18 +02:00
Marshall Bowers
00c3c02f7d
Render other tab icons in the start slot (#14683)
This PR reworks the rendering for tab icons to allow us to render all of
the tab icons—not just file icons—in the tab's start slot.

The `Item` trait now has a separate `tab_icon` method that can be used
to indicate what icon should be shown for the tab.

Release Notes:

- N/A
2024-07-17 16:59:41 -04:00
Thorsten Ball
9241b11e1f
Restore unsaved buffers on restart (#13546)
This adds the ability for Zed to restore unsaved buffers on restart. The
user is no longer prompted to save/discard/cancel when trying to close a
Zed window with dirty buffers in it. Instead those dirty buffers are
stored and restored on restart.

It does this by saving the contents of dirty buffers to the internal
SQLite database in which Zed stores other data too. On restart, if there
are dirty buffers in the database, they are restored.

On certain events (buffer changed, file saved, ...) Zed will serialize
these buffers, throttled to a 100ms, so that we don't overload the
machine by saving on every keystroke. When Zed quits, it waits until all
the buffers are serialized.


### Current limitations
- It does not persist undo-history (right now we don't persist/restore
undo-history regardless of dirty buffers or not)
- It does not restore buffers in windows without projects/worktrees.
Example: if you open a new window with `cmd-shift-n` and type something
in a buffer, this will _not_ be stored and you will be asked whether to
save/discard on quit. In the future, we want to fix this by also
restoring windows without projects/worktrees.

### Demo



https://github.com/user-attachments/assets/45c63237-8848-471f-8575-ac05496bba19



### Related tickets

I'm unsure about closing them, without also fixing the 2nd limitation:
restoring of worktree-less windows. So let's wait until that.

- https://github.com/zed-industries/zed/issues/4985
- https://github.com/zed-industries/zed/issues/4683

### Note on performance

- Serializing editing buffer (asynchronously on background thread) with
500k lines takes ~200ms on M3 Max. That's an extreme case and that
performance seems acceptable.

Release Notes:

- Added automatic restoring of unsaved buffers. Zed can now be closed
even if there are unsaved changes in buffers. One current limitation is
that this only works when having projects open, not single files or
empty windows with unsaved buffers. The feature can be turned off by
setting `{"session": {"restore_unsaved_buffers": false}}`.

---------

Co-authored-by: Bennet <bennet@zed.dev>
Co-authored-by: Antonio <antonio@zed.dev>
2024-07-17 18:10:20 +02:00
Joseph T Lyons
8e9e94de22 v0.146.x dev 2024-07-17 11:29:16 -04:00
Marshall Bowers
1607e4e0e1
elixir: Bump to v0.0.6 (#14657)
This PR bumps the Elixir extension to v0.0.6.

Changes:

- #14655

Release Notes:

- N/A
2024-07-17 11:14:52 -04:00
Thorsten Ball
e69b995a3b
zig: Bump to v0.1.4 (#14651)
This PR bumps the Zig extension to v0.1.4.

Changes:

- #14379

Release Notes:

- N/A
2024-07-17 10:41:12 -04:00
Marshall Bowers
f19b51c0b2
zig: Revert changes dependent on new zed_extension_api (#14652)
This PR reverts the changes to the Zig extension dependent on the new
`zed_extension_api` version so that we can publish the Zig extension.

Release Notes:

- N/A
2024-07-17 10:40:25 -04:00
Marshall Bowers
1d2d3b209e
svelte: Bump to v0.0.3 (#14650)
This PR bumps the Svelte extension to v0.0.3.

Changes:

- #14614

Release Notes:

- N/A
2024-07-17 10:20:50 -04:00
Marshall Bowers
4feb994ad8
php: Bump to v0.1.1 (#14647)
This PR bumps the PHP extension to v0.1.1.

Changes:

- #14643

Release Notes:

- N/A
2024-07-17 09:40:00 -04:00
Marshall Bowers
f8cfb50bb4
php: Bump to v0.1.0 (#14607)
This PR bumps the PHP extension to v0.1.0.

Changes:

- #14603
- #14604

Release Notes:

- N/A
2024-07-16 18:49:58 -04:00
Marshall Bowers
60b22cf029
php: Upgrade zed_extension_api to v0.0.6 (#14603)
This PR upgrades the PHP extension to use v0.0.6 of the
`zed_extension_api`.

Release Notes:

- N/A
2024-07-16 17:53:43 -04:00
Conrad Irwin
cf8bd4a90a
Remoting public alpha (#14541)
Release Notes:

- remoting: An alpha version of remote development is now available to
everyone. For more information on how to use it, and limitations see
https://zed.dev/docs/remote-development.
2024-07-16 12:05:55 -06:00
Conrad Irwin
6cf6614c48
Fix xkbcommon overflow more (#14571)
Release Notes:

- linux: Fixed overflow in xkbcommon-rs
2024-07-16 09:06:38 -06:00
Conrad Irwin
e413823ae7
Headless extensions (#14538)
Release Notes:

- remoting (alpha only): Fix extension installation
2024-07-16 00:08:56 -06:00
Conrad Irwin
abc5abcd8b
open picker (#14524)
Release Notes:

- linux: Added a fallback Open picker for when XDG is not working
- Added a new setting `use_system_path_prompts` (default true) that can
be disabled to use Zed's builtin keyboard-driven prompts.

---------

Co-authored-by: Max <max@zed.dev>
2024-07-15 17:04:15 -06:00