If specifying a formatter in the settings like this:
"languages": {
"foo": {
"formatter": {
"external": {
"command": "/path/to/foo-formatter"
}
}
}
}
Zed will show an error like this:
Invalid user settings file
data did not match any variant of untagged enum SingleOrVec
This is because the arguments are not optional. The error is hard to
understand, so let's make the arguments actually optional, which makes
the above settings snippet valid.
Release Notes:
- Make external formatter arguments optional
We are going to use this in the multi-buffer to produce a summary for an
`Excerpt` that contains a `Range<Anchor>`.
Release Notes:
- N/A
Co-authored-by: Nathan <nathan@zed.dev>
Before this change, `use_on_type_format` would only have an effect when
defined on a global level in our settings.
But our default.json settings would also document that it's used in
language settings, i.e.:
```json
{
"languages": {
"C": {
"use_on_type_format": false
},
"C++": {
"use_on_type_format": false
}
}
}
```
But this did **not** work.
With the change, it now works globally and per-language.
Release Notes:
- Fixed `use_on_type_format` setting not working when defined inside
`"languages"` in the settings. This change will now change the default
behavior for C, C++, and Markdown, by turning language server's
`OnTypeFormatting` completions off by default.
Co-authored-by: Bennet <bennet@zed.dev>
This PR adds some more functionality to the Proposed Changes Editor
view, which we'll be using in
https://github.com/zed-industries/zed/pull/18240 for allowing the
assistant to propose changes to a set of buffers.
* Add an `Apply All` button, and fully implement applying of changes to
the base buffer
* Make the proposed changes editor searchable
* Fix a bug in branch buffers' diff state management
Release Notes:
- N/A
Release Notes:
- Fixed overriding the path of a language server binary for all language
servers. `{"lsp":{"<lsp-name>":{"binary":{"path": "_"}}}}` will now work
for all language servers including those defined by extensions.
- (breaking change) To disable finding lsp adapters in your path, you
must now specify
`{"lsp":{"<lsp-name>":{"binary":{"ignore_system_version": true}}}}`.
Previously this was `{"lsp":{"<lsp-name>":{"binary":{"path_lookup":
false}}}}`. Note that this setting still does not apply to extensions.
- Removed automatic reinstallation of language servers. (It mostly
didn't work)
---------
Co-authored-by: Mikayla <mikayla@zed.dev>
Release Notes:
- (Potentially breaking change) Zed will now use the node installed on
your $PATH (if it is more recent than v18) instead of downloading its
own. You can disable the new behavior with `{"node":
{"disable_path_lookup": true}}` in your settings. We do not yet use
system/project-local node_modules.
---------
Co-authored-by: Mikayla <mikayla@zed.dev>
Fixed a bug where the `always_treat_brackets_as_autoclosed` option would
not display the message in the tooltip that appears when hovering.
Release Notes:
- N/A
This pushes the new LanguageServerName type to more places.
As both languages and language servers were identified by Arc<str>, it
was
sometimes hard to tell which was intended.
Release Notes:
- N/A
This PR introduces functionality for creating *branches* of buffers that
can be used to preview and edit change sets that haven't yet been
applied to the buffers themselves.
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
This PR improves the `editor::Rewrap` command when working with comments
that were not all at the same indentation level.
We now use a heuristic of finding the most common indentation level for
each line, using the deepest indent in the event of a tie.
It also removes an `.unwrap()` that would previously lead to a panic in
this case. Instead of unwrapping we now log an error to the logs and
skip rewrapping for that selection.
Release Notes:
- Improved the behavior of `editor: rewrap` when working with a
selection that contained comments at different indentation levels.
This fixes the bug with hover tooltips appearing multiple times.
Turns out everytime we receive the `CreateLanguageServer` message we'd
add a new adapter but only have a single server running for all of them.
And we send a `CreateLanguageServer` message everytime you open a
buffer.
What this does is to only add a new adapter if it hasn't already been
registered, which is also what we do locally.
Release Notes:
- N/A
Closes#16876
We only ever showed parsing errors, but not if something failed to
deserialize.
Basically, if you had a stray `,` somewhere, we'd show a notification
for user errors, but only squiggly lines if you had a `[]` instead of a
`{}`.
The squiggly lines would only show up when there were schema errors.
In the case of `formatter` settings, for example, if someone put in a
`{}` instead of `[]`, we'd never show anything.
With this change we always show a notification if parsing user or
project settings fails.
(Right now, the error message might still be bad, but that's a separate
change)
Release Notes:
- Added a notification to warn users if their user settings or
project-local settings failed to deserialize.
Demo:
https://github.com/user-attachments/assets/e5c48165-f2f7-4b5c-9c6d-6ea74f678683
This PR makes the `Buffer::apply_ops` method infallible for
`text::Buffer` and `language::Buffer`.
We discovered that `text::Buffer::apply_ops` was only fallible due to
`apply_undo`, which didn't actually need to be fallible.
Release Notes:
- N/A
This PR adds the ability to display backgrounds for inlay hints within
the editor.
This is controlled by the new `inlay_hints.show_background` setting.
This setting defaults to `false`.
To enable the setting, add the following to your `settings.json`:
```json
{
"inlay_hints": {
"enabled": true,
"show_background": true
}
}
```
When enabled, the inlay hint backgrounds will use the `hint.background`
color from the theme.
| Disabled | Enabled |
|
--------------------------------------------------------------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------------------------------------------------------------
|
| <img width="1624" alt="Screenshot 2024-09-17 at 4 21 53 PM"
src="https://github.com/user-attachments/assets/5534d09b-1e22-4c6f-9d82-314796ed7d22">
| <img width="1624" alt="Screenshot 2024-09-17 at 4 21 43 PM"
src="https://github.com/user-attachments/assets/6ec58cde-6115-4db4-be95-97c5f2f54b2d">
|
Related issues:
- #12485
- #17392
Release Notes:
- Added an `inlay_hints.show_background` setting to allow displaying
backgrounds for inlay hints in the editor.
- This setting defaults to `false`.
- If enabled, the inlay hint backgrounds will use the `hint.background`
color from the theme.
This lets us provide a context when constructing the zero value. We need
it so we can require anchors to be associated with a buffer id, which
we're doing as part of simplifying the multibuffer API.
Release Notes:
- N/A
Co-authored-by: Nathan <nathan@zed.dev>
Fixes https://github.com/zed-industries/zed/issues/5291
Release Notes:
- Fixed a bug where the 'toggle comments' command didn't use the right
comment syntax in JSX and TSX elements.
---------
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Demo:
https://github.com/user-attachments/assets/6acb6c1e-bb15-4205-9dcb-2aa4bb99dcf9
Release Notes:
- When using `OpenFile` (`gf` in Vim mode) and the word under the cursor
is not an existing file path, we now fall back and additionally check
whether a file called
`<word-under-cursor>.<language-specific-path-suffixes>` exists. That's
similar to Vim's `suffixesadd` option.
---------
Co-authored-by: Abdelhakim Qbaich <abdelhakim@qbaich.com>
Co-authored-by: Pete LeVasseur <plevasseur@gmail.com>
We would log every time we'd lookup a language server for a file and
we'd also log "starting language server" even though we were about to
only download it and not start it.
Release Notes:
- N/A
This PR disables definition list support in `pulldown_cmark`, as it is
has been causing a number of issues.
I opened an issue upstream with the panic we were seeing:
https://github.com/pulldown-cmark/pulldown-cmark/issues/957.
Release Notes:
- N/A
Co-Authored-By: Mikayla <mikayla@zed.dev>
Co-Authored-By: Nate <nate@zed.dev>
Closes#15606Closes#13515
Release Notes:
- Fixes `-` being considered a word character for selections in some
languages
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Nate <nate@zed.dev>
/cc @mrnugget
Release Notes:
- Fixed an issue where toggling inline completions in a markdown file
did not work correctly
---------
Co-authored-by: Marshall <marshall@zed.dev>
## Todo
* [x] Parse and present new XML output
* [x] Resolve new edits to buffers and anchor ranges
* [x] Surface resolution errors
* [x] Steps fail to resolve because language hasn't loaded yet
* [x] Treat empty `<symbol>` tag as None
* [x] duplicate assists when editing steps
* [x] step footer blocks can appear *below* the following message header
block
## Release Notes:
- N/A
---------
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Peter <peter@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
This changes the Zed CLI `zed` to pass along the environment to the Zed
project that it opens (if it opens a new one).
In projects, this CLI environment will now take precedence over any
environment that's acquired by running a login shell in a projects
folder.
The result is that `zed my/folder` now always behaves as if one would
run `zed --foreground` without any previous Zed version running.
Closes#7894Closes#16293
Related issues:
- It fixes the issue described in here:
https://github.com/zed-industries/zed/issues/4977#issuecomment-2305272027
Release Notes:
- Improved the Zed CLI `zed` to pass along the environment as it was on
the CLI to the opened Zed project. That environment is then used when
opening new terminals, spawning tasks, or language servers.
Specifically:
- If Zed was started via `zed my-folder`, a terminal spawned with
`workspace: new terminal` will inherit these environment variables that
existed on the CLI
- Specific language servers that allow looking up the language server
binary in the environments `$PATH` (such as `gopls`, `zls`,
`rust-analyzer` if configured, ...) will look up the language server
binary in the CLI environment too and use that environment when starting
the process.
- Language servers that are _not_ found in the CLI environment (or
configured to not be found in there), will be spawned with the CLI
environment in case that's set. That means users can do something like
`RA_LOG=info zed .` and it will be picked up the rust-analyzer that was
spawned.
Demo/explanation:
https://github.com/user-attachments/assets/455905cc-8b7c-4fc4-b98a-7e027d97cdfa
This PR fixes a regression from
https://github.com/zed-industries/zed/pull/15646 where we've started
fetching diagnostic spans unconditionally (whereas previously that
wasn't done when iterating over raw text).
Closes#16764
Release Notes:
- Fixed performance regression in handling buffers with large quantities
of diagnostics.
This allows us to detect the language from the extension if we use paths
in fenced code blocks.
Release Notes:
- You can now use file paths ending in a language-specific file
extension at the start of markdown code blocks.
Closes#14700#8164
Release Notes:
- Added `soft_wrap` value `bounded`,EditorWidth and PreferredLineLength
min value
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>