Closes: #25556
We were always comparing `disabled_globs` against the relative file
path, we'll now use the absolute path if the glob is also absolute.
Release Notes:
- Support absolute globs in `edit_predictions.disabled_globs`
Closes#25471
In languages like Swift, names can be concatinated in form like `class
Example: UI`, notice here `Example` and `:` are two different words.
Before, `name_ranges`translation of above text would look like:
```
"class" -> [0..5]
" Example" -> [5..13] (Spaces are intentional)
"e:" -> [12..14] (This is incorrect, and should be ":" -> [13..14])
" UI" -> [14..16]
```
Because this translation does not account for concatinated words, this
might affect queries, but most importantly this panics when multi-byte
character (`ф`) is used in place of `e`, as it then tries to access
index which lies inside that multi-byte. For example, it panics on
`class Examplф: UI`.
---
This PR fixes this by handing concatinated words when calculating
`name_ranges`.
Now, the corrected ranges will look like:
```
"class" -> [0..5]
" Example" -> [5..13]
":" -> [13..14] (Now it's correct)
" UI" -> [14..16]
```
and for multi-byte character
```
"class" -> [0..5]
" Examplф" -> [5..14] (Notice ф takes two bytes)
":" -> [14..15]
" UI" -> [15..17]
```
This way, it no longer tries to access a previous index, preventing a
panic when that index contains a multi-byte character.
Release Notes:
- Fixed a panic when Cyrillic characters are used in languages like
Swift.
This PR makes `auto` an alias for the `subtle` edit prediction mode.
Right now I'm in a state where I can't have valid settings in both
development and Nightly because the settings values are disparate.
Release Notes:
- N/A
* When staging in a buffer whose file has been deleted, do not save the
file
* Fix logic for writing to index when file is deleted
Release Notes:
- N/A
Closes#6701 (one of the top ranking issues as of writing)
Adds the ability to specify an HTTP/HTTPS proxy to route Copilot code
completion API requests through. This should fix copilot functionality
in restricted network environments (where such a proxy is required) but
also opens up the ability to point copilot code completion requests at
your own local LLM, using e.g.:
- https://github.com/jjleng/copilot-proxy
- https://github.com/bernardo-bruning/ollama-copilot/tree/master
External MITM-proxy tools permitting, this can serve as a stop-gap to
allow local LLM code completion in Zed until a proper OpenAI-compatible
local code completions provider is implemented. With this in mind, in
this PR I've added separate `settings.json` variables to configure a
proxy server _specific to the code completions provider_ instead of
using the global `proxy` setting, to allow for cases like this where we
_only_ want to proxy e.g. the Copilot requests, but not all outgoing
traffic from the application.
Currently, two new settings are added:
- `inline_completions.copilot.proxy`: Proxy server URL (HTTP and HTTPS
schemes supported)
- `inline_completions.copilot.proxy_no_verify`: Whether to disable
certificate verification through the proxy
Example:
```js
"features": {
"inline_completion_provider": "copilot"
},
"show_completions_on_input": true,
// New:
"inline_completions": {
"copilot": {
"proxy": "http://example.com:15432",
"proxy_no_verify": true
}
}
```
Release Notes:
- Added the ability to specify an HTTP/HTTPS proxy for Copilot.
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Closes#12064
It feels a bit strange to use `brackets` for this but it seems to work
without unintended consequences from my testing so far.
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Closes https://github.com/zed-industries/zed/issues/10122
Closes https://github.com/zed-industries/zed/issues/25034
When formatting buffers or reloading them after they change on disk, we
performed a diff between the buffer's current contents and the new
content. We need this diff in order preserve the positions of cursors
and other decorations when updating the buffer's text.
In order to handle changes within lines, we would previously compute a
*character-wise* diff. This was extremely expensive for large files.
This PR gets rid of the character-wise diff, and instead performs a
normal line-wise diff. Then, for certain replace hunks, we compute a
secondary word-based diff. Also, I've switched to the
[`imara-diff`](https://github.com/pascalkuthe/imara-diff) crate, instead
of `similar`.
Release Notes:
- Fixed a hang that could occur when large files were changed on disk or
formatted.
This PR adds a new `allow_rewrap` setting to control how
`editor::Rewrap` behaves for a given language.
This is a language setting, so it can either be configured globally or
within the context of an individual language.
For example:
```json
{
"allow_rewrap": "in_selections",
"languages": {
"Typst": {
"allow_rewrap": "anywhere"
}
}
}
```
There are three different values:
- `in_comment`: Only perform rewrapping within comments.
- `in_selections`: Only perform rewrapping within the current
selection(s).
- `anywhere`: Allow rewrapping anywhere.
The global default is `in_comment`, as it is the most conservative
option and allows rewrapping comments without risking breaking other
syntax.
The `Markdown` and `Plain Text` languages default to `anywhere`, which
mirrors the previous behavior for those language that was hard-coded
into the rewrap implementation.
This setting does not have any effect in Vim mode, as Vim mode already
allowed rewrapping anywhere.
Closes https://github.com/zed-industries/zed/issues/24242.
Release Notes:
- Added an `allow_rewrap` setting to control the `editor::Rewrap`
behavior for a given language.
The language::markdown crate had been superceded by markdown::Mardown.
After #25117, the only two remaining use-cases were rendering git commit
messages (which are arguably not really markdown) and the signature help
(which is definitely not markdown).
Updated the former to use the new markdown component, and the latter to
do syntax highlighting manually.
Release Notes:
- Allow selecting the commit message in git commits
This reverts commit 9ef0501853 due to a
panic.
```
{
"thread": "main",
"payload": "9 is not a valid char boundary in path \"crates/…/LiveKitBridge/\"",
"location_data": {
"file": "crates/file_finder/src/file_finder.rs",
"line": 646
}
}
```
Release Notes:
- N/A
Closes#18641
Contributes: #13194
Release Notes:
- Open LSP documentation file links in Zed not the system opener
- Render completion documentation markdown consistently with
documentation markdown
Done automatically with
> ast-grep -p '$A.background_executor().spawn($B)' -r
'$A.background_spawn($B)' --update-all --globs "\!crates/gpui"
Followed by:
* `cargo fmt`
* Unexpected need to remove some trailing whitespace.
* Manually adding imports of `gpui::{AppContext as _}` which provides
`background_spawn`
* Added `AppContext as _` to existing use of `AppContext`
Release Notes:
- N/A
This PR makes progress on #7711 by identifying any common prefix of the
paths in the file finder's search results, and replacing the "interior"
of that prefix---every path segment but the first and last---with `...`,
when a heuristic indicates that the longest path would otherwise
overflow the modal.
The elision is not applied to any segment that contains a match for the
search query.
There may be more work to do on #7711 in the case of long result paths
that do not share a significant common prefix.
Release Notes:
- Improved display of long paths in the file finder modal
Co-authored-by: Max <max@zed.dev>
Release Notes:
- Fixed a panic when displaying a whitespace-only line in the edit
prediction preview
---------
Co-authored-by: Antonio <antonio@zed.dev>
This PR does some clean up for the edit predictions settings:
- Removed `editor.show_edit_predictions_in_menu`
- Renamed `edit_predictions.inline_preview` to `edit_predictions.mode`
Release Notes:
- N/A
---------
Co-authored-by: Agus Zubiaga <agus@zed.dev>
We've seen a few crashes in `SyntaxSnapshot::reparse_with_ranges` during
`Buffer::preview_edits`, where an offset conversion fails because it is
out of range.
We are not sure how exactly this is happening.
Our theory is that the syntax snapshot is using an outdated state when
edits happen in the meantime (while interpolating). This is an attempt
to see if it helps with the panics, hopefully we can revisit this when
we have a better understanding of the issue.
Co-Authored-by: Antonio <antonio@zed.dev>
Release Notes:
- N/A
Co-authored-by: Antonio <antonio@zed.dev>
I didn't update it to 0.25 because its Wasm support seems to be
partially broken due to
https://github.com/tree-sitter/tree-sitter/pull/3938: it didn't
introduce a check that the Wasm module's ABI is new enough to include
supertype info while parsing it, and so in the case where it isn't it
ends up interpreting random bytes as the number of supertypes, causing
out-of-bounds memory accesses.
Closes#24489
Release Notes:
- Fixed a rare crash during syntax highlighting
This PR clarifies how the `disabled_globs` work.
Release Notes:
- N/A
---------
Co-authored-by: Bennet Bo Fenner <53836821+bennetbo@users.noreply.github.com>
- [x] snake case keymap properties
- [x] flatten actions
- [x] keymap migration + notfication
- [x] settings migration + notification
- [x] inline completions -> edit predictions
### future:
- keymap notification doesn't show up on start up, only on keymap save.
this is existing bug in zed, will be addressed in seperate PR.
Release Notes:
- Added a notification for deprecated settings and keymaps, allowing you
to migrate them with a single click. A backup of your existing keymap
and settings will be created in your home directory.
- Modified some keymap actions and settings for consistency.
---------
Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
- **fix ignoring ignored files when matching icons**
- **remove poorly named and confusing method
`PathExt.icon_stem_or_suffix` and refactor
`PathExt.extension_or_hidden_file_name` to actually do what it says it
does**
Closes#24314
Release Notes:
- Fixed an issue where hidden files would have the default icon instead
of the correct one
- Fixed an issue where files with specific icons (such as
`eslint.config.js`) would not have the their specific icon without a
leading `.` (`.eslint.config.js`)
This PR makes it so we send up the diagnostic groups as additional data
with the edit prediction request.
We're not yet making use of them, but we are recording them so we can
use them later (e.g., to train the model).
Release Notes:
- N/A
---------
Co-authored-by: Nathan <nathan@zed.dev>
This PR adds a new `inline_completions.inline_preview` config which can
be set to `auto` (current behavior) or to `when_holding_modifier`.
When set to the latter, instead of showing edit prediction previews
inline in the buffer, we'll show it in a popover (even when there's no
LSP completion) so your isn't constantly moving as completions arrive.
https://github.com/user-attachments/assets/3615d151-3633-4ee4-98b9-66ee0aa735b8
Release Notes:
- N/A
---------
Co-authored-by: Danilo <danilo@zed.dev>
- **store `buffer::Diagnostic`as NumberOrString instead of assuming
String**
- **update zed-industries/lsp-types rev**
Closes#24081
Release Notes:
- Fixed an issue where language server diagnostic codes would be converted to strings leading to errors with some language servers
* fix syntax highlighting of deleted text when buffer language changes
* do not highlight entire untracked files as created, except in the
project diff view
Release Notes:
- N/A
Co-authored-by: ConradIrwin <conrad.irwin@gmail.com>
Co-authored-by: cole-miller <m@cole-miller.net>
This PR builds on #21258 to make it possible to use HEAD as a diff base.
The buffer store is extended to support holding multiple change sets,
and collab gains support for synchronizing the committed text of files
when any collaborator requires it.
Not implemented in this PR:
- Exposing the diff from HEAD to the user
- Decorating the diff from HEAD with information about which hunks are
staged
`test_random_multibuffer` now fails first at `SEED=13277`, similar to
the previous high-water mark, but with various bugs in the multibuffer
logic now shaken out.
Release Notes:
- N/A
---------
Co-authored-by: Max <max@zed.dev>
Co-authored-by: Ben <ben@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Conrad <conrad@zed.dev>
Note that this does *not* involve any breaking code changes.
cc @0xtimsb - I didn't change any settings or anything here. That can
happen separately!
Release Notes:
- N/A
We now treat new files that have no content as not-dirty. This fixes the
git diff view when deleted files are present.
It also fixes a long-standing bug where `zed RAEDME` and then closing
the tab would prompt for "unsaved changes" when there were none.
Release Notes:
- Fixed a bug where closing an empty, named, file would warn about
unsaved content.
- Fixes auto-indent issues around `elif` caused by auto-indent being prevented due to syntax errors generated before `elif` clause completed
Release Notes:
- Fixed an issue where inserting an elif before an else in bash would
not properly auto-indent
---------
Co-authored-by: Conrad Irwin <conrad@zed.dev>
This ensures that the following files are always ignored:
```
"**/.env*"
"**/*.pem"
"**/*.key"
"**/*.cert"
"**/*.crt"
"**/secrets.yml"
```
Release Notes:
- N/A