Hi there, nice editor!
Here's my attempt at fixing #10865.
Thanks
Release Notes:
-vim: Fix ctrl+a when cursor is on a decimal point
([#10865](https://github.com/zed-industries/zed/issues/10865)).
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Fixed the cursor selection being offset, the hollow cursor was being
displayed fine when not having text selected that's why it might not
have been noticed at first.
Release Notes:
- N/A
Improved:
0d6fb08b67
For a long time, we've had problems where diagnostics can end up showing
up inconsistently in different views. This PR is my attempt to prevent
that, and to simplify the system in the process. There are some UX
changes.
Diagnostic behaviors that have *not* changed:
* In-buffer diagnostics update immediately when LSPs send diagnostics
updates.
* The diagnostic counts in the status bar indicator also update
immediately.
Diagnostic behaviors that this PR changes:
* [x] The tab title for the project diagnostics view now simply shows
the same counts as the status bar indicator - the project's current
totals. Previously, this tab title showed something slightly different -
the numbers of diagnostics *currently shown* in the diagnostics view's
excerpts. But it was pretty confusing that you could sometimes see two
different diagnostic counts.
* [x] The project diagnostics view **never** updates its excerpts while
the user might be in the middle of typing it that view, unless the user
expressed an intent for the excerpts to update (by e.g. saving the
buffer). This was the behavior we originally implemented, but has
changed a few times since then, in attempts to fix other issues. I've
restored that invariant.
Times when the excerpts will update:
* diagnostics are updated while the diagnostics view is not focused
* the user changes focus away from the diagnostics view
* the language server sends a `work done progress end` message for its
disk-based diagnostics token (i.e. cargo check finishes)
* the user saves a buffer associated with a language server, and then a
debounce timer expires
* [x] The project diagnostics view indicates when its diagnostics are
stale. States:
* when diagnostics have been updated while the diagnostics view was
focused:
* the indicator shows a 'refresh' icon
* clicking the indicator updates the excerpts
* when diagnostics have been updated, but a file has been saved, so that
the diagnostics will soon update, the indicator is disabled
With these UX changes, the only 'complex' part of the our diagnostics
presentation is the Project Diagnostics view's excerpt management,
because it needs to implement the deferred updates in order to avoid
disrupting the user while they may be typing. I want to take some steps
to reduce the potential for bugs in this view.
* [x] Reduce the amount of state that the view uses, and simplify its
implementation
* [x] Add a randomized test that checks the invariant that a mutated
diagnostics view matches a freshly computed diagnostics view
## Release Notes
- Reworked the project diagnostics view:
- Fixed an issue where the project diagnostics view could update its
excerpts while you were typing in it.
- Fixed bugs where the project diagnostics view could show the wrong
excerpts.
- Changed the diagnostics view to always update its excerpts eagerly
when not focused.
- Added an indicator to the project diagnostics view's toolbar, showing
when diagnostics have been changed.
---------
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
Switches Assistant2 to always provide functions. It's up to the model to
choose to use them. At a later point, the `Submit::Codebase` should
change the `tool_choice` to `query_codebase` rather than `auto`. For
now, I think this will improve the experience for folks testing.
Release Notes:
- N/A
- Centralizes typography-related UI styles and methods in
`styles/typography.rs`
- Breaks the typography-related styles out of `StyledExt`. This means we
add a `StyledTypography` trait – this should more or less be an
invisible change as we publish it in the prelude.
- adds the ability to easily grab the UI or Buffer font sizes
(`ui_font_size`, `buffer_font_size`) with `TextSize::UI`,
`TextSize::Editor`
Release Notes:
- N/A
Currently in the *Auto Height Editor* story the backspace key is not
working when you type into the Editor.
The same thing is true for the *Picker* story as one is not able to
backspace...
By adding an entry in the keymap file
```rust
assets/keymaps/storybook.json
```
both of these issues are solved...
Release Notes:
- N/A
This PR adds the ability for the Tailwind language server
(`tailwindcss-language-server`) to be controlled by the
`language_servers` setting.
Now in your settings you can indicate that the Tailwind language server
should be used for a given language, even if that language does not have
the Tailwind language server registered for it already:
```json
{
"languages": {
"My Language": {
"language_servers": ["tailwindcss-language-server", "..."]
}
}
}
```
Release Notes:
- N/A
Creates a `ToolView` trait to allow interactivity. This brings expanding
and collapsing to the excerpts from project index searches.
Release Notes:
- N/A
---------
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Adds additional captures for theming rust code.
I'm uncertain about whether `#` belongs in the `@operator` capture, but
I didn't see a more appropriate capture name in my brief hunt in other
files. It is the prefix of an `attribute_item`.. suggestions welcome.
Release Notes:
- Added `@operator`, `@lifetime` and `@punctuation.delimiter` captures
to Rust highlights file.
This PR extracts Elixir support into an extension and removes the
built-in Elixir support from Zed.
As part of this, [Lexical](https://github.com/lexical-lsp/lexical) has
been added as an available language server for Elixir.
Since the Elixir extension provides three different language servers,
you'll need to use the `language_servers` setting to select the one you
want to use:
#### Elixir LS
```json
{
"languages": {
"Elixir": {
"language_servers": [ "elixir-ls", "!next-ls", "!lexical", "..."]
}
}
}
```
#### Next LS
```json
{
"languages": {
"Elixir": {
"language_servers": [ "next-ls", "!elixir-ls", "!lexical", "..."]
}
}
}
```
#### Lexical
```json
{
"languages": {
"Elixir": {
"language_servers": [ "lexical", "!elixir-ls", "!next-ls", "..."]
}
}
}
```
These can either go in your user settings or your project settings.
Release Notes:
- Removed built-in support for Elixir, in favor of making it available
as an extension.
Exclude go-to-definition links returned by LSP that points to the
current cursor position. This fixes#10392 . Related PR #9243 .
The previous implementation first performs go-to-definition, and if the
selected text covers the clicked position, it figures out that it is
already clicking on a definition, and should instead look for
references.
However, the selected range does not necessarily cover the clicked
position after clicking on a definition, as in VIM mode.
After the PR, if cmd+click on definitions, the definition links would be
an empty list, so no go-to-definition is performed, and
find-all-references is performed instead.
Release Notes:
- Fixed#10392 , now `cmd+click`ing to find all references works in vim
mode.
This was introduced with #10979 and was caused by a missing call to
`cx.set_view_id` in `EditorElement`, which is necessary when rendering
`EditorElement` manually instead of via a view.
Release Notes:
- N/A
[PKGBUILD] is a file used in the build system of arch linux, and it is
basically just a bash script with special functions.
Release Notes:
- Changed `PKGBUILD` files to be recognized as bash.
If the assistant has already emitted some text, we will leave the
assistant message but maintain the cursor on the previous user message,
so that the user can easily discard the message by submitting again.
If no output was emitted yet, we simply delete the empty assistant
message.
Release Notes:
- N/A
This PR reverts #10740, as it makes it too easy to close Zed
accidentally.
Quitting Zed when you don't mean to is disruptive and can break your
flow. This is even more the case when you're collaborating.
Therefore, we shouldn't make it easy to quit Zed when you don't mean to.
If we want to bring back this behavior it needs to have a corresponding
setting that should, in my opinion, be **off** by default. Additionally,
someone made the good point that this behavior should not be present on
Linux or Windows.
This reverts commit 5102e37a5b.
Release Notes:
- Changed `cmd-w` with no open tabs to no longer close the window
(preview-only).
This fixes#9934 and does two things:
1. It registers ESLint as a secondary language server for Vue.js files
(`.vue`)
2. It registers ESLint as a _secondary_ (instead of primary) language
server for TypeScript, JavaScript and TSX.
The second point because I don't see any reason why ESLint should be
registered as a primary language server for these languages. I read
through the code in `project.rs` that uses the primary language server
and I don't think there will be any differences to how it previously
worked.
I also manually tested ESLint support in a Vue.js project, a Next.js
project and a plain old JS project — still works in all three.
Release Notes:
- Added ESLint support for Vue.js files by starting it as a language
server on `.vue` files.
([#9934](https://github.com/zed-industries/zed/issues/9934)).
The new `ElementContext` was originally introduced to ensure the element
APIs could only be used inside of elements. Unfortunately, there were
many places where some of those APIs needed to be used, so
`WindowContext::with_element_context` was introduced, which defeated the
original safety purposes of having a specific context for elements.
This pull request merges `ElementContext` into `WindowContext` and adds
(debug) runtime checks to APIs that can only be used during certain
phases of element drawing.
Release Notes:
- N/A
---------
Co-authored-by: Nathan Sobo <nathan@zed.dev>
now correctly retrieves range in cases where escape characters are
present. Fixed#10827
Release Notes:
- vim: Fix logic for finding surrounding quotes to ignore escaped
characters (#10827)
This PR addresses some issues I ran into with the way we draft release
notes in CI when doing builds.
The first issue I encountered was that `script/draft-release-notes` was
failing, seemingly due to CI doing a shallow Git checkout and not having
all of the tags available in order to compare then. This was addressed
by setting the `fetch-depth` during the Git checkout.
The second issue is that (in my opinion) we shouldn't fail the build if
drafting release notes fails. After well, we're doing it as a
convenience to ourselves, and it isn't a mandatory part of the build.
This was addressed by making any failures in
`script/draft-release-notes` not fail the CI step as a whole.
These changes were already applied to the `v0.133.x` branch.
Release Notes:
- N/A
Release Notes:
- N/A
Picks up https://github.com/kvark/blade/pull/113 and a bunch of other
fixes.
Should prevent the exclusive full-screen on Vulkan - related to #9728
cc @kazatsuyu
Note: this PR doesn't enable transparency, this is left to follow-up
On my computer, I get `Yahei UI`, which makes sense since I'm using a
Chinese operating system, and `Yahei UI` includes Chinese codepoints. On
an English operating system, `Segoe UI` should be used instead.
Edit: I also choose to use the UI font selected by the system as the
fallback font, rather than hard-coding the `Arial` font.
Release Notes:
- N/A
use winresource for crates/zed and crates/storybook. tested on
`x86_64-pc-windows-gnu`. on `x86_64-pc-windows-msvc` I receive a error
message, that looks like a problem with my machine
Release Notes:
- N/A
This PR fixes the way we select the primary language server for use with
formatting.
Previously we were just taking the first one in the list, but this could
be the wrong one in cases where a language server was provided by an
extension in conjunction with a built-in language server (e.g.,
Tailwind).
We now use the `primary_language_server_for_buffer` method to more
accurately identify the primary one.
Fixes https://github.com/zed-industries/zed/issues/10902.
Release Notes:
- Fixed an issue where the wrong language server could be used for
formatting.
This PR adds a new log message indicating which language servers will be
started for a given language.
The aim is to make debugging the usage of the new `language_servers`
setting (#10911) easier.
Release Notes:
- N/A
This removes the manual calls to `scroll_to_reveal_item` in the new
assistant, as they are superseded by the new autoscrolling behavior of
the `List` when the editor requests one.
Release Notes:
- N/A