Commit log

28a62af Clean up visible inlay hints that got removed from the cache (#7399)

Click to expand commit body
Fixes another flack in the inlay hint cache.
Now that test does not fail after 500 iterations and seems to be stable
at last.

Release Notes:

- N/A

Kirill Bulatov created

6863b92 Add Terraform & HCL syntax highlighting (#6882)

Click to expand commit body
Terraform and HCL are almost the same language, but not quite so
proposing them as separate languages within Zed. (Terraform is an
extension of HCL, with a different formatter.)

This is just adding the language definition, parsing and highlighting
functionality, not any LSP or formatting beyond that for either
language.

I've taken a bunch of inspiration from Neovim for having the separate
languages, and also lifted some of their `scm` files (with attribution
comments in this codebase) as the tree-sitter repo doesn't contain them.
(Neovim's code is Apache-2.0 licensed, so should be fine here with
attribution from reading Zed's licenses files.) I've then amended to
make sure the capture groups are named for things Zed understands. I'd
love someone from Zed to confirm that's okay, or if I should clean-room
implement the `scm` files.

Highlighting in Terraform & HCL with a moderate amount of syntax in a
file (Terraform on left, HCL on right.)

<img width="1392" alt="Screenshot 2024-01-31 at 18 07 45"
src="https://github.com/zed-industries/zed/assets/696/1d3c9a08-588e-4b8f-ad92-98ce1e419659">

Release Notes:

- (|Improved) ...
([#5098](https://github.com/zed-industries/zed/issues/5098)).

Caius Durling created

21797ba file_finder: Simplify removal of file name from file path (#7398)

Click to expand commit body
This PR simplifies the removal of the file name from the file path when
computing the file finder matches.

Release Notes:

- N/A

Marshall Bowers created

ce62404 Correctly use the base element in `HighlightedLabel` (#7397)

Click to expand commit body
This PR updates the `HighlightedLabel` to correctly render its base
element, which is the one that receives the styling properties, instead
of rendering a new `LabelLike`.

Release Notes:

- N/A

Marshall Bowers created

8911e1b Make inlay hints test less flacky (#7396)

Click to expand commit body
Suppresses a flacky inlay hints test failures like
https://github.com/zed-industries/zed/actions/runs/7788741514a for now.

Release Notes:

- N/A

Kirill Bulatov created

2ed45d7 File finder UI enhancement (#7364)

Click to expand commit body
File finder looks and feels a little bulky now. It duplicates file names
and consumes too much space for each file.

This PR makes it more compact:
- File name is trimmed from the path, removing duplication
- Path is placed to the right of the file name, improving space usage
- Path is muted and printed in small size to not distract attention from
the main information (file names)

It makes search results easier to look through, consistent with the
editor tabs, and closer in terms of usage to mature editors.

Release Notes:

- File finder UI enhancement

Andrew Lygin created

91303a5 Do not run scheduled CI jobs on forks (#7394)

Click to expand commit body
Runs scheduled CI jobs only on the main repository, not on forks. These
jobs fail on forks and generate unnecessary noise on contributor emails.



Release Notes:

- N/A

Dairon M created

e2e8e52 Beancount syntax highlighting (#7389)

Click to expand commit body
Release Notes:

- Added syntax highlighting for [Beancount](https://beancount.github.io)

Conrad Irwin created

4195f27 Fix hover links in channel buffers (#7393)

Click to expand commit body
Release Notes:

- N/A

Conrad Irwin created

583ce44 Fix cmd+k in terminal and fix sporadic keybind misses (#7388)

Click to expand commit body
This fixes `cmd+k` in the terminal taking 1s to have an effect. It is
now immediate.

It also fixes #7270 by ensuring that we don't set a bad state when
matching keybindings.

It matches keybindings per context and if it finds a match on a lower
context it doesn't keep pending keystrokes. If it finds two matches on
the same context level, requiring more keystrokes, then it waits.



Release Notes:

- Fixed `cmd-k` in terminal taking 1s to have an effect. Also fixed
sporadic non-matching of keybindings if there are overlapping
keybindings.
([#7270](https://github.com/zed-industries/zed/issues/7270)).

---------

Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>

Thorsten Ball , Conrad , and Conrad Irwin created

47329f4 Add `search.match_background` colors to bundled themes (#7385)

Click to expand commit body
This PR populates the `search.match_background` colors in the bundled
themes, using the values from the Zed1 themes.

Release Notes:

- Added theme-specific `search.match_background` colors to built-in
themes.

Marshall Bowers created

223f45c Remove default keybinds for navigating between docks/editors (#7381)

Click to expand commit body
Turns out that these keybindings are active in Vim *and* in non-Vim mode
and they shadow `Ctrl-w` in terminals.

We should fix `Ctrl-w` being shadowed, but until then let's remove the
default keybindings.

Release Notes:

- N/A

Co-authored-by: Kirill <kirill@zed.dev>
Co-authored-by: Conrad <Conrad@zed.dev>

Thorsten Ball , Kirill , and Conrad created

d742b3b Mark the window as dirty when first opening it (#7384)

Click to expand commit body
Otherwise we won't display anything if the window never notifies.

Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>

Antonio Scandurra and Nathan created

3bf412f Use window's screen rather than window itself to start display link

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

Julia , Antonio Scandurra , and Nathan Sobo created

8030e8c Improve the contrast of the default `search_match_background` colors (#7382)

Click to expand commit body
This PR improves the contrast of the default `search_match_background`
colors.

Release Notes:

- Improved the contrast of the default `search.match_background` colors.

Marshall Bowers created

45429a4 Fix inlay hints using stale editor data (#7376)

Click to expand commit body
Refactor the hint query code to pass along an actual `cx` instead of its
potentially stale, cloned version.

Release Notes:

- Fixed occasional duplicate hints inserted and offset-related panics
when concurrently editing the buffer and querying multiple its ranges
for hints

Kirill Bulatov created

0755ce6 picker: Outline Editor::new

Click to expand commit body
That way crates that use Picker::new do not have to codegen constructor of Editor; tl;dr, 10% of LLVM shaved off of crates like vcs_menu or theme_selector in release mode.

Piotr Osiewicz created

87d3f59 Do not show completion documentation if disabled (#7372)

Click to expand commit body
This fixes #7348 by not rendering completions if they are disabled in
the settings. Previously we only checked that setting when starting or
not starting background threads to fetch documentation. But in case we
already have documentation, this stops it from being rendered.

Release Notes:

- Fixed documentation in completions showing up even when disabled via
`show_completion_documentation`
([#7348](https://github.com/zed-industries/zed/issues/7348))

Thorsten Ball created

81bfa5f fix: create the settings and keymaps to unblock file watching

Amin Yahyaabadi created

fde159f build: add Blade font-config sys deps on Linux

Amin Yahyaabadi created

521b2b1 linux: create a hidden window inside the platform

Click to expand commit body
It allows us to receive messages from the dispatcher,
which breaks us out of waiting and lets us execute
main thread runnables as a part of the main loop.

Dzmitry Malyshau created

282cc71 linux: refactor LinuxPlatform to avoid recursive locking from the window callbacks

Dzmitry Malyshau created

8d339ed linux: HACK disable watcher and crash uploader temporarily

Dzmitry Malyshau created

d03f3b9 linux: switch folders to use CONFIG_DIR

Dzmitry Malyshau created

1c410c1 linux: only tick the main thread tasks and one at a time in the event loop

Dzmitry Malyshau created

f92be4b linux: temporarily disable purescript tree sitter

Click to expand commit body
Link error:
  = note: /nix/store/idiaraknw071d20nlqp49s18gbvw4wa0-binutils-2.40/bin/ld: /x/Code/zed/target/x86_64-unknown-linux-gnu/debug/deps/libtree_sitter_haskell-7323f782ad886c6d.rlib(scanner.o): in function `state_new':
          /home/kvark/.cargo/git/checkouts/tree-sitter-haskell-74c278e7a2ef8d7d/cf98de2/src/scanner.c:218: multiple definition of `state_new'; /x/Code/zed/target/x86_64-unknown-linux-gnu/debug/deps/libtree_sitter_purescript-b0a95fb604a5817c.rlib(scanner.o):/home/kvark/.cargo/git/checkouts/tree-sitter-purescript-88dd3ec656c48026/a37140f/src/scanner.c:218: first defined here

Dzmitry Malyshau created

b13b572 linux: disable mac-os specific build commands

Dzmitry Malyshau created

224fe13 blade: fix tile bounds shader FFI

Dzmitry Malyshau created

0a5ebee blade: encapsulate BladeAtlasStorage for indexing

Dzmitry Malyshau created

26ca798 blade: initialize atlas textures

Dzmitry Malyshau created

61fa5e9 blade: always create texture views for atlas tiles

Dzmitry Malyshau created

aae5329 blade: tune belt alignment to match Intel Iris Xe

Dzmitry Malyshau created

13ba8b6 Fix linux target in rust-toolchain.toml

Click to expand commit body
Co-authored-by: Ilia <43654815+istudyatuni@users.noreply.github.com>

Dzmitry Malyshau and Ilia created

d6bbcf5 blade: enforce alignment in the belt

Dzmitry Malyshau created

c5ff46e blade: fix shadow vertex bounds

Dzmitry Malyshau created

cf71fe8 fix MacOS build, switch external RWH to 0.6

Click to expand commit body
leaving blade-internal RWH as 0.5 until this is fixed:
https://github.com/ash-rs/ash/issues/864

Dzmitry Malyshau created

d0a0ce1 blade: mono/poly chrome sprite rendering

Dzmitry Malyshau created

ac74a72 Improve elm-language-server configuration (#7342)

Click to expand commit body
Hi folks! @absynce and I paired a bit to improve the
`elm-language-server` configuration. We have realised that sometimes
`elm-language-server` settings were being reset to default. We had been
configuring `elm-language-server` like this:

```json
"lsp": {
  "elm-language-server": {
    "initialization_options": {
      "disableElmLSDiagnostics": true,
      "onlyUpdateDiagnosticsOnSave": true,
      "elmReviewDiagnostics": "warning"
    }
  }
}
```

And then we noticed that the following communication happened:

```
// Send:
{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{}}}
// Receive:
{"jsonrpc":"2.0","id":5,"method":"workspace/configuration","params":{"items":[{"section":"elmLS"}]}}
// Send:
{"jsonrpc":"2.0","id":5,"result":[null],"error":null}
```

In `elm-language-server` the settings from `didChangeConfiguration`
[replace the initial
settings](https://github.com/elm-tooling/elm-language-server/blob/edd68133883f3902f8940a6e5e2834a9cd627dc1/src/common/providers/diagnostics/diagnosticsProvider.ts#L188).
Setting the value to `{}` effectively resets the configuration options
to defaults.

In Zed, `initialization_options` and `workspace_configuration` are two
different things, but in `elm-language-server` they are coupled.
Additionally, `elm-language-server` is requesting workspace
configuration for the `elmLS` section that doesn't exist.

This PR: 

1. Fixes settings reset on `didChangeConfiguration` by populating
`workspace_configuration` from `initialization_options`
2. Makes workspace configuration requests work by inserting an extra
copy of the settings under the `elmLS` key in `workspace_configuration`
— this is a bit ugly, but we're not sure how to make both kinds of
configuration messages work in the current setup.

This is how communication looks like after the proposed changes:

```
// Send:
{
  "jsonrpc": "2.0",
  "method": "workspace/didChangeConfiguration",
  "params": {
    "settings": {
      "disableElmLSDiagnostics": true,
      "onlyUpdateDiagnosticsOnSave": true,
      "elmReviewDiagnostics": "warning",
      "elmLS": {
        "disableElmLSDiagnostics": true,
        "onlyUpdateDiagnosticsOnSave": true,
        "elmReviewDiagnostics": "warning"
      }
    }
  }
}
// Receive:
{
  "jsonrpc": "2.0",
  "id": 4,
  "method": "workspace/configuration",
  "params": {
    "items": [
      {
        "section": "elmLS"
      }
    ]
  }
}
// Send:
{
  "jsonrpc": "2.0",
  "id": 4,
  "result": [
    {
      "disableElmLSDiagnostics": true,
      "onlyUpdateDiagnosticsOnSave": true,
      "elmReviewDiagnostics": "warning"
    }
  ],
  "error": null
}
```

Things we have considered:

1. Extracting the `elm-language-server` settings into a separate
section: we haven't found this being widely used in Zed, seems that all
language server configuration should fall under the top level `lsp`
section
2. Changing the way `elm-language-server` configuration works:
`elm-language-server` has got integrations with multiple editors,
changing the configuration behaviour would mean updating all the
existing integrations. Plus we are not exactly sure if it's doing
anything wrong.

Release Notes:

- Improved elm-language-server configuration options

Co-authored-by: Jared M. Smith <absynce@gmail.com>

Andrey Kuzmin and Jared M. Smith created

ae2c23b Reintroduce ProMotion support (#7347)

Click to expand commit body
This re-introduces the changes of #7305 but this time we create a
display link using the `NSScreen` associated with the window. We're
hoping we'll get these frame requests more reliably, and this seems
supported by the fact that awakening my laptop restores the frame
requests.

Release Notes:

- See #7305.

Co-authored-by: Nathan <nathan@zed.dev>

Antonio Scandurra and Nathan created

59642bf blade: point to master, remove the override

Dzmitry Malyshau created

8da6e62 Editor toolbar configuration (#7338)

Click to expand commit body
Adds settings for hiding breadcrumbs and quick action bar from
the editor toolbar. If both elements are hidden, the toolbar disappears
completely.

Example:

```json
"toolbar": {
  "breadcrumbs": true,
  "quick_actions": false
}
```

- It intentionally doesn't hide breadcrumbs in other views (for
instance, in the search result window) because their usage there differ
from the main editor.
- The editor controls how breadcrumbs are displayed in the toolbar, so
implementation differs a bit for breadcrumbs and quick actions bar.

Release Notes:

- Added support for configuring the editor toolbar ([4756](https://github.com/zed-industries/zed/issues/4756))

Andrew Lygin created

55185c1 Support documentation as a resolvable property (#7306)

Click to expand commit body
Closes #7288 

<img width="1800" alt="Screenshot 2024-02-03 at 01 56 14"
src="https://github.com/zed-industries/zed/assets/69181766/ed97ef30-c958-45c8-812c-a59bbbd02b19">

Release Notes:
- Improved LSP `completionItem/resolve` request by supporting `documentation` as a resolvable property

Rashid Almheiri created

c9a53b6 Fix the compilation error (#7328)

Click to expand commit body
Follow-up of https://github.com/zed-industries/zed/pull/7326

Release Notes:

- N/A

Kirill Bulatov created

1ab0af2 Revert the commit that broke Zed display capabilities (#7326)

Kirill Bulatov created

06674a2 Add support for relative terminal links (#7303)

Click to expand commit body
Allow opening file paths relative to terminal's cwd


https://github.com/zed-industries/zed/assets/67913738/413a1107-541e-4c25-ae7c-cbe45469d452


Release Notes:

- Added support for opening file paths relative to terminal's cwd
([#7144](https://github.com/zed-industries/zed/issues/7144)).

---------

Co-authored-by: Kirill <kirill@zed.dev>

Robin Pfäffle and Kirill created

54aecd2 Remove unnecessary `focus_invalidated` field (#7320)

Click to expand commit body
I believe at some point this was used for tests but it doesn't seem
necessary anymore.

Release Notes:

- N/A

Antonio Scandurra created

c906fd2 Reduce GPU memory usage (#7319)

Click to expand commit body
This pull request decreases the size of each instance buffer and shares
instance buffers across windows.

Release Notes:

- Improved GPU memory usage.

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>

Antonio Scandurra and Nathan Sobo created

d08d417 Modify the default tab size of OCaml & OCaml Interface to 2 (#7315)

Click to expand commit body
Thanks @pseudomata for the heads up.

Release Notes:
- N/A

Rashid Almheiri created

2e32f58 linux: various fixes across the crates to make it compile

Dzmitry Malyshau created

7c7aad5 blade: port underline shader

Dzmitry Malyshau created