This PR adds a `.gitattributes` rule to prevent GitHub from displaying
comments within JSON files as errors.
We have a number of JSON files (e.g., settings) that make use of
comments, and having a bunch of red in a diff is annoying.
Release Notes:
- N/A
This change implements the vim
[motion](https://github.com/vim/vim/blob/master/runtime/doc/motion.txt)
commands to move the cursor to the top, middle and bottom of the visible
view. This feature is requested in
https://github.com/zed-industries/zed/issues/4941.
This change takes inspiration from
[crates/vim/src/normal/scroll.rs](https://github.com/zed-industries/zed/blob/main/crates/vim/src/normal/scroll.rs).
A note on the behavior of these commands: Because
`NeovimBackedTestContext` requires compatibility with nvim, the current
implementation causes slightly non-standard behavior: it causes the
editor to scroll a few lines. The standard behavior causes no scrolling.
It is easy enough to account for the margin by adding
`VERTICAL_SCROLL_MARGIN`. However, doing so will cause test failures due
to the disparity between nvim and zed states. Perhaps
`NeovimBackedTestContext` should have a switch to be more tolerant for
such cases.
Release Notes:
- Added support for moving to top, middle and bottom of the screen in
vim mode (`H`, `M`, and `L`)
([#4941](https://github.com/zed-industries/zed/issues/4941)).
Release Notes:
- Added a fallback BPE if the language model doesn't have one.
---------
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This PR adds support for loading user themes in Zed.
Themes are loaded from the `themes` directory under the Zed config:
`~/.config/zed/themes`. This directory should contain JSON files
containing a `ThemeFamilyContent`.
Here's an example of the general structure of a theme family file:
```jsonc
{
"name": "Vitesse",
"author": "Anthony Fu",
"themes": [
{
"name": "Vitesse Dark Soft",
"appearance": "dark",
"style": {
"border": "#252525",
// ...
}
}
]
}
```
Themes placed in this directory will be loaded and available in the
theme selector.
Release Notes:
- Added support for loading user themes from `~/.config/zed/themes`.
#6910
I changed the `open_file` symbol to `open`, because this is more
consistent with the original intention
Release Notes:
- Added the ability to expand/collapse directories using the
`project_panel::Open` action.
This PR adds a newtype wrapper around the global `ThemeRegistry`.
This allows us to limit where the `ThemeRegistry` can be accessed
directly via `cx.global` et al., without going through the dedicated
methods on the `ThemeRegistry`.
Release Notes:
- N/A
This PR reworks how we access the `ThemeRegistry` global.
Previously we were making calls directly on the context, like
`cx.global::<ThemeRegistry>`. However, one problem with this is that it
spreads out the knowledge of exactly what type is stored in the global.
In order to make it easier to adjust the type we store in the context
(e.g., wrapping the `ThemeRegistry` in an `Arc`), we now call methods on
the `ThemeRegistry` itself for accessing the global.
It would also be interesting to see how we could prevent access to the
`ThemeRegistry` without going through one of these dedicated methods 🤔
Release Notes:
- N/A
This adds cross-platform file-watching via the
[Notify](https://github.com/notify-rs/notify) crate. The previous
fs-events implementation is now only used on MacOS, and on other
platforms Notify is used. The watching function interface is the same.
Related to #5391#5395#5394.
Release Notes:
- N/A
On a .zig files , the `CMD-/` keybinding don't work,
In the language config its the only language with '//' type comment that
is written in singular without array.
This fixed the problem, so i assume it was just a typo
![image](https://github.com/zed-industries/zed/assets/6186996/d7f2381a-8b21-4f50-8910-6685b81a5aec)
Release notes:
- Fixed line comment continuations and Editor::ToggleComments for Zig, Haskell and PureScript.
Jsonc is a simplified json format which allows comments and unquoted
values delimited by whitespace. A jsonc formatted file can be
unambiguously transformed to a json file. Comments will be stripped out
and quotes added.
Release Notes:
- Added an icon for .jsonc files
This is no-op right now, but we need it for multi-platform support and
(potentially) to split the Universal Binary on mac into two
non-universal targets.
Related to: #6837
Release Notes:
- N/A
The fonts we embed in Zed binary (Zed Sans & Zed Mono) weigh about 30Mb in total and we are cloning them several times during startup and loading of embedded assets (once explicitly in Zed and then under the hood in font-kit). Moreover, after loading we have at least 2 copies of each font in our program; one in .rdata and the other on the heap for use by font-kit.
This commit does away with that distinction (we're no longer allocating the font data) and slightly relaxes the interface of `TextSystem::add_fonts` by expecting one to pass `Cow<[u8]>` instead of `Arc<Vec<u8>>`. Additionally, `AssetSource::get` now returns `Cow<'static, [u8]>` instead of `Cow<'self, [u8]>`; all existing implementations conform with that change.
Note that this optimization takes effect only in Release builds, as the library we use for asset embedding - rust-embed - embeds the assets only in Release mode and in Dev builds it simply loads data from disk. Thus it returns `Cow<[u8]>` in it's interface. Therefore, we still copy that memory around in Dev builds, but that's not really an issue.
This patch makes no assumptions about the build profile we're running under, that's just an intrinsic property of rust-embed.
Tl;dr: this should shave off about 30Mb of memory usage and a fair chunk (~30ms) of startup time.
Release Notes:
- Improved startup time and memory usage.
This pull request implements the following documentation changes:
- [x] Copy existing language settings docs from old docs repo
- [x] Add new pages for Zig, Haskell, Gleam, Deno and PureScript
- [x] Add `rust-analyzer` target directory section to Rust language page
Release Notes:
- Added initial language settings documentation
([#4264](https://github.com/zed-industries/zed/issues/4264)).
Closes#4358
The bug originates on this line:
5db7e8f89e/crates/vim/src/motion.rs (L451)
- When running "dtx" on "ˇabcx", the range to delete is 0 -> 2 ("abc")
- When running "dtx" on "abˇcx", the range to delete is 2 -> 2 ("c"), so
`new_point == point` and the function incorrectly returns `None` and "c"
is not deleted
- We need to disambiguate between the "not found" case and the "found
immediately to the right" case
- This bug does not apply to the backwards case ("dTx")
Release Notes:
- Fixed "dtx" vim key combination when "x" is immediately to the right
of the cursor (#4358)
This pull request adds support for upper / lower casing a visual
selection with `u` or `U` respectively, and resolves#6901.
I took an approach to split out the logic of the existing `ChangeCase`
action into something that could be reused for the two new actions. One
area that I could use feedback on is whether or not vim binding updates
make sense. Judging purely from the way things work from a clean install
of Vim / Neovim, I'm pretty sure that it's a bug that `u` applies an
undo in visual mode, so I think it's safe to make this change, but it
changes a behavior that some users may be used to by now in Zed.
Release Notes:
- Added support for `u` and `U` in Vim visual mode
([#6901](https://github.com/zed-industries/zed/issues/6901)).
Switch to `poetry`
Update script to take in a `query-day-interval` argument, so we can make
a report from all issues or just n last days.
Release Notes:
- N/A
This PR fixes an issue where credentials for saved conversations weren't
being fully retrieved, which was preventing continuing a conversation
with the assistant in a saved conversation.
Release Notes:
- Fixed continuing a saved conversation with the Zed assistant.
By default `npm install` will walk up the folder tree checking for a
folder that contains either a package.json file, or a node_modules
folder. If such a thing is found, then that is treated as the effective
"current directory" for the purpose of running npm commands.
This caused npm dependencies for language servers sometimes to be
installed in the wrong folder, described in #4628.
Adding `--prefix ./` to `npm install` forces
node_runtime.npm_install_packages to install packages in provided path
even if node_modules dir exists somewhere up the filesystem tree from
installation path.
This PR updates the casing of "OpenAI" when used in Rust identifiers to
match the [Rust naming
guidelines](https://rust-lang.github.io/api-guidelines/naming.html):
> In `UpperCamelCase`, acronyms and contractions of compound words count
as one word: use `Uuid` rather than `UUID`, `Usize` rather than `USize`
or `Stdin` rather than `StdIn`.
Release Notes:
- N/A