This PR updates the extension builder to normalize `-` to `_` in the
Rust package names when computing the resulting `.wasm` file name.
The `wasm32-wasi` target does this normalization internally already, so
we need to do the same to ensure we're looking for the resulting `.wasm`
file in the right spot.
Release Notes:
- N/A
This PR fixes an issue where the extension CLI would error if a
`Cargo.toml` didn't exist when we were trying to check for its
existence. Since we're just checking if it exists for the purposes of
detecting a Rust extension, we can safely ignore the errors.
Also improved the logging/error handling in a few spots to make other
errors easier to troubleshoot in the future.
Release Notes:
- N/A
Most notably, this should do away with completions overriding the whole
word around completion trigger text. Fixes: #4816
Release Notes:
- Fixed code completions overriding text around the cursor.
### Issue
So this pull request fixes an issue that was driven me crazy. The issue
was that when you use the `prettier-plugin-organize-imports` It would
remove some imports that should not be removed before they were used
inside the module itself.
You can reproduce it with the following `prettierrc.json` config and
source code. When you **save** the file, it would remove the `import
clsx from "clsx";` import from the file.
**Prettier config**
```json
{
"semi": true,
"tabWidth": 4,
"trailingComma": "es5",
"useTabs": true,
"plugins": [
"prettier-plugin-tailwindcss",
"prettier-plugin-organize-imports"
]
}
```
**Source code**
```typescript
import clsx from "clsx";
export default function Home() {
return (
<main>
{clsx("asdjklasdjlkasd", "asdjlkasjdjlk")}
</main>
);
}
```
### Findings
After a deep dive with @mrnugget, I was debugging deep down the prettier
plugin system and found the issue that was causing this issue. When I
was looking inside the
`node_modules/prettier-plugin-organize-imports/lib/organize.js`. I saw
the following code that looked strange to me because it falls back to
`file.ts` if `filepath` is not passed through inside the prettier config
options.
<img width="860" alt="Screenshot 2024-03-20 at 21 31 46"
src="https://github.com/zed-industries/zed/assets/62463826/47177fe5-e5a9-41d8-9f2f-0304b2c2159f">
So the issue was small, if you look at the following code, the `path`
key should be `filepath` inside the
`crates/prettier/src/prettier_server.js:205`
![Screenshot 2024-03-20 at 21 35
25](https://github.com/zed-industries/zed/assets/62463826/1eea0a88-c886-4632-9c69-9f3095126971)
Release Notes:
- Fixed prettier integration not using the correct filepath when
invoking prettier, which could lead to some prettier plugins failing to
format correctly.
([#9496](https://github.com/zed-industries/zed/issues/9496)).
* Allow creating channels when seeding
* Allow configuring a custom `SEED_PATH`
* Seed the database when creating/migrating it so you don't need a
separate step for this.
Release Notes:
- N/A
This PR builds off of an earlier version of
https://github.com/zed-industries/zed/pull/9595, rearranges some of the
logic, and removes an unused platform API.
Release Notes:
- N/A
---------
Co-authored-by: apricotbucket28 <agustin.nicolas.marcos@outlook.com>
This PR is a bit of a shot in the dark. I'm not sure if this will be
acceptable and I understand if it gets rejected.
I've been trying to integrate Zed as my daily driver and the key
bindings have been a major hurdle for me. Mostly due to the
windows/linux keybindings being messed up, but also me wanting to have
more chained key bindings similar to helix or common in custom neovim
configurations.
I think having a `None` base keymap would allow someone to more easily
implement a new base keymap (#4642) and would make my daily use of Zed a
little nicer 😅.
Also I am aware that there would need to be a little more work done in
this PR for the other base keymaps such as 'atom' since they assume the
'default' (vscode) base keymaps are loaded. I'm happy to do that work if
a 'none' base keymap is acceptable.
Release Notes:
- Added ability to specify no base keymap which allows for full
keybinding customization
This PR adds support for handling action releases — events that
are fired when the user releases all the modifier keys that were part of
an action-triggering shortcut.
If the user holds modifiers and invokes several actions sequentially via
shortcuts (same or different), only the last action is "released" when
its modifier keys released.
~The following methods were added to `Div`:~
- ~`capture_action_release()`~
- ~`on_action_release()`~
- ~`on_boxed_action_release()`~
~They work similarly to `capture_action()`, `on_action()` and
`on_boxed_action()`.~
See the implementation details in [this
comment](https://github.com/zed-industries/zed/pull/8782#issuecomment-2009154646).
Release Notes:
- Added a fast-switch mode to the file finder: hit `p` or `shift-p`
while holding down `cmd` to select a file immediately. (#8258).
Related Issues:
- Implements #8757
- Implements #8258
- Part of #7653
Co-authored-by: @ConradIrwin
Our goal is to extract Svelte support into an extension, since we've
seen problems with the Tree-sitter Svelte parser crashing due to bugs in
the external scanner. In order to do this, we need a couple more
capabilities in LSP extensions:
* [x] `initialization_options` - programmatically controlling the JSON
initialization params sent to the language server
* [x] `prettier_plugins` - statically specifying a list of prettier
plugins that apply for a given language.
* [x] `npm_install_package`
Release Notes:
- N/A
---------
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This PURELY formats the file by opening it in Zed and hitting save with
save-on-format on.
It's been bugging me that I can't change the file without the whole
thing getting reformatted, so here we are.
Release Notes:
- N/A
We can convert shell, npm and gulp tasks to a Zed format. Additionally, we convert a subset of task variables that VsCode supports.
Release notes:
- Zed can now load tasks in Visual Studio Code task format
---------
Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
**Summary**:
- Removed reply message from message_menu
- Made render_popover_buttons a bit more reusable
- Fixed issue that you can't close the reply/edit preview when you are
not focusing the message editor
- Notify only the new people that were mentioned inside the edited
message
**Follow up**
- Fix that we update the notification message for the people that we
mentioned already
- Fix that we remove the notification when a message gets deleted.
- Fix last acknowledge message id is in correct now
**Todo**:
- [x] Add tests
- [x] Change new added bindings to the `Editor::Cancel` event.
Release Notes:
- Added editing of chat messages
([#6707](https://github.com/zed-industries/zed/issues/6707)).
<img width="239" alt="Screenshot 2024-03-09 at 11 55 23"
src="https://github.com/zed-industries/zed/assets/62463826/b0949f0d-0f8b-43e1-ac20-4c6d40ac41e1">
<img width="240" alt="Screenshot 2024-03-13 at 13 34 23"
src="https://github.com/zed-industries/zed/assets/62463826/d0636da2-c5aa-4fed-858e-4bebe5695ba7">
---------
Co-authored-by: Bennet Bo Fenner <53836821+bennetbo@users.noreply.github.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
As I mentioned before, there are the following issues with how GPUI
handles scale factors greater than 1.0:
1. The title bar buttons do not function correctly, with minimizing
button performing maximization and maximizing button performing closure.
2. As discussed in #8809, setting a scale factor greater than 1.0 causes
GPUI's drawing content to be pushed off the screen.
This PR introduces `LogicalSize` and `PhysicalSize` to differentiate
between coordinate systems for proper GPUI rendering, and now scale
factors above 1.5 are working correctly.
`Zed` with a scale factor equals 1.5, and change between different scale
factors:
https://github.com/zed-industries/zed/assets/14981363/3348536d-8bd3-41dd-82f6-052723312a5b
Release Notes:
- N/A
Co-authored-by: Antonio <antonio@zed.dev>
Resurrected this from some assistant work I did in Spring of 2023.
- [x] Resurrect streaming responses
- [x] Use streaming responses to enable AI via Zed's servers by default
(but preserve API key option for now)
- [x] Simplify protobuf
- [x] Proxy to OpenAI on zed.dev
- [x] Proxy to Gemini on zed.dev
- [x] Improve UX for switching between openAI and google models
- We current disallow cycling when setting a custom model, but we need a
better solution to keep OpenAI models available while testing the google
ones
- [x] Show remaining tokens correctly for Google models
- [x] Remove semantic index
- [x] Delete `ai` crate
- [x] Cloud front so we can ban abuse
- [x] Rate-limiting
- [x] Fix panic when using inline assistant
- [x] Double check the upgraded `AssistantSettings` are
backwards-compatible
- [x] Add hosted LLM interaction behind a `language-models` feature
flag.
Release Notes:
- We are temporarily removing the semantic index in order to redesign it
from scratch.
---------
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Max <max@zed.dev>
This PR adds a GitHub Action for publishing the extension CLI.
When the `extension-cli` tag is pushed, this Action will run, build the
`zed-extension` binary, and upload it to DigitalOcean for consumption.
This will allow us to consume the pre-built binary in the CI for the
extensions repo.
Release Notes:
- N/A
---------
Co-authored-by: Max <max@zed.dev>
I mainly focused on improving the `font_id` function, see the
description of e286483262 for more
details. The rest are some drive-by changes I could not resist to.
When I am right about af4d6c43ce, someone
with a Mac could change it there as well.
This PR is probably best reviewed commit by commit :)
cc @gabydd @h3mosphere
Release Notes:
- N/A
---------
Signed-off-by: Niklas Wimmer <mail@nwimmer.me>
This will be used in the
[extensions](https://github.com/zed-industries/extensions) repository
for packaging the extensions that users submit.
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
TL;DR:
- shaves off about 0.5 seconds from most of our debug builds.
- It would've slightly regressed release build due to preventing build pipelining, but as a tradeoff I've bumped up codegen-units for zed.
\# What did you come up with this time Piotr
In our zed repository I've noticed that merely *loading dependencies* in each crate takes non-trivial amount of time (~800ms in case of editor).
That is to say, the moment you \`use editor\`, your build time increases by 800ms - this happens just once in crate though, as it looks like compiler has to load .rlibs of all of the referenced dependencies.
This is visible under rustc's self-profile. Repro steps on twitter: https://twitter.com/PiotrOsiewicz/status/1762845413072101567
\# How does this commit alleviate this?
zed lib + zed bin are on critical path of every build and cumulatively take about 3s to build. This commit bundles all of this up into ~2.2s of bin build time instead.
\# Wait, splitting binary targets is good, no?
Splitting up a binary target into lib + bin is generally considered to be a good practice, as you can then reuse the lib part elsewhere if needed.
It also allows the build to kick off the moment metadata for all of the dependencies is available (thus, you don't need to wait for codegen).
However, we do not really use zed as a lib, so the first benefit is not really a thing for us.
The latter *is* indeed something we lose out on in release mode (in dev codegen phase of leaf-ish crates is insignificant, as we use shared generics - thus we don't spend much time codegening).
That's why I've bumped codegen units for zed crate to 16 in release mode to keep build times in tact.