This lets Go programmers configure `"code_actions_on_format": {
"source.organizeImports": true,
}` so that they don't have to manage their imports manually
I landed on `code_actions_on_format` instead of `code_actions_on_save`
(the
VSCode version of this) because I want to run these when I explicitly
format
(and not if `format_on_save` is disabled).
Co-Authored-By: Thorsten <thorsten@zed.dev>
Release Notes:
- Added `"code_actions_on_format"` to control additional formatting
steps on format/save
([#5232](https://github.com/zed-industries/zed/issues/5232)).
- Added a `"code_actions_on_format"` of `"source.organizeImports"` for
Go ([#4886](https://github.com/zed-industries/zed/issues/4886)).
Co-authored-by: Thorsten <thorsten@zed.dev>
This is a follow-up to #7768 but now also fixes#5211.
Explanation is relatively simple: case-only renames previously failed
because while Zed would think that `foobar` and `FOOBAR` are different,
the filesystem would give us an file-already-exists error when renaming.
So what we're doing here is to check whether we're on a case-insensitive
filesystem and if so, we overwrite the old file.
Release Notes:
- Fixed case-only renaming of files in project panel.
([#5211](https://github.com/zed-industries/zed/issues/5211)).
Proof:
https://github.com/zed-industries/zed/assets/1185253/57d5063f-09d9-47b1-a2df-3d7edefca97d
This fixes#5211 and #7732 by fixing the case-only file renaming.
The fix here works by checking hooking into function that produces the
data to populate the project panel.
It checks whether we're on a case-insensitive file system (default on
macOS, but you can have case-sensitive FS on macOS too) and if so, it
ignores the metadata for files for which the absolute path (returned by
the FS scanner) and canonicalized path do NOT match.
That's the case for (a) symlinks and (b) case-only renames of files.
It only does this check for case-only renames.
Release Notes:
- Fixed case-only renaming of files producing duplicate entries in
project panel.
([#5211](https://github.com/zed-industries/zed/issues/5211)).
Co-authored-by: Antonio <antonio@zed.dev>
Current limitations:
* Not able to navigate into JAR files
Release Notes:
- Added Clojure language support
---------
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Previously we only looked at the global settings, this changes that to
start looking in local settings first and then fall back to global ones.
Fixes#4279.
Release Notes:
- Fixed language server configurations not being picked up from local,
worktree-specific settings.
([#4279](https://github.com/zed-industries/zed/issues/4279)).
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Bennet <bennetbo@gmx.de>
This is a refactor, follow-up to the work we've been doing on loading
WASM language extensions.
Release Notes:
- N/A
---------
Co-authored-by: Marshall <marshall@zed.dev>
This PR adds the initial support for loading extensions in Zed.
### Extensions Directory
Extensions are loaded from the extensions directory.
The extensions directory has the following structure:
```
extensions/
installed/
extension-a/
grammars/
languages/
extension-b/
themes/
manifest.json
```
The `manifest.json` file is used internally by Zed to keep track of
which extensions are installed. This file should be maintained
automatically, and shouldn't require any direct interaction with it.
Extensions can provide Tree-sitter grammars, languages, and themes.
Release Notes:
- N/A
---------
Co-authored-by: Marshall <marshall@zed.dev>
The way Rust generics works, having a generic argument puts the burden of codegen on the crate that instantiates a generic function, which in our case is an editor.
Based on the great work in
https://github.com/zed-industries/zed/pull/7130 , now sends this data
```
[crates/lsp/src/lsp.rs:588] ClientInfo { name: name.to_string(), version: Some(version.to_string()) } = ClientInfo {
name: "Zed Dev",
version: Some(
"0.122.0",
),
}
```
with every LSP server initialization.
Release Notes:
- Added Zed name and version to LSP InitializeParams requests
- Disallow sharing gitignored files through collab
- Show errors when failing to open files
- Show a warning to followers when view is unshared
/cc @mikaylamaki, let's update this to use your `private_files` config
before merge.
Release Notes:
- Added the ability to prevent sharing private files over collab.
---------
Co-authored-by: Piotr <piotr@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
Release Notes:
- Added bash syntax highlighting to `.env` files.
- Added a `private_files` setting for configuring which files should be
considered to contain environment variables or other sensitive
information.
- Added a `redact_private_values` setting to add or remove censor bars
over variable values in files matching the `private_files` patterns.
-(internal) added a new `redactions.scm` query to our language support,
allowing different config file formats to indicate where environment
variable values can be identified in the syntax tree, added this query
to `bash`, `json`, `toml`, and `yaml` files.
---------
Co-authored-by: Nathan <nathan@zed.dev>
Somehow (and this should be investigated separately) we're ending up
with paths that look like: /path/to/project/../../path/to/dependency,
these pass the Ok(repo_path) = path.strip_prefix(), but then fail.
Release Notes:
- Fixed (hopefully) a panic that could occur due to path confusing in
git status
This PR sorts the dependency lists in our `Cargo.toml` files so that
they are in alphabetical order.
This should make them easier to visually scan when looking for a
dependency.
Apologies in advance for any merge conflicts 🙈
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
JSON LSP adapter now caches the schema. `workspace_configuration` is
back to being async, and we are also no longer asking for font names
twice while constructing the schema.
Release Notes:
- Improved performance when opening the .json files.
---------
Co-authored-by: Kirill <kirill@zed.dev>
The activate.nu file works a little differently than it's counterparts in other shells, and it needs to be invoked as an overlay, rather than sourced directly into the shell.
This fixes an outstanding issues left over from #6323.
This restores the ability for project guests to see documentation on
autocomplete suggestions.
@ForLoveOfCats This code might have gotten lost during the GPUI upgrade.
I'm not sure what happened. I tested this locally, and it seems to fix
completion docs for guests. Could you 👀 and see if there are any tests
or any other code that got lost along with this during the upgrade?
We saw a panic that was caused by the previous `Option.unwrap()`, so
this changes the method to return a `Result` and logs the error if
possible.
Co-authored-by: Antonio <antonio@zed.dev>
- [x] Fill in GPL license text.
- [x] live_kit_client depends on live_kit_server as non-dev dependency,
even though it seems to only be used for tests. Is that an issue?
Release Notes:
- N/A
Fixes
* LSP servers never being shut down on worktree release
* worktrees (and LSP servers) being re-created for settings files on
every opening
Also,
* removes `async` from `workspace_configuration` to simplify the code:
we only return static configurations now
Release Notes:
- Fixed excessive LSP server creation for Zed settings files
Before this change a diagnostic message with a trailing newline (e.g.
`line1\nline2\n`) would be rendered in a `Block` with `line_height: 2`.
But the content we then display in this block had 3 "lines", which
pushed the content out of the block.
This fixes the issue by trimming the newlines at the end from the
diagnostics.
Co-authored-by: Antonio <antonio@zed.dev>
This PR updates the tenses used by the summary line of doc comments to
match the [Rust API documentation
conventions](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#summary-sentence).
Specifically:
> The summary line should be written in third person singular present
indicative form. Basically, this means write ‘Returns’ instead of
‘Return’.
I'm sure there are plenty occurrences that I missed.
Release Notes:
- N/A