Commit Graph

14443 Commits

Author SHA1 Message Date
Conrad Irwin
d112bcfadf
Fix project subscription order (#8900)
Co-Authored-By: Antonio <as-cii@zed.dev>

Release Notes:

- Fixed a bug that prevents project joining

Co-authored-by: Antonio <as-cii@zed.dev>
2024-03-05 13:34:25 -07:00
Marshall Bowers
9e66d48ccd
Enable clippy::cmp_owned (#8899)
This PR enables the
[`clippy::cmp_owned`](https://rust-lang.github.io/rust-clippy/master/index.html#/cmp_owned)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-05 14:36:53 -05:00
Joseph T. Lyons
d98b61e3d6 Improve wording on recent projects placeholder instructions 2024-03-05 13:51:25 -05:00
Conrad Irwin
cfffa29f9a
Enable tokio-console (#8897)
Release Notes:

- Added tokio-console in production
2024-03-05 10:56:14 -07:00
白山風露
9a2ed4bf1a
Windows: use folders under AppData (#8828)
To be honest, I am not sure how to use these directories. But since it
is difficult to change these later, if we are going to change them, I
think it is time to do.

Release Notes:

- N/A
2024-03-05 09:48:27 -08:00
Marshall Bowers
b6af393e6d
Enable clippy::borrow_deref_ref (#8894)
This PR enables the
[`clippy::borrow_deref_ref`](https://rust-lang.github.io/rust-clippy/master/index.html#/borrow_deref_ref)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-05 12:24:54 -05:00
Marshall Bowers
22fe03913c
Move Clippy configuration to the workspace level (#8891)
This PR moves the Clippy configuration up to the workspace level.

We're using the [`lints`
table](https://doc.rust-lang.org/cargo/reference/workspaces.html#the-lints-table)
to configure the Clippy ruleset in the workspace's `Cargo.toml`.

Each crate in the workspace now has the following in their own
`Cargo.toml` to inherit the lints from the workspace:

```toml
[lints]
workspace = true
```

This allows for configuring rust-analyzer to show Clippy lints in the
editor by using the following configuration in your Zed `settings.json`:

```json
{
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "check": {
          "command": "clippy"
        }
      }
    }
  }
```

Release Notes:

- N/A
2024-03-05 12:01:17 -05:00
Dzmitry Malyshau
52f750b216
Update blade to latest: work around Intel+NVidia driver bug (#8811)
Picks up https://github.com/kvark/blade/pull/92
Should unblock some of the unhappy users.
Upstream bug - https://gitlab.freedesktop.org/mesa/mesa/-/issues/4688

Release Notes:
- N/A
2024-03-05 08:48:34 -08:00
Ezekiel Warren
36c4831806
windows: mouse and keyboard (#8791)
Windows mouse and keyboard working! I also tweaked the message loop so
that it didn't get stuck. The peek message loop was almost never
returning for me during testing.

Release Notes:

- Added windows mouse and keyboard support

![windows-mouse-and-keyboard](https://github.com/zed-industries/zed/assets/1284289/08578fbf-0cb2-4e44-bab1-3c4f0291ea4b)
2024-03-05 08:35:07 -08:00
Nathan Sobo
7c9f680b1b
Request more resources for collab pods on Kubernetes (#8890)
Worried that if we don't do this, they don't give us enough. We're
maxing out the pod's CPU but the node is barely sweating.

Release Notes:

- N/A
2024-03-05 09:15:08 -07:00
Thorsten Ball
2b8b913b6b
Use correct worktree when getting permalink to line (#8888)
Previously this code would call `project.visible_worktrees(cx).next`
which might not necessarily return the worktree matching the currently
open file.

What this change does is it adds `get_repo` method on `Project` that
allows us to get the `GitRepository` for the current buffer.

Release Notes:

- Fixed `open permalink to line` not working when multiple folders are
added to the project.

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-03-05 16:59:00 +01:00
Jason Lee
0b34b1de7b
Fix first/last item margin on scroll (#8880)
![output](https://github.com/zed-industries/zed/assets/5518/e39a3600-99c4-4d3c-baee-efd53a474f38)

Before:

https://github.com/zed-industries/zed/assets/5518/f7a4563a-504a-4a41-bfd4-21e9439cd02b

After:

https://github.com/zed-industries/zed/assets/5518/0ba41527-46fd-404f-8207-1b8c5cf37434


Release Notes:

- Fixed first and last item margin when scroll view has padding
2024-03-05 15:54:48 +02:00
Jason Lee
fae5e83d93
Fix all Picker Item cursor to use Pointer. (#8877)
Before:

https://github.com/zed-industries/zed/assets/5518/84874858-7847-4fa4-b7a3-41ecc65a2f7d

After: 

https://github.com/zed-industries/zed/assets/5518/d395ea96-aa26-4de1-8bfc-73cc43ee75cf


Release Notes:

- Made picker items to use `Pointer` cursor style
2024-03-05 11:32:57 +02:00
Jason Lee
6a268e959f
Improve VCS Menu header top margin. (#8879)
## Before

![SCR-20240305-nga](https://github.com/zed-industries/zed/assets/5518/e814d770-a5b1-4289-acc4-808bf7d96690)

![SCR-20240305-nge](https://github.com/zed-industries/zed/assets/5518/abba4f7c-7e6c-447f-8e4f-fbecdf802f62)

## After

![SCR-20240305-nfp](https://github.com/zed-industries/zed/assets/5518/5539b15c-c67d-466b-9c46-44e488788b04)

![SCR-20240305-nfu](https://github.com/zed-industries/zed/assets/5518/5cfdf861-b55c-4f1e-a41f-dcd42a449488)

Release Notes:

- Improve VCS Menu header top margin, and use `TextMuted` color for
matched count label.
2024-03-05 10:19:52 +01:00
Conrad Irwin
e0c66b30c8
Fix panic in enclosing bracket ranges (#8870)
This function was operating in the wrong co-ordinate space (c.f. #8081)

Release Notes:

- Fixed a panic on `ctrl-m` in a multibuffer
2024-03-04 21:27:01 -07:00
Conrad Irwin
27c5343707
hosted projects (#8627)
- **Allow joining a hosted project**

You can't yet do anything in a hosted project, but you can join it and
look how empty it is.

Release Notes:

- N/A
2024-03-04 19:17:40 -07:00
Quadri A. Adekunle
4167c66b86
macOS: Fix center window with fixed bounds size (#8475)
This PR fixes window showing up in the center of the monitor when
`center: true` option is provided.

The idea is to set the `window_wize` when creating the `window` using
`native_window.initWithContentRect_styleMask_backing_defer_screen_()`

Before: 

<img width="851" alt="SCR-20240227-qokf"
src="https://github.com/zed-industries/zed/assets/20229808/27494966-2e97-4771-8837-ccb6658ced78">

After:

<img width="1132" alt="SCR-20240227-qlmg"
src="https://github.com/zed-industries/zed/assets/20229808/439568da-d380-4331-8d19-cd501f211c4c">


Release Notes:

- N/A
2024-03-04 17:08:29 -07:00
Noritada Kobayashi
d223fe446d
vim: Add support for ap and ip paragraph text objects (#7687)
This PR adds support for `ap`/`ip` text objects in Vim mode and allows
users to perform paragraph-based operations.

Cases where compatibility with Neovim's behavior is checked, cases where
there are known differences in behavior with Neovim (cases where the
landing position is other than the beginning of the line), and cases
where the Neovim behavior in the test suite seems strange are separated
in the test code so that they can be identified.

Release Notes:

- Added support for `ap` and `ip` paragraph text objects in Vim mode
([#7359](https://github.com/zed-industries/zed/issues/7359)).
2024-03-04 16:39:02 -07:00
Conrad Irwin
f53823c840
Remove release channel from Zed URLs (#8863)
Also adds a new command `cli: Register Zed Scheme` that will cause URLs
to be opened in the current zed version, and we call this implicitly if
you install the CLI

Also add some status reporting to install cli

Fixes: #8857



Release Notes:

- Added success/error reporting to `cli: Install Cli`
([#8857](https://github.com/zed-industries/zed/issues/8857)).
- Removed `zed-{preview,nightly,dev}:` url schemes (used by channel
links)
- Added `cli: Register Zed Scheme` to control which zed handles the
`zed://` scheme (defaults to the most recently installed, or
the version that you last used `cli: Install Cli` with)
2024-03-04 16:08:47 -07:00
Piotr Osiewicz
2201b9b116
task: Add task contexts (#8675)
This PR supplements tasks with additional environment variables; ideally
we'll be able to write a task like:
`cargo test -p $ZED_CURRENT_PACKAGE -- $ZED_CURRENT_FUNCTION`
- [x] Flesh out multibuffer interactions
- [x] Add ZED_SYMBOL detection based on tree-sitter queries
- [ ] Add release note and demo
- [x] Figure out a solution for rerun dilemma - should `task: rerun`
reevaluate contexts for tasks?

This PR introduced the following variables:
- ZED_COLUMN - current line column
- ZED_ROW - current line row
and the following, which are available for buffers with associated
files:
- ZED_WORKTREE_ROOT - absolute path to the root of the current worktree.
- ZED_FILE - absolute path to the file
- ZED_SYMBOL - currently selected symbol; should match the last symbol
shown in a symbol breadcrumb (e.g. `mod tests > fn test_task_contexts`
should be equal to ZED_SYMBOL of `test_task_contexts`). Note that this
isn't necessarily a test function or a function at all.

Also, you can use them in `cwd` field of definitions (note though that
we're using https://docs.rs/subst/latest/subst/#features for that, so
don't expect a full shell functionality to work); the syntax should
match up with your typical Unix shell.


Release Notes:

- Added task contexts, which are additional environment variables set by
Zed for task execution; task content is dependent on the state of the
editor at the time the task is spawned.

---------

Co-authored-by: Anthony <anthonyeid7@protonmail.com>
2024-03-04 21:04:53 +01:00
Conrad Irwin
b2f18cfe71
Ensure followed cursors are always visible (#8849)
Before this change they would disappear if you blurred the pane.

Release Notes:

- Fixed an issue where the followed users' cursor would disappear if you
blurred the pane.
2024-03-04 12:39:08 -07:00
Joseph T. Lyons
95e532c56d
Add option to sign in to copilot from welcome screen (#8853)
Fixes: https://github.com/zed-industries/zed/issues/8851


https://github.com/zed-industries/zed/assets/19867440/5d391289-34e8-4abc-9337-b7e253f4e513

Release Notes:

- Added GitHub Copilot sign in on welcome screen
([#8851](https://github.com/zed-industries/zed/issues/8851)).
2024-03-04 14:38:28 -05:00
Andrew Lygin
d7b5c883fe
Optimize project panel subscriptions (#8846)
The project panel now both observes all the project updates and
subscribes to project events it's interested in. The observing handler
updates the list of visible entries on any notification, which looks
pretty excessive.

This PR removes the observer completely, and adds missing event handlers
to the subscription, thus removing unnecessary work.

Release Notes:

- N/A
2024-03-04 20:56:17 +02:00
Marshall Bowers
78fa596839
Enable clippy::crate_in_macro_def (#8845)
This PR enables the
[`clippy::crate_in_macro_def`](https://rust-lang.github.io/rust-clippy/master/index.html#/crate_in_macro_def)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-04 13:37:23 -05:00
Marshall Bowers
1dd4c1b057
Enable clippy::redundant_closure_call (#8840)
This PR enables the
[`clippy::redundant_closure_call`](https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_closure_call)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-04 12:38:18 -05:00
Marshall Bowers
9ea50ed649
Enable clippy::iter_overeager_cloned (#8839)
This PR enables the
[`clippy::iter_overeager_cloned`](https://rust-lang.github.io/rust-clippy/master/index.html#/iter_overeager_cloned)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-04 12:22:11 -05:00
Thorsten Ball
9c6a0d98ed
Set working directory for project to project path (#8837)
This fixes #8823 by setting the current working directory we use when
launching our own `prettier` process via `node` to the project path.

Why does this fix it?

We already *did* read the correct configuration options for `prettier`
from any configuration files, we also correctly inferred which
`prettier` plugins to use, but somehow when running

    ./node_modules/.bin/prettier my-file.tsx

produced different results compared to `prettier` in Zed.

But we *do* pass the right options to `prettier.format` when calling it
here:
996f1036fc/crates/prettier/src/prettier_server.js (L177-L190)

I checked those against the `prettier --loglevel=debug` output: they're
the same.

Turns out that the difference is we launch our `prettier_server.js` (a
JavaScript shim that wraps `prettier`-the-library in a language server
interface) not in the project path.

So somewhere inside `prettier.format` something is `require`d and fails
because we're not in that project directory. But when you run
`./node_modules/.bin/prettier` you are.

With the fix here, `prettier` now correctly picks up the tailwind plugin
that didn't seem to work in #8823. It probably fixes a bunch of other
oddities that folks reported with `prettier` too.



Release Notes:

- Fixed `prettier` integration not correctly picking up `prettier`
plugins, because it didn't run in the project's root path when invoked.
([#8823](https://github.com/zed-industries/zed/issues/8823)).
2024-03-04 18:06:55 +01:00
Christian Bergschneider
09760340ca
linux: remove todo for credential implementation (#8834)
As commented
[here](https://github.com/zed-industries/zed/pull/8035#issuecomment-1976894590),
this is already done.



Release Notes:
- N/A
2024-03-04 08:57:56 -08:00
Marshall Bowers
12980dd88f
Enable clippy::derivable_impls (#8836)
This PR enables the
[`clippy::derivable_impls`](https://rust-lang.github.io/rust-clippy/master/index.html#/derivable_impls)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-04 11:47:07 -05:00
Marshall Bowers
a860530a2e
Assign OpenAI model based on Azure OpenAI deployment ID (#8835)
Following up on #8646, this PR makes it so we select an OpenAI model
based on the deployment ID when using Azure OpenAI.

Release Notes:

- N/A
2024-03-04 11:19:32 -05:00
Rom Grk
996f1036fc
linux: clipboard (#8822)
Linux clipboard implementation with `copypasta`.


Release Notes:

- Added linux clipboard support
2024-03-04 08:00:24 -08:00
Marshall Bowers
33ef5b7731
Enable clippy::iter_kv_map (#8832)
This PR enables the
[`clippy::iter_kv_map`](https://rust-lang.github.io/rust-clippy/master/index.html#/iter_kv_map)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-04 10:54:33 -05:00
Marshall Bowers
16be391211
Enable clippy::needless_update (#8830)
This PR enables the
[`clippy::needless_update`](https://rust-lang.github.io/rust-clippy/master/index.html#/needless_update)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-04 10:35:07 -05:00
Thorben Kröger
94593dca4b
clangd: download the correct binary on Linux (#8820)
Release Notes:

- Fixed clangd LSP download not working on Linux
2024-03-04 16:58:58 +02:00
Piotr Osiewicz
98a1e87fbe
task: Spawn static tasks in separate shell (#8827)
That way one can use environment variables in task definitions.

Fixes: #8660

/cc @SomeoneToIgnore it looks like we don't ever set `separate_shell` to
false anymore, it might be worth streamlining?

Release Notes:

- Fixed static tasks not being run under a separate shell.
- Removed `separate_shell` setting from task definitions. It is now a default for tasks defined in tasks.json file.
2024-03-04 15:57:30 +01:00
Thorsten Ball
6121c286b7
Fix argument order when printing prettier debug info (#8826)
Release Notes:


- N/A
2024-03-04 15:37:50 +01:00
Rom Grk
c91969d828
linux/wayland: prevent possible panic (#8824)
Prevent a panic from arising from this case:
https://github.com/zed-industries/zed/pull/8632#discussion_r1510015928

It's not really safe to dispatch any action before dropping the state
borrow, because it may need to be modified.
2024-03-04 05:57:47 -08:00
Jason Lee
538298378a
Return "open in new window" as default in recent projects (#8798)
https://github.com/zed-industries/zed/assets/5518/8bbd13a7-9144-48b0-9bc8-6651725476f8

Closes https://github.com/zed-industries/zed/issues/8651

Reworks `recent_projects::OpenRecent` action with collab projects in mind:
* keep the "open in new window" behavior for corresponding menu and command entries
* use new, "reuse current window" behavior in the recent projects picker up in the toolbar

This way, old Zed behavior is not customizable, kept as original in all main use cases — so that projects shared via remote entities: a channel and a call, are never accidentally closed, breaking the sharing. 

Release Notes:

- Return "open in new window" as default in recent projects
2024-03-04 11:42:30 +02:00
Stanislav Alekseev
38f106cde3
Add a fish-specific fix for #8633 (#8659)
Release Notes:
- Fixed detection of `direnv` not working in `fish` when an LSP adapter
(`gopls`, for example) tries to detect user-installed binaries. (#8633)

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-03-04 09:30:49 +01:00
Mikayla Maki
20acc123af
Implement 'format without save' (#8806)
This solves a major usability problem in Zed, that there's no way to
temporarily disable auto formatting without toggling the whole feature
off.

fixes https://github.com/zed-industries/zed/issues/5230

Release Notes:

- Added a new `workspace::SaveWithoutFormatting`, bound to `cmd-k s`, to
save a file without invoking the auto formatter.
2024-03-03 21:47:34 -08:00
Niklas Wimmer
ff65008316
linux: add credentials impl via oo7 (#8035)
This change implements gpui's credentials API for the linux platform,
using the [`oo7`](https://lib.rs/crates/oo7) library.

We had a short discussion on Discord about where to store credentials
and landed on the two dbus APIs
[`org.freedesktop.Secrets`](https://specifications.freedesktop.org/secret-service/latest/index.html)
and
[`org.freedesktop.portal.Secrets`](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Secret.html).
The first one provides access to a more or less general purpose
keystore, the second provides a way of obtaining a unique masterkey
which in turn can be used for encrypting stuff and storing it to disk
(especially interesting for sandboxed apps, think flatpak/snap).

I decided to give the implementation a try with `oo7`, which uses the
portal if the app is sandboxed and the secret service otherwise. If we
do not want to use that library, we would probably have to more or less
copy its functionality anyways. I also heard rumors of eventually
changing the credentials API and I think this implementation serves as a
starting point to discuss the need for this?

With a working credentials implementation the sign in button now works
(it panicked before).

Todos:
- [x] implement keystore unlocking
- [x] try the change with oo7's tracing enabled?
- [x] test the password deletion

Release Notes:

- N/A

---------

Signed-off-by: Niklas Wimmer <mail@nwimmer.me>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-03 13:54:06 -08:00
Mikayla Maki
0717d30389
Move windows up to workspace dependency (#8786)
This way we can keep track of what we're using.

Release Notes:

- N/A
2024-03-03 11:58:31 -08:00
Ezekiel Warren
36d9b3d483
windows: get pid with win32 api (#8785)
While trying to get mouse/keyboard support in for Windows I ran into a
stack overflow issue related to the pid being `-1`. Getting the proper
process ID seems to fix it.

Release Notes:

- Fixed stack overflow on Windows
2024-03-03 11:42:36 -08:00
Maharshi Basu
a5eab29662
Implement all_font_families for the LinuxTextSystem (#8331)
Implemented the function to get all font family names for
`LinuxTextSystem` which was previously kept as `unimplemented`.

Release Notes:

- N/A

Change Explanation:

- We get the
[`&Database`](https://docs.rs/fontdb/0.16.1/fontdb/struct.Database.html)
struct from the
[`FontSystem`](https://docs.rs/cosmic-text/latest/cosmic_text/struct.FontSystem.html)
by using the `.db` method.
- From the `Database` struct we get the
[`FaceInfo`](https://docs.rs/fontdb/0.16.1/fontdb/struct.FaceInfo.html)
which the provides a method to get the family
names([`families`](https://docs.rs/fontdb/0.16.1/fontdb/struct.FaceInfo.html#structfield.families))
- The `families` function returns a tuple of Vec. The tuple consists of
the `String` containing the name and the
[`Language`](https://docs.rs/fontdb/0.16.1/fontdb/enum.Language.html)
struct.

*It is noted that for the `families` function, the first family is
always `English US` unless it is unavailable*

Since the empty function provided
[here](https://github.com/zed-industries/zed/blob/main/crates/gpui/src/platform/linux/text_system.rs#L75)
explicitly declares a `Vec<String>` as the return type so I am
prioritizing the `English US` font family unless advised otherwise by
the reviewer.

---------

Signed-off-by: Maharshi Basu <basumaharshi10@gmail.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-03 11:28:53 -08:00
Joel Selvaraj
6a6dbe3aa1
linux: wayland: implement cursor style handling (#8632)
Release Notes:

- Implemented cursor style changing in wayland


[zed_cursor_wayland.webm](https://github.com/zed-industries/zed/assets/12579216/cbc03f85-41c1-4687-88b5-2aa5612d7129)

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-03-03 11:28:20 -08:00
Ömer Sinan Ağacan
9095a6b04e
Replace todo calls with error values in linux/platform (#8531)
We currently use a mix of unimplemented methods with empty bodies and
`todo!()` calls in linux/platform.

`todo!()`s cause crashes in runtime with accidental key presses or
clicks.

To avoid this, this PR replaces `todo!()`s in linux/platform with error
values.

This helps when working on Zed itself, testing PRs etc.

Release Notes:

- N/A
2024-03-03 11:18:08 -08:00
白山風露
69e0474ebb
Windows gpui platform (#8490)
First implementation of gpui platform for Windows.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-03-03 10:53:22 -08:00
Marshall Bowers
a88df2c103
Enable clippy::default_constructed_unit_structs (#8778)
This PR enables the
[`clippy::default_constructed_unit_structs`](https://rust-lang.github.io/rust-clippy/master/index.html#/default_constructed_unit_structs)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-03 12:07:53 -05:00
Marshall Bowers
53630dc74c
Enable clippy::needless_lifetimes (#8777)
This PR enables the
[`clippy::needless_lifetimes`](https://rust-lang.github.io/rust-clippy/master/index.html#/needless_lifetimes)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-03 11:52:58 -05:00
Marshall Bowers
1fa9496334
Enable clippy::explicit_counter_loop (#8776)
This PR enables the
[`clippy::explicit_counter_loop`](https://rust-lang.github.io/rust-clippy/master/index.html#/explicit_counter_loop)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-03 11:40:22 -05:00
Jonathan
08f9c3f568
Accept partial copilot suggestions (#8682)
Fixes https://github.com/zed-industries/zed/issues/8020
 
This PR adds a new shortcut cmd-right, if a copilot suggestion exists.
The suggestions is accepted word by word.
It emulates the behaviour of VS Code's Github Copilot implementation.


Release Notes:

- Added ability to accept partial copilot suggestions ([8020](https://github.com/zed-industries/zed/issues/8020))
2024-03-03 18:24:48 +02:00
Marshall Bowers
56f0418c93
Enable clippy::needless_option_as_deref (#8775)
This PR enables the
[`clippy::needless_option_as_deref`](https://rust-lang.github.io/rust-clippy/master/index.html#/needless_option_as_deref)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-03 11:16:27 -05:00
Marshall Bowers
2964a01d73
Enable clippy::identity_op (#8773)
This PR enables the
[`clippy::identity_op`](https://rust-lang.github.io/rust-clippy/master/index.html#/identity_op)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-03 11:05:08 -05:00
Marshall Bowers
83f6a1ea49
Enable clippy::vec_init_then_push (#8771)
This PR enables the
[`clippy::vec_init_then_push`](https://rust-lang.github.io/rust-clippy/master/index.html#/vec_init_then_push)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-03 10:53:23 -05:00
Marshall Bowers
6685d3ac97
Enable clippy::redundant_guards (#8770)
This PR enables the
[`clippy::redundant_guards`](https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_guards)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-03 10:43:13 -05:00
Marshall Bowers
bfc648553f
Enable clippy::bool_comparison (#8769)
This PR enables the
[`clippy::bool_comparison`](https://rust-lang.github.io/rust-clippy/master/index.html#/bool_comparison)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-03 10:34:30 -05:00
Marshall Bowers
5fad319cb5
Enable clippy::expect_fun_call (#8768)
This PR enables the
[`clippy::expect_fun_call`](https://rust-lang.github.io/rust-clippy/master/index.html#/expect_fun_call)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-03 10:27:37 -05:00
Marshall Bowers
fe04f69caf
Enable clippy::useless_conversion (#8767)
This PR enables the
[`clippy::useless_conversion`](https://rust-lang.github.io/rust-clippy/master/index.html#/useless_conversion)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-03 10:22:55 -05:00
geekvest
20d133322a
Fix some comments (#8760)
Release Notes:

- N/A

Signed-off-by: geekvest <cuimoman@sohu.com>
2024-03-03 07:55:42 -05:00
Marshall Bowers
a6dbaac653
Enable clippy::needless_question_mark (#8759)
This PR enables the
[`clippy::needless_question_mark`](https://rust-lang.github.io/rust-clippy/master/index.html#/needless_question_mark)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 23:40:39 -05:00
Marshall Bowers
33790b81fc
Enable clippy::useless_format (#8758)
This PR enables the
[`clippy::useless_format`](https://rust-lang.github.io/rust-clippy/master/index.html#/useless_format)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 23:31:58 -05:00
Marshall Bowers
373e18bc88
Enable clippy::unnecessary_unwrap (#8756)
This PR enables the
[`clippy::unnecessary_unwrap`](https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_unwrap)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 23:10:56 -05:00
Marshall Bowers
191fcf67d1
Enable clippy::nonminimal_bool (#8755)
This PR enables the
[`clippy::nonminimal_bool`](https://rust-lang.github.io/rust-clippy/master/index.html#/nonminimal_bool)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 22:57:37 -05:00
Marshall Bowers
2f876471a1
Enable clippy::extra_unused_lifetimes (#8754)
This PR enables the
[`clippy::extra_unused_lifetimes`](https://rust-lang.github.io/rust-clippy/master/index.html#/extra_unused_lifetimes)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 22:43:00 -05:00
Marshall Bowers
659974411d
Enable clippy::explicit_auto_deref (#8753)
This PR enables the
[`clippy::explicit_auto_deref`](https://rust-lang.github.io/rust-clippy/master/index.html#/explicit_auto_deref)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 22:30:18 -05:00
Marshall Bowers
6a9e8faad2
Enable clippy::unnecessary_operation (#8752)
This PR enables the
[`clippy::unnecessary_operation`](https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_operation)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 22:19:56 -05:00
Marshall Bowers
ea68f86476
Enable clippy::option_map_unit_fn (#8751)
This PR enables the
[`clippy::option_map_unit_fn`](https://rust-lang.github.io/rust-clippy/master/index.html#/option_map_unit_fn)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 22:08:37 -05:00
Marshall Bowers
d19957b705
Enable clippy::redundant_locals (#8750)
This PR enables the
[`clippy::redundant_locals`](https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_locals)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 21:57:40 -05:00
Marshall Bowers
328c8a94b3
Enable clippy::search_is_some (#8748)
This PR enables the
[`clippy::search_is_some`](https://rust-lang.github.io/rust-clippy/master/index.html#/search_is_some)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 21:46:30 -05:00
Marshall Bowers
3ab16d8012
Enable clippy::option_as_ref_deref (#8747)
This PR enables the
[`clippy::option_as_ref_deref`](https://rust-lang.github.io/rust-clippy/master/index.html#/option_as_ref_deref)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 21:36:42 -05:00
Marshall Bowers
ca9d5a2f6b
Enable clippy::needless_borrowed_reference (#8746)
This PR enables the
[`clippy::needless_borrowed_reference`](https://rust-lang.github.io/rust-clippy/master/index.html#/needless_borrowed_reference)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 21:24:56 -05:00
Marshall Bowers
bd00aed7db
Enable clippy::drain_collect (#8745)
This PR enables the
[`clippy::drain_collect`](https://rust-lang.github.io/rust-clippy/master/index.html#/drain_collect)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 21:14:42 -05:00
Marshall Bowers
4097e8870b
Enable clippy::needless_arbitrary_self_type (#8743)
This PR enables the
[`clippy::needless_arbitrary_self_type`](https://rust-lang.github.io/rust-clippy/master/index.html#/needless_arbitrary_self_type)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 21:04:49 -05:00
Marshall Bowers
008c5053e6
Enable clippy::unit_arg (#8742)
This PR enables the
[`clippy::unit_arg`](https://rust-lang.github.io/rust-clippy/master/index.html#/unit_arg)
rule and suppresses the false positive that it flags.

Release Notes:

- N/A
2024-03-02 20:59:41 -05:00
Marshall Bowers
2bfc646f33
Enable clippy::filter_map_identity (#8741)
This PR enables the
[`clippy::filter_map_identity`](https://rust-lang.github.io/rust-clippy/master/index.html#/filter_map_identity)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 20:48:29 -05:00
Marshall Bowers
3e287911c3
Enable clippy::unnecessary_find_map (#8740)
This PR enables the
[`clippy::unnecessary_find_map`](https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_find_map)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 20:39:03 -05:00
Marshall Bowers
503bebaacc
Enable clippy::manual_flatten (#8739)
This PR enables the
[`clippy::manual_flatten`](https://rust-lang.github.io/rust-clippy/master/index.html#/manual_flatten)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 20:28:26 -05:00
Marshall Bowers
f79f56f8b4
Enable clippy::unnecessary_filter_map (#8738)
This PR enables the
[`clippy::unnecessary_filter_map`](https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_filter_map)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 20:16:54 -05:00
Marshall Bowers
a17c207217
Enable clippy::manual_find (#8737)
This PR enables the
[`clippy::manual_find`](https://rust-lang.github.io/rust-clippy/master/index.html#/manual_find)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 20:03:49 -05:00
Marshall Bowers
fc8e515fe8
Enable clippy::too_many_arguments (#8734)
This PR enables the
[`clippy::too_many_arguments`](https://rust-lang.github.io/rust-clippy/master/index.html#/too_many_arguments)
rule.

I opted to add `#[allow(clippy::too_many_arguments)]` on the individual
violations, as reworking them to take fewer arguments is a more involved
task.

Release Notes:

- N/A
2024-03-02 18:42:05 -05:00
Marshall Bowers
eaf2fbb21b
Enable clippy::map_flatten (#8733)
This PR enables the
[`clippy::map_flatten`](https://rust-lang.github.io/rust-clippy/master/index.html#/map_flatten)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 18:24:22 -05:00
Marshall Bowers
8bc35c33c5
Enable clippy::to_string_in_format_args (#8732)
This PR enables the
[`clippy::to_string_in_format_args`](https://rust-lang.github.io/rust-clippy/master/index.html#/to_string_in_format_args)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 18:13:49 -05:00
Marshall Bowers
52052f342b
Enable clippy::map_identity (#8731)
This PR enables the
[`clippy::map_identity`](https://rust-lang.github.io/rust-clippy/master/index.html#/map_identity)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 18:02:39 -05:00
Marshall Bowers
9735912965
Enable clippy::clone_on_copy (#8728)
This PR enables the
[`clippy::clone_on_copy`](https://rust-lang.github.io/rust-clippy/master/index.html#/clone_on_copy)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 17:37:48 -05:00
Marshall Bowers
5935681c5c
Enable clippy::single_char_pattern (#8727)
This PR enables the
[`clippy::single_char_pattern`](https://rust-lang.github.io/rust-clippy/master/index.html#/single_char_pattern)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 17:04:59 -05:00
Marshall Bowers
12440d5e0d
terminal: Make rgb_for_index take a u8 instead of a &u8 (#8726)
This PR makes the `rgb_for_index` take a `u8` instead of a `&u8`.

`u8` is `Copy` and is only 1 byte, so there really isn't any reason to
pass a reference to it.

Release Notes:

- N/A
2024-03-02 16:51:46 -05:00
Marshall Bowers
4b81b15cad
Enable clippy::useless_conversion (#8724)
This PR enables the
[`clippy::useless_conversion`](https://rust-lang.github.io/rust-clippy/master/index.html#/useless_conversion)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 16:31:47 -05:00
Marshall Bowers
87efb75e53
Enable clippy::bind_instead_of_map (#8723)
This PR enables the
[`clippy::bind_instead_of_map`](https://rust-lang.github.io/rust-clippy/master/index.html#/bind_instead_of_map)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 16:10:34 -05:00
Marshall Bowers
bf666af3a2
Deny all Clippy warnings (#8720)
This PR makes Clippy deny all warnings across the workspace.

We now enumerate all of the rules that have violations and temporarily
allow them, with the goal being to drive the list down over time.

On Windows we don't yet use `--deny warnings`, as the Windows build
still has some warnings.

Release Notes:

- N/A
2024-03-02 15:51:01 -05:00
Marshall Bowers
c9a509c805
Add cargo xtask clippy (#8722)
This PR sets up a `cargo xtask clippy` command for running `cargo
clippy` with our defined set of options.

The intent is to make this easier to manage as we start enabling more
Clippy rules.

Release Notes:

- N/A
2024-03-02 14:46:02 -05:00
Marshall Bowers
c19587d4e4
Fix Clippy warnings in util crate (#8721)
This PR fixes a number of Clippy warnings in the `util` crate.

Release Notes:

- N/A
2024-03-02 13:06:35 -05:00
Marshall Bowers
0ac203bde0
Fix Clippy warnings in client crate (#8719)
This PR fixes a number of Clippy warnings in the `client` crate.

Release Notes:

- N/A
2024-03-02 12:33:02 -05:00
Tommi Pisto
5de7492146
Add flex_wrap_* and content_* to GPUI (#8710)
Now with GPUI you can auto-layout something like this:

<img width="560" alt="Screenshot 2024-03-02 at 13 56 50"
src="https://github.com/zed-industries/zed/assets/226244/8ec4b683-dd7d-41f8-8b09-4be66ecec9a0">
2024-03-02 11:29:44 -05:00
Marshall Bowers
f9dc871422
Fix Clippy warnings in theme crate (#8715)
This PR fixes a number of Clippy warnings in the `theme` crate.

Release Notes:

- N/A
2024-03-02 11:11:08 -05:00
Zephaniah Ong
6fcd57ac53
Expose more errors from rust-analyzer on invalid Cargo.toml contents (#8356)
Release Notes:

- Fixed ([#7574](https://github.com/zed-industries/zed/issues/7574)).
2024-03-02 10:07:25 +02:00
Liam Murphy
0903062933
Fix unsafe precondition violation when building with nightly rustc (#8691)
Fixes #8658

Release Notes:

- N/A
2024-03-02 08:01:44 +01:00
Marshall Bowers
e5e6c7f09d
Fix Clippy warnings in fuzzy crate (#8701)
This PR fixes a number of Clippy warnings in the `fuzzy` crate.

Release Notes:

- N/A
2024-03-02 01:02:34 -05:00
Marshall Bowers
ca2cda8d2a
Remove unneeded 'static lifetimes on &strs in constants (#8698)
This PR removes unneeded `'static` lifetimes on `&str`s stored in
`const` declarations.

This addresses some Clippy lints about
[`redundant_static_lifetimes`](https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_static_lifetimes).

In item-level `const` declarations we can rely on lifetime elision and
use the default `'static` lifetime.

Note that associated constants still require an explicit `'static`
lifetime, as explained in
https://github.com/rust-lang/rust/issues/115010.

Release Notes:

- N/A
2024-03-02 00:40:49 -05:00
Marshall Bowers
5c2bd816ae
Fix Clippy warnings in settings crate (#8700)
This PR fixes a number of Clippy warnings in the `settings` crate.

Release Notes:

- N/A
2024-03-02 00:29:29 -05:00
Marshall Bowers
26fdd149e1
Fix Clippy warnings in fs (#8696)
This PR fixes various Clippy warnings in the `fs` crate.

Release Notes:

- N/A
2024-03-01 23:22:22 -05:00
Marshall Bowers
486f0ae454
Remove expects when constructing Clickhouse client (#8697)
This PR removes the `expect`s when constructing the Clickhouse client
while still retaining the less-noisy behavior from before.

Release Notes:

- N/A
2024-03-01 23:10:02 -05:00
Marshall Bowers
cfe90c37fc
Document release_channel crate (#8695)
This PR documents the `release_channel` crate.

Release Notes:

- N/A
2024-03-01 22:05:46 -05:00
Marshall Bowers
8c3ae8b264
Upgrade bitflags to v2.4.2 (#8693)
This PR upgrades our [`bitflags`](https://crates.io/crates/bitflags)
dependency to v2.4.2.

This also fixes an error that was seen when running `clippy`:

```
error: &-masking with zero
  --> crates/fsevent/src/fsevent.rs:19:1
   |
19 | / bitflags! {
20 | |   #[repr(C)]
21 | |   pub struct StreamFlags: u32 {
22 | |     const NONE = 0x00000000;
...  |
46 | |   }
47 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bad_bit_mask
   = note: `#[deny(clippy::bad_bit_mask)]` on by default
   = note: this error originates in the macro `__impl_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)
```

Fixes #8681.

Release Notes:

- N/A
2024-03-01 21:07:39 -05:00
Marshall Bowers
b2cc617886
Allow overriding player colors via experimental.theme_overrides (#8692)
This PR extends the `experimental.theme_overrides` to allow overriding
the player colors.

Release Notes:

- Added the ability to override player colors using
`experimenta.theme_overrides`.
2024-03-01 20:33:37 -05:00
Brian Donovan
a84a3c0ebe
docs: Fix "it's" typos that should be "its" (#8690)
These all meant to use the possessive "its" rather than the contraction
of "it is".
2024-03-01 20:32:27 -05:00
Dzmitry Malyshau
26103e8bb9
Clean up and refactor X11 refresh loop (alternative) (#8655)
Associates every window with its own refresh event. Removes the use of
X11 present.
Alternative to #8592.
Instead of doing the rendering on idle and then involving a hack for
polling X11 events, this PR just tries to do the rendering inside the
main loop. This guarantees that we continue to poll for events after the
draw, and not get screwed by the driver talking to X11 via the same file
descriptor.

Release Notes:
- N/A
2024-03-01 16:43:24 -08:00
Kirill Bulatov
b7784d414a
When clicking the checkbox, toggle open the LSP trace logs (#8689)
Before this change, enabling LSP trace checkbox closed the panel and
toggled the server logs on.
Now, the newly enabled trace logs are shown instead.

Release Notes:

- Improved LSP logs checkbox behavior
2024-03-02 02:03:30 +02:00
Max Brunsfeld
268fa1cbaf
Add initial support for defining language server adapters in WebAssembly-based extensions (#8645)
This PR adds **internal** ability to run arbitrary language servers via
WebAssembly extensions. The functionality isn't exposed yet - we're just
landing this in this early state because there have been a lot of
changes to the `LspAdapter` trait, and other language server logic.

## Next steps

* Currently, wasm extensions can only define how to *install* and run a
language server, they can't yet implement the other LSP adapter methods,
such as formatting completion labels and workspace symbols.
* We don't have an automatic way to install or develop these types of
extensions
* We don't have a way to package these types of extensions in our
extensions repo, to make them available via our extensions API.
* The Rust extension API crate, `zed-extension-api` has not yet been
published to crates.io, because we still consider the API a work in
progress.

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-03-01 16:00:55 -08:00
Ben Hamment
f3f2225a8e
Improve Ruby Grammar for superclasses (#8544)
Release Notes:

- Improved Ruby grammar to allow targeting of super classes including
namespaces classes
2024-03-01 16:08:03 -07:00
Tim Havlicek
242f032d74
Fix documentation for use_system_clipboard (#8635)
Release Notes:

- Fixed documentation for vim.use_system_clipboard
2024-03-01 15:44:09 -07:00
Conrad Irwin
5523a510c5
Allow reconnect before disconnect (#8684)
Co-Authored-By: Max <max@zed.dev>



Release Notes:

- Improved handling of reconnections during calls

---------

Co-authored-by: Max <max@zed.dev>
2024-03-01 15:41:32 -07:00
Kirill Bulatov
3efb871cd4
Add a way to change what menu::Confirm does in the recent projects modal (#8688)
Follow-up of
https://github.com/zed-industries/zed/issues/8651#issuecomment-1973411072

Zed current default is still to reuse the current window, but now it's
possible to do
```json
"alt-cmd-o": [
  "projects::OpenRecent",
  {
    "create_new_window": true
  }
]
```
and change this.

menu::Secondary confirm does the action with opposite window creation
strategy.

Release Notes:

- Improved open recent projects flexibility: settings can change whether
`menu::Confirm` opens a new window or reuses the old one
2024-03-02 00:28:51 +02:00
Andrew Lygin
37f7957826
Setting to show/hide terminal title (#8559)
This PR adds settings for hiding title (breadcrumbs) from the terminal
toolbar. If the title is hidden, the toolbar disappears completely.

Example:

```json
"terminal": {
  "toolbar": {
    "title": true,
  }
}
```

[The PR that added the "toolbar"
setting](https://github.com/zed-industries/zed/pull/7338) didn't affect
toolbars of the terminals that are placed in the editor pane. This PR
fixes that.


Release Notes:

- Added support for configuring the terminal toolbar ([8125](https://github.com/zed-industries/zed/issues/8125))
2024-03-01 23:37:02 +02:00
Conrad Irwin
400fb12f7e
Make collab quieter on startup (#8685)
Fix initialization of minio to happen on service start instead of
bootstrap,
don't log errors if extensions are empty or if clickhouse is disabled

Release Notes:

- N/A
2024-03-01 13:39:13 -07:00
Conrad Irwin
64460e492a
Upload crashes to collab directly (#8649)
This lets us run rustc_demangle on the backtrace, which helps the Slack
view significantly.

We're also now uploading files to digital ocean's S3 equivalent (with a
1 month expiry) instead of to Slack.

This PR paves the way for (but does not yet implement) sending this data
to clickhouse too.

Release Notes:

- N/A
2024-03-01 13:23:44 -07:00
Kirill Bulatov
cdf702aeff
Prompt to save files on recent project selection (#8673) 2024-03-01 18:48:06 +02:00
Marshall Bowers
91d1146d97
Replace lazy_static! with OnceLock in collab crate (#8677)
This PR replaces a `lazy_static!` usage in the `collab` crate with
`OnceLock` from the standard library.

This allows us to drop the `lazy_static` dependency from this crate.

Release Notes:

- N/A
2024-03-01 11:24:53 -05:00
Wind
9723ca95e3
Vim mode: make motion::EndOfLine works with times. (#8591)
Release Notes:

- Fixed `$` in Vim mode not taking a numeric argument (i.e. `2$` or
`4$`) ([#8007](https://github.com/zed-industries/zed/issues/8007)).

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-03-01 14:00:31 +01:00
Andrew Lygin
aeed9d0d8b
Scroll project search results to the top (#8329)
Scroll project search results to the top after every new search.

Release Notes:

- Fixed autoscrolling of the project search results ([8237](https://github.com/zed-industries/zed/issues/8237))
2024-03-01 11:40:57 +02:00
Flo
d6492d091d
Implement workspace_configuration for Dart LSP (#8568)
This PR addressed https://github.com/zed-industries/zed/issues/8558 and
allows the [Dart Client Workspace
Configuration](https://github.com/dart-lang/sdk/blob/main/pkg/analysis_server/tool/lsp_spec/README.md#client-workspace-configuration).

Differing from the issue, the settings are used from the LSP settings
section, example:

```
{
 "lsp": {
    "dart": {
      "settings": {
        "lineLength": 200
      }
    }
  }
}
```

Note: this only works for the global settings (not folder specific)


Release Notes:

- Fixed missing client workspace configuration of Dart LSP. Those can
now be configured by setting `{"lsp": {"dart": { "settings: {
"your-settings-here": "here"} } }` in the Zed settings.
([#8858](https://github.com/zed-industries/zed/issues/8558)).
2024-03-01 10:22:43 +01:00
Spence
34de33ef72
Editor: Add shortcut to toggle line numbers (#8642)
Following #7665, I've added a keymap to quickly hide and show gutter
line numbers.

`ctrl-l` and `cmd-l` were taken, so I've bound it to `cmd-;`. 



https://github.com/zed-industries/zed/assets/138762/365d2a7c-b775-4486-8389-edafe59b2a87

Release notes:

- Added `editor: toggle line numbers` command and default keybindings
(`cmd-;` on macOS).

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-03-01 10:09:21 +01:00
Marshall Bowers
7f5aa1fca6
Replace lazy_static! with OnceLock in time_format crate (#8648)
This PR replaces a `lazy_static!` usage in the `time_format` crate with
`OnceLock` from the standard library.

This allows us to drop the `lazy_static` dependency from this crate.

Release Notes:

- N/A
2024-02-29 23:58:45 -05:00
Marshall Bowers
0d0ce95eae
Replace lazy_static! with OnceLock in ai crate (#8647)
This PR replaces a `lazy_static!` usage in the `ai` crate with
`OnceLock` from the standard library.

This allows us to drop the `lazy_static` dependency from this crate.

Release Notes:

- N/A
2024-02-29 23:37:20 -05:00
Marshall Bowers
eb1ab69606
Wire up Azure OpenAI completion provider (#8646)
This PR wires up support for [Azure
OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/overview)
as an alternative AI provider in the assistant panel.

This can be configured using the following in the settings file:

```json
{
  "assistant": {
    "provider": {
      "type": "azure_openai",
      "api_url": "https://{your-resource-name}.openai.azure.com",
      "deployment_id": "gpt-4",
      "api_version": "2023-05-15"
    }
  },
}
```

You will need to deploy a model within Azure and update the settings
accordingly.

Release Notes:

- N/A
2024-02-29 22:01:33 -05:00
Nikita Orlov
7c1ef966f3
Zig outline view (#8122)
Release Notes:

- Added Zig outline view, related #7357 
- 
<img width="762" alt="image"
src="https://github.com/zed-industries/zed/assets/13052752/a879cd98-d5e0-446e-aaed-504528b99552">
2024-02-29 17:24:35 -08:00
Nathan Sobo
4cc4f08a53
Remove ! from todo!() in comments (#8643)
This practice makes it difficult to locate todo!s in my code when I'm
working. Let's take out the bang if we want to keep doing this.

Release Notes:

- N/A
2024-02-29 18:19:05 -07:00
Marshall Bowers
dab886f479
Stub out support for Azure OpenAI (#8624)
This PR stubs out support for [Azure
OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/overview)
within the `OpenAiCompletionProvider`.

It still requires some additional wiring so that it is accessible, but
the necessary hooks should be in place now.

Release Notes:

- N/A
2024-02-29 13:02:08 -05:00
Sai Gokula Krishnan
cbcd011a36
Improve matches on command palette (#8515)
Release Notes:

- Fixed consecutive spaces in command palette influencing selection.
#8184

Optionally, include screenshots / media showcasing your addition that
can be included in the release notes.



https://github.com/zed-industries/zed/assets/25414681/a4682247-f52c-4ab9-a32a-51ab5cf3dbcc
2024-02-29 18:31:13 +01:00
Conrad Irwin
b3b94e64ba
Ensure panel and pane sizes are integral (#8619)
Fixes: #8050

For some reason that we didn't investigate, if you have view caching
enabled,
and you have non-integer sized bounds, and you are right aligning
things, the
co-ordinates can differ by +/- 1px when using the cached view.

The easiest fix for now is to just not do that.

Co-Authored-By: Antonio <as-cii@zed.dev>

Release Notes:

- Fixed the pane icons flickering
([#8050](https://github.com/zed-industries/zed/issues/8050)).

Co-authored-by: Antonio <as-cii@zed.dev>
2024-02-29 09:16:42 -07:00
Rajesh Malviya
db9cc42245
Support Sourcehut & Codeberg in permalinks (#8616)
Updates #5110 

Release Notes:

- Added support for repositories hosted on `git.sr.ht` (Sourcehut) and
`codeberg.org` to the `editor: copy permalink to line` and `editor: open
permalink to line` actions
([#5110](https://github.com/zed-industries/zed/issues/5110)).

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-02-29 11:13:37 -05:00
Marshall Bowers
faa6f979be
Restore signature of build_permalink (#8609)
This PR restores the original signature of `build_permalink`, which
intentionally uses a params struct to avoid mixing up the various `&str`
params that could otherwise be accidentally provided in the wrong order
without being caught by the compiler.

Release Notes:

- N/A
2024-02-29 08:52:09 -05:00
Thorsten Ball
519655297a
Support Bitbucket.org in permalinks (#8601)
This adds support for Bitbucket.org/Bitbucket Cloud repositories to the
`editor: copy permalink to line` and `editor: open permalink to line`
actions.

Fixes #5110.



Release Notes:

- Added support for repositories hosted on Bitbucket.org (Bitbucket
Cloud) to the `editor: copy permalink to line` and `editor: open
permalink to line` actions.
([#5110](https://github.com/zed-industries/zed/issues/5110)).
2024-02-29 14:11:30 +01:00
Jason Lee
47bcb305af
Use Pointer cursor style on Recent Projects, VCS Menu. (#8595)
Release Notes:

- Improved to use `Pointer` style cursor on VCS and Recent Projects
menu.



https://github.com/zed-industries/zed/assets/5518/4f638c6a-00b8-4fa8-b469-4d3109827bc2
2024-02-29 12:27:56 +01:00
Kirill Bulatov
953bc5eee2
Fix post-merge issue from the old branch PR (#8590)
Follow-up of https://github.com/zed-industries/zed/pull/6924/files that
had old code in CI that worked, but fresh `main` had different code that
needed small changes.


Release Notes:

- N/A
2024-02-29 11:46:00 +02:00
Yangze Luo
c94852b843
Go to reference when there's only one (#6924)
Fixes #4796

- Improved Go To Definition usability when there's a single reference ([4796](https://github.com/zed-industries/zed/issues/4796))

---------

Co-authored-by: Kirill Bulatov <kirill@zed.com>
2024-02-29 11:11:16 +02:00
Jason Lee
225dd0f9a0
Improve extensions UI detail (#8578)
Release Notes:

- Improved "Extensions" UI details to tidy layout, add border, add
placeholder to search input.


## Before


![SCR-20240229-fbk](https://github.com/zed-industries/zed/assets/5518/a62608e2-8f79-48fe-9e1c-87d6eb59ddc9)

## After


![SCR-20240229-fhz](https://github.com/zed-industries/zed/assets/5518/d5c97711-ff93-4944-8e23-39b60dda88fc)

![SCR-20240229-fg9](https://github.com/zed-industries/zed/assets/5518/a24ad839-3b69-4ca7-813f-00375a81a008)

![SCR-20240229-fbb](https://github.com/zed-industries/zed/assets/5518/ff45d6c3-93a3-431c-81f5-edc9e7aa68d6)

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-02-28 22:34:40 -05:00
Conrad Irwin
778b6fb27b
Add OpenExcerptsSplit (#8574)
I would like to keep diagnostics open on one side, and process them on
the other.


Release Notes:

- Added `editor::OpenExcerptsSplit` (bound to `cmd-k enter`) to open the
selected excerpts in the adjacent pane
- vim: Added `ctrl-w d`, `ctrl-w shift-d` and `ctrl-w space` for
`editor::GoTo{,Type}Definition` and `editor::OpenExcerptsSplit`
2024-02-28 19:23:36 -07:00
Kirill Bulatov
b7429bf29d
Added menu::UseSelectedQuery command that populates task modal query with the selected task name (#8572) 2024-02-29 02:20:43 +02:00
Conrad Irwin
9bd5ebb74b
Revert "Introduce a new ToggleGraphicsProfiler command (#7607)" (#8567)
This reverts commit 0cebf68306.

Although this thing is very cool, it is a top source of crashes.

Example crash:
```
Segmentation fault: 11 on thread 26
  objc_retain +16
  invocation function for block in Overlay::onCommandBufferCommit(id<MTLCommandBuffer>) +60
  MTLDispatchListApply +52
```

Release Notes:

- Removed "Toggle Graphics Profiler" as it crashes too much.
2024-02-28 16:39:51 -07:00
Kirill Bulatov
ac30ded80e
Allow .zed/tasks.json local configs (#8536)
![image](https://github.com/zed-industries/zed/assets/2690773/e1511777-b4ca-469e-8636-1e513b615368)

Follow-up of
https://github.com/zed-industries/zed/issues/7108#issuecomment-1960746397

Makes more clear where each task came from, auto (re)load
.zed/config.json changes, properly filtering out other worktree tasks.

Release Notes:

- Added local task configurations
2024-02-29 01:18:13 +02:00
Rom Grk
7f954cbbb8
linux: improve key translation (#8560)
This PR brings linux XKB key translation more in line with the macOS
logic, which fixes quite a few key bindings.
2024-02-28 15:13:02 -08:00
Roman
b76e0d997e
Linux: Rewrite the event loop using calloop (#8314)
This PR unifies the event loop code for Wayland and X11. On Wayland,
blocking dispatch is now used. On X11, the invisible window is no longer
needed.

Release Notes:

- N/A

---------

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
Co-authored-by: Tadeo Kondrak <me@tadeo.ca>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Co-authored-by: julia <julia@zed.dev>
2024-02-28 14:59:11 -08:00
Conrad Irwin
014e6f66bb
gpui: Don't impl IntoElement on () (#8555)
Although it's kinda cute, rust makes it too easy to accidentally return
() from a function.

/cc @nathansobo

Release Notes:

- N/A
2024-02-28 15:19:05 -07:00
Max Brunsfeld
9e4b3ce94c
Avoid an unwrap when loading languages (#8562)
We couldn't reproduce the panic, but I believe it was possible when
uninstalling an extension while one if its grammars was still loading.

Release Notes:
- Fixed a crash that could happen when uninstalling a language extension
while its grammar was loading.

---------

Co-authored-by: Conrad <conrad@zed.dev>
2024-02-28 14:08:45 -08:00
Joseph T. Lyons
4a4ca2c3b8
Fix view release notes locally (#8553)
🤦‍♂️

Release Notes:

- N/A
2024-02-28 15:50:10 -05:00
Conrad Irwin
495de89747
Fix update notifications (#8554)
Fixes: #7597

Release Notes:

- Fixed update notifications
([#7597](https://github.com/zed-industries/zed/issues/7597)).
2024-02-28 13:43:54 -07:00
Conrad Irwin
6a3ac94eea
Fix logic for view to send on Follow (#8549)
Before this we would erronously send no view in some cases.

Release Notes:

- N/A
2024-02-28 12:52:03 -07:00
Joseph T. Lyons
6e04c1f924 v0.126.x dev 2024-02-28 13:13:51 -05:00
Antonio Scandurra
57f5f128f3
Fix flickering cursor style when a pane was zoomed (#8546)
Release Notes:

- N/A

Co-authored-by: Max Brunsfeld <max@zed.dev>
2024-02-28 18:50:48 +01:00
Thorsten Ball
7efa8d079d
Do not set rules by default for eslint (#8545)
Follow-up to and fix for #8537.

Turns out that if you set `rules: []` it doesn't mean "no matchers", but
it means "no rules". So let's not set a default here.

Release Notes:

- N/A, see #8537

Co-authored-by: Conrad <conrad@zed.dev>
2024-02-28 18:39:54 +01:00
Andrew Lygin
d0ffd51bb1
Optimize file finder subscriptions (#8343)
Fixes #7519 

Optimizes file finder subscriptions &mdash; it now only subscribes to
worktrees updates instead of all project updates.

Project panel could also be optimized this way, I guess.

Release Notes:

- Fix selection resets in the file finder during language server
startup ([7519](https://github.com/zed-industries/zed/issues/7519))
2024-02-28 19:02:21 +02:00
Antonio Scandurra
7aba9eb4b7
Introduce a short-term solution for flickering (#8542)
This uses bounds checking alone to determine hover state to avoid
flicker. It's a short-term solution because the rendering is incorrect.
We think this is better than flickering though and buys us some time as
we work on a more robust solution overall.

Release Notes:

- Fixed flickering when hovering.

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-02-28 17:57:20 +01:00
Thorsten Ball
a52177fd39
Allow users to configure ESLint codeActionOnSave settings (#8537)
This fixes #8533 by allowing users to specify the settings that are
passed to ESLint on workspace initialization.

Example Zed `settings.json` to enable `fixAll` for eslint when
saving/formatting, but only for the `import/order` rule:

```json
{
  "languages": {
    "JavaScript": {
      "code_actions_on_format": {
        "source.fixAll.eslint": true
      }
    }
  },
  "lsp": {
    "eslint": {
      "settings": {
        "codeActionOnSave": {
          "rules": ["import/order"]
        }
      }
    },
  }
}
```

The possible settings are described in the README of `vscode-eslint`
here:
https://github.com/Microsoft/vscode-eslint?tab=readme-ov-file#settings-options

- `eslint.codeActionsOnSave.enable` (default: `true`, config key in Zed:
`lsp.eslint.settings.codeActionOnSave.enable`)
- `eslint.codeActionsOnSave.mode` (default: not set by Zed, config key
in Zed: `lsp.eslint.settings.codeActionOnSave.mode`)
- `eslint.codeActionsOnSave.rules` (default: `[]`, config key in Zed:
`lsp.eslint.settings.codeActionOnSave.rules`)

Yes, in the readme it's plural: `codeActionsOnSave`, but since
`eslint-vscode` we're using this old release:


https://github.com/microsoft/vscode-eslint/releases/tag/release%2F2.2.20-Insider

We use the singular version:
https://github.com/microsoft/vscode-eslint/blob/release/2.2.20-Insider/server/src/eslintServer.ts#L461

Our schema looks like this:

```json
{
  "lsp": {
    "eslint": {
      "settings": {
        "codeActionOnSave": {
          "enable": true,
          "rules": ["import/order"],
          "mode": "all"
        }
      }
    },
  }
}
```

We should probably fix this and upgrade to the newest version of ESLint.

Release Notes:

- Added ability for users to configure settings for ESLint's
`codeActionOnSave`, e.g. specifying `rules` that should be respected
when also using `"code_actions_on_format": {"source.fixAll.eslint":
true}`. These settings can be passed to ESLint as part of the `"lsp"`
part of the Zed settings. Example: `{"lsp": {"eslint": {"settings":
{"codeActionOnSave": { "rules": ["import/order"] }}}}}`
([#8533](https://github.com/zed-industries/zed/issues/8533)).

Demo:


https://github.com/zed-industries/zed/assets/1185253/5c0cf900-9acb-4a70-b89d-49b6eeb6f0e4
2024-02-28 17:04:36 +01:00
Thorsten Ball
f8959834c4
Add ability to run ESLint (and other non-primary language server) code actions on format (#8496)
This PR does two things to fix
https://github.com/zed-industries/zed/issues/4325:

1. It changes the way `code_actions_on_format` works to send the
possibly configured code actions to _all_ (and not just the primary)
languages servers. That means configured code actions can now be sent to
ESLint, tailwind, ... and other language servers.
2. It enables `codeActionsOnSave` by default for ESLint. That does
**not** mean that by default we will run something on save, but only
that we enable it for ESLint.

Users can then configure their Zed to run the `eslint` code action on
format. Example, for JavaScript:

```json
    {
      "languages": {
        "JavaScript": {
          "code_actions_on_format": {
            "source.fixAll.eslint": true
          }
        },
      }
    }
```

Release Notes:

- Added ability to run ESLint fixes when formatting a buffer. Code
actions configured in
[`code_actions_on_format`](https://zed.dev/docs/configuring-zed#code-actions-on-format)
are now being sent to _all_ language servers connected to a buffer, not
just the primary one. So if a user now sets `"code_actions_on_format": {
"source.fixAll.eslint": true }` in their Zed settings, the
`source.fixAll.eslint` code action will be sent to ESLint, which is not
a primary language server. Since the formatter (prettier, or external
commands, or another language server, ...) still runs, it's important
that these code actions and the formatter don't clash.
([#4325](https://github.com/zed-industries/zed/issues/4325)).

Demo:



https://github.com/zed-industries/zed/assets/1185253/9ef03ad5-1f5c-4d46-b72a-eef611e32f39
2024-02-28 13:55:20 +01:00
Kirill Bulatov
2e516261fe Add tests on inventory task sorting 2024-02-28 14:13:40 +02:00
Kirill Bulatov
ca092fb694 Move NumericPrefixWithSuffix into utils 2024-02-28 14:13:40 +02:00
Kirill Bulatov
96d9df073e Sort tasks modal entries by last used time 2024-02-28 14:13:40 +02:00
Thorsten Ball
9f7e625d37
Fix formatting of code in prettier crate (#8526)
Came across this code, saw lots of blue squiggly lines, saw a chance to
simplify the code a little bit and reduce indentation.

(Kinda ironic that I'm the one formatting the prettier code, right?)

Release Notes:

- N/A
2024-02-28 12:51:08 +01:00
Piotr Osiewicz
a3174be565
chore: Move Location type to language (#8527)
Release Notes:

- N/A
2024-02-28 12:41:31 +01:00
Aryan Sjet
2f6b290084
linux: fix invalid cross-device link error (#8437)
This PR fix the "invalid cross-device link" error occurred in linux when
trying to write the settings file atomically, like when click the
"Enable vim mode" checkbox at first start.

```plain
[2024-02-26T22:59:25+08:00 ERROR util] .../zed/crates/settings/src/settings_file.rs:135: Failed to write settings to file "/home/$USER/.config/zed/settings.json"

Caused by:
0: failed to persist temporary file: Invalid cross-device link (os error 18)
1: Invalid cross-device link (os error 18)
```

Currently the `fs::RealFs::atomic_write()` method write to a temp file
created with `NamedTempFile::new()` and then call `persist()` method to
write to the config file path, which actually do a `rename` syscall
under the hood. As the
[issue](https://github.com/Stebalien/tempfile/issues/245) said

> `NamedTempFile::new()` will create a temporary file in your system's
temporary file directory. You need `NamedTempFile::new_in()`.

The temporary file directory in linux is in `/tmp`, which is mounted to
`tmpfs` filesystem, and in most case(all case I guess)
`$HOME/.config/zed` is mounted to a different filesystem. And the
`rename` syscall between different filesystems will return a `EXDEV`
errno, as described in the man page
[rename(2)](https://man7.org/linux/man-pages/man2/renameat2.2.html):

```plain
       EXDEV  oldpath and newpath are not on the same mounted
              filesystem.  (Linux permits a filesystem to be mounted at
              multiple points, but rename() does not work across
              different mount points, even if the same filesystem is
              mounted on both.)
```

And as the issue above said, use a different temp dir with
`NamedTempFile::new_in()` for linux platform might be a solution, since
the `rename` syscall provides atomicity.

Release Notes:
- Fix `settings.json` save failed with invalid cross-device link error
in linux
2024-02-27 21:49:28 -08:00
Conrad Irwin
9906b31691
fix vim repeat (#8513)
Release Notes:

- vim: Fixed `.` when multiple windows are open
([#7446](https://github.com/zed-industries/zed/issues/7446)).
- vim: Fixed switching to normal mode after `J`, `<` or `>` in visual
mode ([#4439](https://github.com/zed-industries/zed/issues/4439))
- vim: Added `ctrl-t` and `ctrl-d` for indent/outdent in insert mode.

- Fixed indent/outdent/join lines appearing to work in read-only buffers
([#8423](https://github.com/zed-industries/zed/issues/8423))
- Fixed indent with an empty selection when the cursor was in column 0
2024-02-27 21:36:12 -07:00
Rom Grk
9a7a267203
vim: f and t multiline option (#8448)
I'm not sure how compliant you're aiming to be with vim, but the `f`
behavior is more useful when it can search on multiple lines instead of
a single one, so I'd like to propose this change.

This change is quite frequent in vim/neovim as a plugin (e.g.
[clever-f](https://github.com/VSCodeVim/Vim),
[improved-ft](https://github.com/backdround/improved-ft.nvim), etc), and
in other vim emulations (e.g.
[vscode-vim](https://github.com/VSCodeVim/Vim)).
2024-02-27 19:34:19 -07:00
Sai Gokula Krishnan
bd8896a3dc
Add icon support for files without extensions (#8453)
Release Notes:

- Added support for showing file icons for files without suffixes.

Before:

<img width="281" alt="image"
src="https://github.com/zed-industries/zed/assets/25414681/ab4c00ed-72c7-458f-8dda-61c68165590f">


After:

<img width="242" alt="Screenshot 2024-02-27 at 1 51 20 AM"
src="https://github.com/zed-industries/zed/assets/25414681/8f3082c4-9424-4bc3-9100-a527b9adc315">


This screenshot is to show if the file has extension, then the extension
takes precedence.

<img width="193" alt="image"
src="https://github.com/zed-industries/zed/assets/25414681/72fcebd1-361f-444b-8890-f59932963083">


<br>

- Added icons for
    - Docker - https://www.svgrepo.com/svg/473589/docker
    - License - https://www.svgrepo.com/svg/477704/license-1
    - Heroku - https://www.svgrepo.com/svg/341904/heroku
 
 - Updated tests
2024-02-27 20:36:38 -05:00
Conrad Irwin
d545fe9fe4
Add missing wait_for_anchors (#8509)
Release Notes:

- Fixed a panic when hovering in a collaboration session
2024-02-27 16:04:30 -07:00
Conrad Irwin
9765260567
Upgrade palette (#8506)
This fixes the compilation stck overflow here:
https://ogeon.github.io/2024/02/25/palette-0.7.5.html



Release Notes:

- N/A
2024-02-27 14:29:27 -07:00
Kirill Bulatov
e2bcb28286
Use proper buffer versions when [de]serializing hint proto requests (#8502)
During inlay hint<->proto conversions, uses proper buffer versions and
never carries them across the .await points, to fix the
```
thread 'main' panicked at 'invalid anchor Anchor { timestamp: Lamport {0: 8558}, offset: 54, bias: Right, buffer_id: Some(BufferId(8)) }. buffer id: 8, version: Global {0: 8546, 1: 8378}'
/Users/administrator/actions-runner-2/_work/zed/zed/crates/text/src/text.rs:1919
<backtrace::capture::Backtrace>::create
<backtrace::capture::Backtrace>::new
Zed::init_panic_hook::{closure#0}
std::panicking::rust_panic_with_hook
std::panicking::begin_panic_handler::{{closure}}
std::sys_common::backtrace::__rust_end_short_backtrace
_rust_begin_unwind
core::panicking::panic_fmt
<text::BufferSnapshot>::summary_for_anchor::<usize>
<multi_buffer::Anchor as multi_buffer::ToOffset>::to_offset
<editor::display_map::DisplayMap>::splice_inlays
<editor::Editor>::splice_inlay_hints
editor::inlay_hint_cache::fetch_and_update_hints::{closure#0}::{closure#0}
<async_task::raw::RawTask<<async_task::runnable::Builder<_>>::spawn_local::Checked<core::pin::Pin<alloc::boxed::Box<dyn core::future::future::Future<Output = core::result::Result<(), anyhow::Error>>>>>, core::result::Result<(), anyhow::Error>, <gpui::executor::ForegroundExecutor>::spawn::inner<core::result::Result<(), anyhow::Error>>::{closure#0}, ()>>::run
<gpui::platform::mac::platform::MacPlatform as gpui::platform::Platform>::run
Zed::main
std::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()>
std::rt::lang_start::<()>::{closure#0}
std::rt::lang_start_internal
_main
```
class of panics.


Release Notes:

- Fixed occasional panics during collaborative editing with inlay hints
on both sides

Co-authored-by: Conrad <conrad@zed.dev>
2024-02-27 22:19:11 +02:00
Dzmitry Malyshau
cb75c57fc0
Cleanup dependencies (part 4) (#8468)
Follow-up to #8425 . Final part - adds the CI check.

Release Notes:
- N/A
2024-02-27 20:41:49 +02:00
Thorsten Ball
ac31c824e4
Use numeric sorting if possible in project panel (#8486)
Previously, if you had the following files/folders in your project

    1-abc
    10
    11-def
    ...
    2
    21-abc

that's how we'd display them.

With this change, we now try to parse them as numbers, if possible, and
use that to sort. If we can't parse a component as a number, we fall
back to normal string comparison.

End result is this:

    1-abc
    2
    10
    11-def
    ...
    21-abc


Release Notes:

- Fixed filenames with numeric components (`1.txt`, `1/one.txt`, ...)
not being sorted as numbers, but as string.

Before:

![screenshot-2024-02-27-18 29
43@2x](https://github.com/zed-industries/zed/assets/1185253/2d223126-329f-4ae7-9a12-d33e2c3fe52f)


After:

![after](https://github.com/zed-industries/zed/assets/1185253/f4f98fa0-e66f-40aa-aa28-189143cbb75f)

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-27 18:42:15 +01:00
Thorsten Ball
3036c0cab7
Remove dead apply_code_actions_on_save code (#8488)
I think this was a left-over from when Conrad and I worked on this but
then it was changed to work with `format`.

Release Notes:

- N/A
2024-02-27 17:38:15 +01:00
Thorsten Ball
7acd6879db
Fix copying folders into themselves to create copies (#8484)
This fixes #7314 and #7778.

The problem was copying a folder into itself, which is actually quite a
common operation in macOS's `Finder.app`: you select a folder, hit
`cmd-c` and `cmd-v` and have a copy. That's also how it works in VS
Code.

The fix here is to detect when we're copying a folder into itself and
treating it like we're copying a file into itself: we don't want to copy
into the target, we want to copy into the folder one level higher up,
which will then automatically add a ` copy` to the end of the name.

Release Notes:

- Fixed ability to copy folders into themselves by selecting them in
project panel and hitting `copy` and `paste`. Instead of endless
recursion, a copy of the folder is now created.
([#7314](https://github.com/zed-industries/zed/issues/7314)).

Demo:



https://github.com/zed-industries/zed/assets/1185253/2141310a-991d-491d-8498-eb766275a1f5
2024-02-27 14:57:46 +01:00
Antonio Scandurra
7cbdea2ca0
Revert "Add support of auto folded directories" (#8476)
Reverts zed-industries/zed#7674

@ABckh: reverting this as it introduced a significant performance
slowdown, most likely caused by iterating through all the snapshot
entries to determine whether a directory is foldable/unfoldable/omitted.
It would be great if you could open a new PR that reverts this revert
and addresses the performance issues. Thank you!

/cc: @maxbrunsfeld 

Release notes:

- N/A
2024-02-27 11:26:18 +01:00
Thorsten Ball
ddca6a3fb7
Debounce refresh of inlay hints on buffer edits (#8282)
I think this makes it less chaotic to edit text when the inlay hints are
on.

It's for cases where you're editing to the right side of an inlay hint.
Example:

```rust
for name in names.iter().map(|item| item.len()) {
    println!("{:?}", name);
}
```

We display a `usize` inlay hint right next to `name`.

But as soon as you remove that `.` in `names.iter` your cursor jumps
around because the inlay hint has been removed.

With this change we now have a 700ms debounce before we update the inlay
hints.

VS Code seems to have an even longer debounce, I think somewhere around
~1s.

Release Notes:

- Added debouncing to make it easier to edit text when inlay hints are
enabled and to save rendering of inlay hints when scrolling. Both
debounce durations can be configured with `{"inlay_hints":
{"edit_debounce_ms": 700}}` (default) and `{"inlay_hints":
{"scroll_debounce_ms": 50}}`. Set a value to `0` to turn off the
debouncing.


### Before


https://github.com/zed-industries/zed/assets/1185253/3afbe548-dcfb-45a3-ab9f-cce14c04a148



### After



https://github.com/zed-industries/zed/assets/1185253/7ea90e42-bca6-4f6c-995e-83324669ab43

---------

Co-authored-by: Kirill <kirill@zed.dev>
2024-02-27 11:18:13 +01:00
Piotr Osiewicz
cbdc07dcd0
project: enable missing project_core/test-support feature when test-support is enabled (#8471)
This fixes collab's test build failure that @ConradIrwin spotted.


Release Notes:

- N/A
2024-02-27 10:07:40 +01:00
Dheeraj
af14bc7a27
Fall back to stdout if log file is inaccessible (#8415)
https://github.com/zed-industries/zed/assets/31967125/644f3524-e680-457c-bf4c-a7f11f3ec8db

Fixes #8209
Defaults to env logger in case of open/access failure.

Release Notes:

- Improved Zed behavior when no log file access is possible ([8209](https://github.com/zed-industries/zed/issues/8209))

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2024-02-27 09:48:19 +02:00
Conrad Irwin
8fc2431a2a
vim: Keep multi-cursor on escape (#8464)
Release Notes:

- vim: Preserve multiple selections when returning to normal mode.

/cc @mrnugget
2024-02-26 22:54:02 -07:00
Hans
f3fa3b910a
vim: Add HTML tag support for #4503 (#8175)
a simple code for html tag support, I've only done the basics, and if
it's okay, I'll optimize and organize the code, and adapt other parts
like `is_multiline`, `always_expands_both_ways`, `target_visual_mode`,
etc

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-02-26 22:48:19 -07:00
riccardofano
a42b987929
Add :tabonly and :only vim commands (#8337)
Release Notes:

- Added
[`:tabo[nly][!]`](https://neovim.io/doc/user/tabpage.html#%3Atabonly),
closes all the tabs except the active one but in the current pane only,
every other split pane remains unaffected.
The version with the `!` force closes the tabs while the one without
asks you to save or discard the changes.
- Added [`:on[ly][!]`](https://neovim.io/doc/user/windows.html#%3Aonly),
closes all the tabs *and* panes except the active one.
The version with the `!` force closes the tabs while the one without
asks you to save or discard the changes.
Since Zed does not have different splits per tab like in Neovim `:only`
works the same as it does in VscodeVim.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-02-26 22:15:50 -07:00
Conrad Irwin
c31626717f
channel projects (#8456)
Add plumbing for hosted projects. This will currently show them if they
exist
but provides no UX to create/rename/delete them.

Also changed the `ChannelId` type to not auto-cast to u64; this avoids
type
confusion if you have multiple id types.


Release Notes:

- N/A
2024-02-26 22:15:11 -07:00
Conrad Irwin
8cf36ae603
vim: Fix some problems with visual mode testing (#8461)
Release Notes:

- N/A
2024-02-26 20:15:27 -07:00
Daniel Banck
bbc4ed9cab
Add language server for Terraform (#7657)
* Depends on: https://github.com/zed-industries/zed/pull/7449
* Closes: https://github.com/zed-industries/zed/issues/5098

---

This PR adds support for downloading and running the Terraform language
server for `*.tf` and `*.tfvars` files. I've verified that the code
works for `aarch64` and `x86_64` macOS. Downloading new language server
versions on release also works as expected.

Furthermore this PR adds:
- A short docs page for Terraform
- An icon for `*.tf` and `*.tfvars` files

## UX

### File Icons

![CleanShot 2024-02-10 at 23 10
13@2x](https://github.com/zed-industries/zed/assets/45985/6f7cd4f0-e94c-4cfb-b3e9-64b0e33c8a43)

### Completion

![CleanShot 2024-02-13 at 20 54
15@2x](https://github.com/zed-industries/zed/assets/45985/18fafa3b-cb50-4f51-b071-ca9eee3521a6)

### Hover

![CleanShot 2024-02-13 at 20 53
40@2x](https://github.com/zed-industries/zed/assets/45985/4d215315-e019-4d3d-b23c-2691db1803e3)

### Go to definition

![2024-02-13 20 56
28](https://github.com/zed-industries/zed/assets/45985/c21d562f-eb0b-4df9-9175-c53b9923344e)

### Formatting

![2024-02-13 20 59
06](https://github.com/zed-industries/zed/assets/45985/0cdf4ec5-e231-4c8a-a257-cae30a8edc8b)

and more!

## Known issue(s)

@fdionisi discovered that sometimes completion results are inserted with
the wrong indentation. Or rather, if you look closely, they are inserted
with the correct indentation and then something shifts the closing `}`.
I don't think this is related to LSP support and can be addressed in a
separate PR.

![2024-02-13 20 58
16](https://github.com/zed-industries/zed/assets/45985/94a118dd-95f5-4e38-8f83-75fec7a0dddf)

Release Notes:

- Add language server support for Terraform
([#5098](https://github.com/zed-industries/zed/issues/5098)).

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2024-02-26 17:08:49 -08:00
Kirill Bulatov
a0c8debd35
Mention possible run options in the task modal placeholder (#8449)
Release Notes:

- Improved run task modal's placeholder

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-02-27 00:04:56 +02:00
Piotr Osiewicz
009384f948
Extract project_core out of project (#8438)
That's done to unblock work for dynamic tasks (`task` crate has to
access the worktree yet it is a dependency of a `project`).
Release Notes:

- N/A
2024-02-26 22:09:22 +01:00
Piotr Osiewicz
72009de309
chore: Fix warning from 1.77 rustc (#8265)
/cc @maxbrunsfeld , I didn't remove the field outright since I'm not
sure if the intent is to use it eventually in extensions work.
This is the warning we're getting on 1.77 (release date: 03.21.2024) :
```
warning: field `0` is never read
  --> crates/language/src/language_registry.rs:81:12
   |
81 |     Loaded(PathBuf, tree_sitter::Language),
   |     ------ ^^^^^^^
   |     |
   |     field in this variant
   |
   = note: `#[warn(dead_code)]` on by default
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
81 |     Loaded((), tree_sitter::Language),
   |            ~~

warning: field `0` is never read
  --> crates/language/src/language_registry.rs:82:13
   |
82 |     Loading(PathBuf, Vec<oneshot::Sender<Result<tree_sitter::Language>>>),
   |     ------- ^^^^^^^
   |     |
   |     field in this variant
   |
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
82 |     Loading((), Vec<oneshot::Sender<Result<tree_sitter::Language>>>),
   |             ~~
```
Release Notes:

- N/A
2024-02-26 21:51:45 +01:00
Conrad Irwin
bdf59b8f06
fix migration (#8451)
Release Notes:

- N/A
2024-02-26 13:50:26 -07:00
Julia
d4584a10b6
Tell Wayland compositor we can handle keyboard ver 4 for repeat info (#8446)
Fixes us not getting Wayland key repeat info from the compositor

Release Notes:

- N/A
2024-02-26 15:13:01 -05:00
Igal Tabachnik
3b2e315ead
Open a new file on double-clicking the tab bar (#8431)
Fixes #6818

This is a convenience feature that exists in other editors, allowing
quick creation a new tab by double-clicking the empty space on the tab
bar:
![2024-02-26 14 26
16](https://github.com/zed-industries/zed/assets/601206/55d99a84-2e61-494d-b06c-6e5f15071655)

Release Notes:

- Added the ability to open a new buffer when double-clicking on the tab
bar ([#6818](https://github.com/zed-industries/zed/issues/6818)).
2024-02-26 14:07:04 -05:00
Bennet Bo Fenner
43163a0154
Support rendering strikethrough text in markdown (#8287)
Just noticed strikethrough text handling was not implemented for the
following:

Chat

![image](https://github.com/zed-industries/zed/assets/53836821/ddd98272-d4d4-4a94-bd79-77e967f3ca15)

Markdown Preview

![image](https://github.com/zed-industries/zed/assets/53836821/9087635c-5b89-40e6-8e4d-2785a43ef318)

Code Documentation

![image](https://github.com/zed-industries/zed/assets/53836821/5ed55c60-3e5e-4fc2-86c2-a81fac7de038)

It looks like there are three different markdown parsing/rendering
implementations, might be worth to investigate if any of these can be
combined into a single crate (looks like a lot of work though).

Release Notes:

- Added support for rendering strikethrough text in markdown elements
2024-02-26 21:04:48 +02:00
Ben Hamment
7d0c515be9
Improve Ruby grammar to recognize method parameters (#8284)
Release Notes:

- Improved Ruby Grammar to recognise various method parameters

![image](https://github.com/zed-industries/zed/assets/7274458/45d4ee2e-d174-4835-a461-22eee428a73b)


![image](https://github.com/zed-industries/zed/assets/7274458/c1bbf307-4f6b-4839-81dc-9d982c85bc58)
2024-02-26 10:09:52 -08:00
Yury Abykhodau
011ae8536c
Add support of auto folded directories (#7674)
Added support of auto collapsed directories, for example when directory
has only one directory inside we should display it as dir1/dir2 (#6935
). Please feel free to propose better solutions, as I am new in Rust

Demo:
https://streamable.com/seo3n9

Release Notes:

- Added support for auto-collapsing directories.
2024-02-26 10:01:59 -08:00
Conrad Irwin
f27d59896f
unique channel names (#8439)
Before this change duplicate channels were ordered arbitrarily, which
put the
collab channel in an inconsistent state.

Release Notes:

- Fixed duplicate channel names appearing in the collab sidebar.
2024-02-26 10:07:22 -07:00
Dzmitry Malyshau
a44fc24445
Clean up many small dependencies (part 3) (#8425)
Follow-up to #8353

Release Notes:
- N/A
2024-02-26 11:08:57 +02:00
Marshall Bowers
d8276b0f0d
Hoist itertools dependency to workspace level (#8417)
This PR hoists the `itertools` dependency to the workspace level.

Release Notes:

- N/A
2024-02-25 20:37:52 -05:00
Marshall Bowers
841e010fa4
Hoist chrono dependency to workspace level (#8414)
This PR hoists the `chrono` dependency to the workspace level.

Release Notes:

- N/A
2024-02-25 18:52:59 -05:00
Marshall Bowers
6ef32374d6
Add command_palette_hooks crate (#8398)
This PR introduces a new `command_palette_hooks` crate that contains the
types used to hook into the behavior of the command palette.

The `CommandPaletteFilter` was previously extracted to the `copilot`
crate in #7095, solely because that was the earliest ancestor of the
crates that depended on it.

The `CommandPaletteInterceptor` was still defined in `command_palette`
itself.

Both of these types were consumed by other crates wanting to influence
the behavior of the command palette, but required taking a dependency on
the entire `command_palette` crate in order to gain access to these
hooks.

By moving them out into their own crate, we can improve the compile
order and make crates like `vim` able to begin building sooner without
having to wait for `command_palette` to finish compiling.

Here's a comparison of the compilation graph before and after (ignore
the timings):

#### Before

<img width="332" alt="Screenshot 2024-02-25 at 12 42 29 PM"
src="https://github.com/zed-industries/zed/assets/1486634/a57c662e-fbc2-41ab-9e30-cca17afa6c73">

#### After

<img width="362" alt="Screenshot 2024-02-25 at 12 51 15 PM"
src="https://github.com/zed-industries/zed/assets/1486634/c1a6d29c-b607-4604-8f1b-e5d318bf8849">

Release Notes:

- N/A
2024-02-25 13:21:20 -05:00
Marshall Bowers
b29946130e
Hoist languages crate's dependencies to the workspace level (#8394)
This PR hoists all of the dependencies of the `languages` crate to the
workspace level.

Release Notes:

- N/A
2024-02-25 12:02:59 -05:00
Bennet Bo Fenner
934af6ad45
recent projects: fix list flashing/empty (#8376)
If the list is large (size > overdraw + available height) the
`all_rendered` check was preventing the list from returning an inferred
size. Theoretically we can now report heights which are actually too
small (because not all items were affected during layout), this can be
manually adjusted using the overdraw parameter. In this case its fine
because the picker is inside a max_height which should never be more
then the overdraw we specify (1000 px), and the list will shrink down
either way when the request_measured_layout callback is called again.

Release Notes:

- Fixed flashing of recent projects list when there were a lot of
projects in the list
([#8364](https://github.com/zed-industries/zed/issues/8364#issuecomment-1962849393)).
2024-02-25 17:22:01 +02:00
Marshall Bowers
053b6cc715
Rework extension filtering to use a ToggleButton (#8387)
This PR reworks the extension filtering to use a `ToggleButton`, since
the filter states are mutually-exclusive.

<img width="1136" alt="Screenshot 2024-02-25 at 10 04 59 AM"
src="https://github.com/zed-industries/zed/assets/1486634/52c621da-201c-42b9-805d-62e3ab66f94b">

Release Notes:

- N/A
2024-02-25 10:17:50 -05:00
Hugo Urías
37a12a366f
Fix double menu item separator in "Help" section of app menu (#8351)
I've modified the code at `crates/zed/src/app_menus.rs` as it looks like
there was a typo and instead of one
`MenuItem::separator()` there were two.

It would be something like this:

<img width="1512" alt="Captura de pantalla 2024-02-25 a las 16 12 10"
src="https://github.com/zed-industries/zed/assets/93369643/d35d5b57-247c-4a1f-b65a-a1b68cd302b9">
2024-02-25 10:17:10 -05:00
Joseph T. Lyons
633e31a47f
Allow extensions to be filtered on installed and not installed (#8375)
Partially resolves: https://github.com/zed-industries/zed/issues/7785

Right now, we can engage `Only show installed`, but I've been wanting to
be able to filter down to just uninstalled extensions too, so I can
browse things I don't have. I changed this to have 2 checkboxes,
`Installed` and `Not installed` and both are on by default. You deselect
them to filter down.

<img width="1608" alt="SCR-20240225-etyg"
src="https://github.com/zed-industries/zed/assets/19867440/e2267651-ff86-437b-ba59-89f3d338ea02">

Release Notes:

- Allow extensions list to be filtered down to both installed and not
installed.
2024-02-25 05:07:13 -05:00
Kirill Bulatov
882cd6e52f
Revert "Bump tree-sitter, wasmtime (#8306)" (#8373)
This reverts commit d4973846c0.

Fixes https://github.com/zed-industries/zed/issues/8360 and
https://github.com/zed-industries/zed/issues/8362


Release Notes:

- N/A
2024-02-25 10:35:19 +02:00