Commit Graph
39175 Commits
Author SHA1 Message Date
Marshall Bowers c18888a72b Add new ThemeColors values to the theme printer 2023-11-07 08:59:37 -05:00
Antonio Scandurra d14a35be66 Fix warning 2023-11-07 14:31:17 +01:00
Antonio Scandurra c4aef05877 Add colors for document highlights 2023-11-07 13:15:08 +01:00
Antonio Scandurra ccdb5b2857 Merge remote-tracking branch 'origin/main' into editor2-paint 2023-11-07 13:09:48 +01:00
Antonio Scandurra 103ec87630 Remove focused field and use FocusHandle instead in Editor 2023-11-07 12:46:31 +01:00
Antonio Scandurra 0dbb8f8b4d Paint lines 2023-11-07 12:25:33 +01:00
Conrad Irwin 8a573889bd Smoke test for event handling 2023-11-06 21:05:22 -07:00
Conrad Irwin 6645ea9bd7 Flesh out gpui2 test support 2023-11-06 21:05:11 -07:00
Conrad Irwin f18d1345f1 Try notarytool (#3239)
Try to use notarytool to fix build problems
2023-11-06 18:16:38 -07:00
490c08a10a wip: picker
co-authored-by: nathan <nathan@zed.dev>
co-authored-by: max <max@zed.dev>
2023-11-06 17:09:38 -08:00
Mikayla bb23480495 Checkpoint 2023-11-06 15:11:22 -08:00
Mikayla 97ee77c3f8 Checkpoint 2023-11-06 14:26:10 -08:00
Nate Butler b2c874f0d7 Add theme importer (#3246)
[[PR Description]]

Thanks @maxdeviant for all the help with this one 🫂 

- Adds the `theme_importer` crate
- Adds the ability to import themes in VSCode Format.
- Adds the `assets/themes/src` folder with source files for imported
themes
- Adds an initial set of themes: `andromeda`, `ayu`, `dracula`,
`gruvbox`, `night-owl`, `noctis`, `palenight`, `rose-pine`, `solarized`,
`synthwave-84`.

From the README:

## Usage

- `cargo run -p theme_importer` - Import the context of
`assets/themes/src`

---

## Troubleshooting

As the importer generates rust files, you may need to manually do some
cleanup in `registry.rs` and `themes/mod.rs` if you remove themes or
delete the `themes` folder in the theme crate.

---

## Required Structure

To import a theme or series of themes 3 things are required:

- `family.json`: A JSON file containing the theme family metadata and
list of theme variants
- `{theme_name}.json`: One theme json for each theme variant
- `LICENSE`: A license file for the theme family

### `family.json`

#### `name`

The name of the theme family. Avoid special characters.

This will be used for the theme family directory name (lowercased) and
the theme family name in the Zed UI.

Good:

- `Rose Pine`
- `Synthwave 84`
- `Monokai Solarized`

Bad:

- `Rosé Pine`
- `Synthwave '84`
- `Monokai (Solarized)`

#### `author`

The author of the theme family. This can be a name or a username.

This will be used for the theme family author in the Zed UI.

#### `themes`

A list of theme variants.

`appearance` can be either `light` or `dark`. This will impact which
default fallback colors are used, and where the theme shows up in the
Zed UI.

### `{theme_name}.json`

Each theme added to the family must have a corresponding JSON file. This
JSON file can be obtained from the VSCode extensions folder (once you
have installed it.) This is usually located at `~/.vscode/extensions`
(on macOS).

You can use `open ~/.vscode/extensions` to open the folder in Finder
directly.

Copy that json file into the theme family directory and tidy up the
filenames as needed.

### `LICENSE`

A LICENSE file is required to import a theme family. Failing to provide
a complete text license will cause it to be skipped when the import is
run.

If the theme only provices a license code (e.g. MIT, Apache 2.0, etc.)
then put that code into the LICENSE file.

If no license is provided, either contact the theme creator or don't add
the theme.

---

### Complete Example:

An example family with multiple variants:

```json
{
  "name": "Ayu",
  // When both name and username are available
  // prefer the `username (name)` format
  "author": "dempfi (Ike Ku)",
  "themes": [
    {
      "name": "Ayu Light",
      "file_name": "ayu-light.json",
      "appearance": "light"
    },
    {
      "name": "Ayu Mirage",
      "file_name": "ayu-mirage.json",
      "appearance": "dark"
    },
    {
      "name": "Ayu Dark",
      "file_name": "ayu-dark.json",
      "appearance": "dark"
    }
  ]
}
```

An example single variant family:

```json
{
  "name": "Andromeda",
  "author": "Eliver Lara (EliverLara)",
  "themes": [
    {
      "name": "Andromeda",
      "file_name": "andromeda.json",
      "appearance": "dark"
    },
    {
      "name": "Andromeda Bordered",
      "file_name": "andromeda-bordered.json",
      "appearance": "dark"
    }
  ]
}
```


Release Notes:

- N/A
2023-11-06 16:08:05 -05:00
Nate Butler ea579ebcb7 Update Cargo.toml 2023-11-06 16:02:21 -05:00
Nate Butler 4cb245433e Add a README for theme_importer 2023-11-06 16:00:57 -05:00
Mikayla b83856e669 Snapshot for kirill 2023-11-06 12:33:20 -08:00
Nate Butler 4e52e68a43 Finish up initial themes 2023-11-06 15:24:36 -05:00
Nate Butler d4745027be Format themes 2023-11-06 14:58:34 -05:00
Nate Butler 6c0f5f9965 Add additional themes, update theme importer 2023-11-06 14:54:21 -05:00
Mikayla a15e3f05ff WIP 2023-11-06 11:18:56 -08:00
Conrad Irwin 0a0c112b37 Use gpui instead of gpui2 consistently (#3245)
Release Notes:

N/A
2023-11-06 12:02:58 -07:00
Conrad Irwin a914935a6e Use gpui instead of gpui2 consistenytly 2023-11-06 11:50:33 -07:00
Conrad Irwin a8dca1cac8 editor2 rendering (#3244)
- Make tab bar visible
- Fix tab text colors
- Ensure panes cover the available space
- Make the close button close
- Fix bug when unsubscribe called after remove
- WIP: start on editor element
- Add hover behaviour to tabs
- Add PointingHand on tabs
- gpui2: Add on_hover events
- Tooltip on tabs
- MOAR TOOLTIPS
- Use an `IconButton` for the tab close button
- Remove unneeded type qualification
- Tooltips in mouse event handler & fix executor timer
- Move more tooltip logic into gpui2 & fix tooltip moving on paint
- Update tooltip code a bit
- Allow multiple subscriptions from one entity handle

Release Notes:

- N/A
2023-11-06 11:29:42 -07:00
Nate Butler dd2a3e2eb2 Add Nord Theme 2023-11-06 13:25:27 -05:00
Marshall Bowers 4a6516a2ab Add interactivity to Checkbox component (#3240)
This PR adds interactivity to the `Checkbox` component.

They can now be checked and unchecked by clicking them.

Release Notes:

- N/A
2023-11-06 13:22:25 -05:00
Mikayla 8dc072cae6 WIP: change over background executor test helpers 2023-11-06 10:16:08 -08:00
Conrad Irwin 20eb31b450 Merge branch 'main' into editor2-rendering 2023-11-06 11:06:43 -07:00
Conrad Irwin cd6387fc1e Allow multiple subscriptions from one entity handle 2023-11-06 11:03:14 -07:00
Antonio Scandurra 0f7125f4f2 WIP 2023-11-06 18:59:46 +01:00
Conrad Irwin d7f608c1e2 tooltip2 (#3237)
- Fix executor.timer() in gpui2
- Add support for tooltips 

[[PR Description]]

Release Notes:

- N/A
2023-11-06 10:51:01 -07:00
Nate Butler 9427239b0d Add Noctis Theme 2023-11-06 12:43:10 -05:00
Conrad Irwin 39fc3505ee Tidy up a bit better 2023-11-06 10:37:35 -07:00
Kirill Bulatov 5e44912ff2 Properly toggle diagnostics (#3243)
Follow-up of https://github.com/zed-industries/zed/pull/3236 that fixes
a bug introduced in that PR: diagnostics warning toggle stopped working.

Release Notes:

- N/A
2023-11-06 19:35:49 +02:00
Kirill Bulatov d661451e06 Properly toggle diagnostics 2023-11-06 19:29:31 +02:00
Marshall Bowers 31cfb83723 Merge branch 'main' into import-theme 2023-11-06 12:08:46 -05:00
c905d4f66d Rename fields in ThemeColors (#3242)
This PR applies a number of field renames in the `ThemeColors` struct
from the `import-theme` branch.

This will help prevent this branch from diverging too far from `main`.

Release Notes:

- N/A

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-06 11:53:27 -05:00
Conrad Irwin 2d7daae4a0 Use notarytool to bundle 2023-11-06 09:38:09 -07:00
Julia cbc40ef28c Actually find downloaded binary in Elixir cached binary method (#3183)
Language adapters 2.0 will systematically fix this kind of issue and
cause world peace but until we do that let's be less broken

Release Notes:

- Fixed being unable to find already downloaded Elixir-LS binary on the
file system.
2023-11-06 11:37:45 -05:00
Julia 97445f3fc3 zed2: Actually find downloaded binary in Elixir cached binary method 2023-11-06 11:31:31 -05:00
Piotr Osiewicz e75bdd4907 chore: Run multitarget build in script/bundle
This has a chance to speed up a build in case where e.g. we're single-threaded in aarch64 build; at that point the x86_64 codegen can take place. Also, MIR can probably be shared between the two architectures, further reducing build time.
2023-11-06 17:21:34 +01:00
Julia 576df9c872 Actually find downloaded binary in Elixir cached binary method 2023-11-06 11:18:36 -05:00
Nate Butler c8a3d6402d Add gruvbox source theme, strip comments 2023-11-06 11:16:09 -05:00
Nate Butler 5bee117443 Skip .DS_Store files when scanning themes folder 2023-11-06 11:03:17 -05:00
Nate Butler 3eb9ed1e1d Ignore generated themes 2023-11-06 10:59:00 -05:00
Nate Butler 3811385132 Remove unused file 2023-11-06 10:57:25 -05:00
Nate Butler a72daab08f Add Andromeda source theme 2023-11-06 10:57:15 -05:00
Piotr Osiewicz 3560f8a7bc chore: Update vue.js parser (fixes wonky HTML parsing) (#3238)
Vue.js defined a bunch of symbols in it's scanner that collided with
those defined in HTML Tree-sitter grammar. I simply removed them as they
were meant for consumption by the external parties interested in HTML
parser with Vue support - since we handle that ourselves this is not
really necessary to preserve anymore. cc was firing up a bunch of
warnings about unused symbols when I've marked those functions as
`static`, so yeah.
Release Notes:

- Fixed HTML highlighting breaking in presence of <!-- --> comments
(fixes zed-industries/community#2166).
2023-11-06 16:16:46 +01:00
Antonio Scandurra 53e7fcfd1f Paint editor background 2023-11-06 15:54:09 +01:00
Piotr Osiewicz cfa516caee chore: Update vue.js parser (fixes wonky HTML parsing)
Vue.js defined a bunch of symbols in it's scanner that collided with those defined in HTML Tree-sitter grammar. I simply removed them as they were meant for consumption by the external parties interested in HTML parser with Vue support - since we handle that ourselves this is not really necessary to preserve anymore. cc was firing up a bunch of warnings about unused symbols, so yeah.
2023-11-05 22:56:35 +01:00
Kirill Bulatov 3058c1acdf More heuristics for diagnostics updates (#3236)
Follow-up of https://github.com/zed-industries/zed/pull/3225
That PR enabled every `project::Event::DiskBasedDiagnosticsFinished` to
update the diagnostics, which turned out to be bad, Zed does query for
more diagnostics after every excerpt update, and that seems to be due to
`Event::Edited` emitted by the multibuffers created in the diagnostics
panel.

* now, instead of eagerly updating the diagnostics every time, only do
that if the panel has 0 or 1 caret placed and no changes were made in
the panel yet.
Otherwise, use previous approach and register the updated paths to defer
their update later.

* on every `update_excerpts` in the diagnostics panel, query the entire
diagnostics summary (and store it for the future comparisons), compare
old and new summaries and re-query diagnostics for every path that's not
in both summaries.
Also, query every path that was registered during the
`DiskBasedDiagnosticsFinished` updates that were not eagerly updated
before.

This way we're supposed to get all new diagnostics (for new paths added)
and re-check all old paths that might have stale diagnostics now.

* do diagnostics rechecks concurrently for every path now, speeding the
overall process

Release Notes:

- Fixed diagnostics triggering too eagerly during multicaret edits and
certain stale diagnostics not being removed in time
2023-11-05 16:17:38 +02:00