Commit log

0a491e7 workspace: Improve save prompt. (#3025)

Click to expand commit body
Add buffer path to the prompt.

Z-2903

Release Notes:
- Added a "Save all/Discard all" prompt when closing a pane with
multiple edited buffers.

Piotr Osiewicz created

45540a0 Checkpoint

Antonio Scandurra created

55f4aa3 Checkpoint

Antonio Scandurra created

8b63e45 Implement LSP adapter methods for syntax highlighting

Mikayla created

052cb45 Improve lsp log viewer's behavior in the presence of LSP restarts

Click to expand commit body
Improve settings interface to local LSP

Mikayla created

a780357 Checkpoint

Antonio Scandurra created

b516ea2 Checkpoint

Antonio Scandurra created

1fa45c6 Checkpoint

Antonio Scandurra created

c4abd93 WIP

Antonio Scandurra created

91c1768 Checkpoint

Antonio Scandurra created

1a5d6aa Checkpoint

Antonio Scandurra created

fb69f3d Checkpoint

Click to expand commit body
Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Antonio Scandurra and Nathan Sobo created

3fbe93f Checkpoint

Click to expand commit body
Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Antonio Scandurra and Nathan Sobo created

df388d9 Checkpoint

Antonio Scandurra created

0697d08 Restructure `ui` into just `elements` and `components` (#3023)

Click to expand commit body
This PR restructures the `ui` crate into just `elements` and
`components`.

This was already done on the `gpui2-ui` branch, just getting it onto
`main`.

Release Notes:

- N/A

---------

Co-authored-by: Nate Butler <nate@zed.dev>

Marshall Bowers and Nate Butler created

895386c Mainline `Icon` and `IconButton` changes (#3022)

Click to expand commit body
This PR mainlines the `Icon` and `IconButton` changes from the
`gpui2-ui` branch.

Release Notes:

- N/A

Co-authored-by: Nate Butler <nate@zed.dev>

Marshall Bowers and Nate Butler created

6a95f9e WIP

Antonio Scandurra created

ad62a96 Display available stories in storybook CLI (#3021)

Click to expand commit body
This PR updates the storybook CLI to support displaying all of the
available stories.

The `--help` flag will now show a list of all the available stories:

<img width="1435" alt="Screenshot 2023-09-22 at 6 11 00 PM"
src="https://github.com/zed-industries/zed/assets/1486634/284e1a24-46ec-462e-9709-0f9b6e94931f">

Inputting an invalid story name will also show the list of available
stories:

<img width="1435" alt="Screenshot 2023-09-22 at 6 10 43 PM"
src="https://github.com/zed-industries/zed/assets/1486634/1ce3ae3f-ab03-4976-a06a-5a2b5f61eae3">

Release Notes:

- N/A

Marshall Bowers created

fe4248c Scaffold `Toolbar` and `Breadcrumb` components (#3020)

Click to expand commit body
This PR scaffolds the `Toolbar` and `Breadcrumb` components.

Right now they both just consist of hardcoded data.

<img width="846" alt="Screenshot 2023-09-22 at 4 54 00 PM"
src="https://github.com/zed-industries/zed/assets/1486634/70578df2-7216-42d2-97ef-d38b83fb4a25">

<img width="799" alt="Screenshot 2023-09-22 at 4 46 04 PM"
src="https://github.com/zed-industries/zed/assets/1486634/73ca3d8a-baf9-4ed4-b4c4-279c674672a3">

Release Notes:

- N/A

Marshall Bowers created

a237aa8 Checkpoint

Click to expand commit body
Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Antonio Scandurra and Nathan Sobo created

3dc1e91 Checkpoint

Click to expand commit body
Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Antonio Scandurra and Nathan Sobo created

27e3e09 Label component states in stories (#3019)

Click to expand commit body
This PR updates the UI component stories to label the various states
that they are in.

Release Notes:

- N/A

Marshall Bowers created

d1791a9 Checkpoint

Click to expand commit body
Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Antonio Scandurra and Nathan Sobo created

d0b15ed Report which requested font families are not present on the system (#3006)

Click to expand commit body
This PR improves the error message when `FontCache.load_family` attempts
to load a font that is not present on the system.

I ran into this while trying to run the `storybook` for the first time.
The error message indicated that a font family was not found, but did
not provide any information as to which font family was being loaded.

### Before

```
   Compiling storybook v0.1.0 (/Users/maxdeviant/projects/zed/crates/storybook)
    Finished dev [unoptimized + debuginfo] target(s) in 8.52s
     Running `/Users/maxdeviant/projects/zed/target/debug/storybook`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: could not find a non-empty font family matching one of the given names', crates/theme/src/theme_settings.rs:132:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
libc++abi: terminating due to uncaught foreign exception
fish: Job 1, 'cargo run' terminated by signal SIGABRT (Abort)
```

### After

```
   Compiling storybook v0.1.0 (/Users/maxdeviant/projects/zed/crates/storybook)
    Finished dev [unoptimized + debuginfo] target(s) in 7.90s
     Running `/Users/maxdeviant/projects/zed/target/debug/storybook`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: could not find a non-empty font family matching one of the given names: `Zed Mono`', crates/theme/src/theme_settings.rs:132:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
libc++abi: terminating due to uncaught foreign exception
fish: Job 1, 'cargo run' terminated by signal SIGABRT (Abort)
```

Release Notes:

- N/A

Marshall Bowers created

e4e9da7 Checkpoint

Click to expand commit body
Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Antonio Scandurra and Nathan Sobo created

8b6e982 Remove manual mapping in `FromStr` implementation for `StorySelector` (#3018)

Click to expand commit body
This PR removes the need for writing manual mappings in the `FromStr`
implementation for the `StorySelector` enum used in the storybook CLI.

We are now using the
[`EnumString`](https://docs.rs/strum/0.25.0/strum/derive.EnumString.html)
trait from `strum` to automatically derive snake_cased names for the
enums.

This will cut down on some of the manual work needed to wire up more
stories to the storybook.

Release Notes:

- N/A

Marshall Bowers created

71c1e36 Put `Theme` behind an `Arc` (#3017)

Click to expand commit body
This PR puts the `Theme` returned from the `theme` function behind an
`Arc`.

### Motivation

While working on wiring up window focus events for the `TitleBar`
component we ran into issues where `theme` was holding an immutable
borrow to the `ViewContext` for the entirety of the `render` scope,
which prevented having mutable borrows in the same scope.

### Explanation

To avoid this, we can make `theme` return an `Arc<Theme>` to allow for
cheap clones and avoiding the issues with the borrow checker.

Release Notes:

- N/A

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>

Marshall Bowers and Piotr Osiewicz created

343c426 Checkpoint

Antonio Scandurra created

d8c6adf Factor story boilerplate out into separate components (#3016)

Click to expand commit body
This PR factors out the bulk of the boilerplate required to setup a
story in the storybook out into separate components.

The pattern we're using here is adapted from the "[associated
component](https://maxdeviant.com/posts/2021/react-associated-components/)"
pattern in React.

Release Notes:

- N/A

Marshall Bowers created

e979d75 WIP

Nathan Sobo created

afa7045 Tone down inlay hint update logs

Kirill Bulatov created

e84339e reorganize AI crates to structure future development (#3015)

Click to expand commit body
Reorganized assistant/semantic_index crates and introduced AI crate to
include shared functionality.

Release Notes:

- Moved most of the Assistant functionality from ai crate to assistant
crate
- Moved interaction with embedding providers from semantic_index to ai
crate

Kyle Caverly created

fbd6b5b cargo fmt

KCaverly created

dc49dec catchup with main

KCaverly created

68c37ca move embedding provider to ai crate

KCaverly created

1f1c669 Do not resubscribe for Copilot logs events (#3014)

Click to expand commit body
Last follow-up of https://github.com/zed-industries/zed/pull/3002
Fixes
https://zed-industries.slack.com/archives/C04S6T1T7TQ/p1695281196667609

Copilot sends multiple events about its LSP server readiness, not
necessarily recreating the server from scratch (e.g. due to re-sign in
action). Avoid re-adding same log subscriptions on the same LSP server,
which causes panics.

Release Notes:

- N/A

Kirill Bulatov created

d61565d Do not resubscribe for Copilot logs events

Click to expand commit body
Copilot sends multiple events about its LSP server readiness, not necessarily recreating the server from scratch (e.g. due to re-sign in action).
Avoid re-adding same log subscriptions on the same LSP server, which
causes panics.

Kirill Bulatov created

a5e055f Bring UI crate up to date (#3013)

Click to expand commit body
Merges various in-progress gpui2 component branches with the new `ui`
crate.

Nate Butler created

30b105a Remove leftover state doc

Nate Butler created

d14e4d4 Merge branch 'main' into nate/bring-ui-crate-up-to-date

Nate Butler created

f54634a Bring UI crate up to date

Nate Butler created

5083ab7 Add `TrafficLights` component (#3011)

Click to expand commit body
This PR adds a `TrafficLights` component for GPUI2.

<img width="861" alt="Screenshot 2023-09-21 at 11 32 10 PM"
src="https://github.com/zed-industries/zed/assets/1486634/0fe0e847-49b3-44dc-bd4c-64f12f0051c1">

Release Notes:

- N/A

Marshall Bowers created

48e1514 introduce ai crate with completion providers

KCaverly created

66358f2 Update storybook to support stories for individual components (#3010)

Click to expand commit body
This PR updates the `storybook` with support for adding stories for
individual components.

### Motivation

Right now we just have one story in the storybook that renders an entire
`WorkspaceElement`.

While iterating on the various UI components, it will be helpful to be
able to create stories of those components just by themselves.

This is especially true for components that have a number of different
states, as we can render the components in all of the various states in
a single layout.

### Explanation

We achieve this by adding a simple CLI to the storybook.

The `storybook` binary now accepts an optional `[STORY]` parameter that
can be used to indicate which story should be loaded. If this parameter
is not provided, it will load the workspace story as it currently does.

Passing a story name will load the corresponding story, if it exists.

For example:

```
cargo run -- elements/avatar
```

<img width="723" alt="Screenshot 2023-09-21 at 10 29 52 PM"
src="https://github.com/zed-industries/zed/assets/1486634/5df489ed-8607-4024-9c19-c5f4541f97c9">

```
cargo run -- components/facepile
```

<img width="785" alt="Screenshot 2023-09-21 at 10 30 07 PM"
src="https://github.com/zed-industries/zed/assets/1486634/e04a4577-7403-405d-b23c-e765b7a06229">



Release Notes:

- N/A

Marshall Bowers created

5f63346 rename ai crate to assistant crate

KCaverly created

02a85b1 Add local next LSP adapter

Mikayla created

4628639 Update ambiguous theme import (#3009)

Click to expand commit body
Fixes an ambiguous reference to `theme` causing storybook not to build.

Nate Butler created

8440ac3 Fix fmt complaining about order

Nate Butler created

1e6ac8c `theme::*` -> `crate::theme::*;`

Nate Butler created

7711530 Simplify titlebar facepile click rendering / mouse handling

Max Brunsfeld created