Commit Graph

17993 Commits

Author SHA1 Message Date
Dzmitry Malyshau
f92be4b817 linux: temporarily disable purescript tree sitter
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
2024-02-04 15:59:07 -08:00
Dzmitry Malyshau
b13b5726c5 linux: disable mac-os specific build commands 2024-02-04 15:58:29 -08:00
Dzmitry Malyshau
224fe13f9f blade: fix tile bounds shader FFI 2024-02-04 13:59:41 -08:00
Dzmitry Malyshau
0a5ebee9e5 blade: encapsulate BladeAtlasStorage for indexing 2024-02-04 13:03:16 -08:00
Dzmitry Malyshau
26ca798707 blade: initialize atlas textures 2024-02-04 12:45:18 -08:00
Dzmitry Malyshau
61fa5e93a8 blade: always create texture views for atlas tiles 2024-02-04 12:15:41 -08:00
Dzmitry Malyshau
aae532987f blade: tune belt alignment to match Intel Iris Xe 2024-02-04 11:35:19 -08:00
Dzmitry Malyshau
13ba8b6b54
Fix linux target in rust-toolchain.toml
Co-authored-by: Ilia <43654815+istudyatuni@users.noreply.github.com>
2024-02-04 11:34:57 -08:00
Dzmitry Malyshau
d6bbcf503b blade: enforce alignment in the belt 2024-02-04 00:09:32 -08:00
Dzmitry Malyshau
c5ff46e14f blade: fix shadow vertex bounds 2024-02-03 23:51:37 -08:00
Dzmitry Malyshau
cf71fe8bf1 fix MacOS build, switch external RWH to 0.6
leaving blade-internal RWH as 0.5 until this is fixed:
https://github.com/ash-rs/ash/issues/864
2024-02-03 23:50:44 -08:00
Dzmitry Malyshau
d0a0ce1885 blade: mono/poly chrome sprite rendering 2024-02-03 21:30:47 -08:00
Andrey Kuzmin
ac74a72a9e
Improve elm-language-server configuration (#7342)
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](edd6813388/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>
2024-02-04 01:57:24 +02:00
Antonio Scandurra
ae2c23bd8e
Reintroduce ProMotion support (#7347)
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>
2024-02-03 16:33:08 -07:00
Dzmitry Malyshau
59642bf29a blade: point to master, remove the override 2024-02-03 14:13:36 -08:00
Andrew Lygin
8da6e62914
Editor toolbar configuration (#7338)
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))
2024-02-03 22:40:54 +02:00
Rashid Almheiri
55185c159b
Support documentation as a resolvable property (#7306)
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
2024-02-03 22:35:57 +02:00
Kirill Bulatov
c9a53b63a7
Fix the compilation error (#7328)
Follow-up of https://github.com/zed-industries/zed/pull/7326

Release Notes:

- N/A
2024-02-03 18:52:03 +02:00
Kirill Bulatov
1ab0af2fa3
Revert the commit that broke Zed display capabilities (#7326) 2024-02-03 18:32:56 +02:00
Robin Pfäffle
06674a21f9
Add support for relative terminal links (#7303)
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>
2024-02-03 17:04:27 +02:00
Antonio Scandurra
54aecd21ec
Remove unnecessary focus_invalidated field (#7320)
I believe at some point this was used for tests but it doesn't seem
necessary anymore.

Release Notes:

- N/A
2024-02-03 05:41:58 -07:00
Antonio Scandurra
c906fd232d
Reduce GPU memory usage (#7319)
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>
2024-02-03 05:27:08 -07:00
Rashid Almheiri
d08d4174a5
Modify the default tab size of OCaml & OCaml Interface to 2 (#7315)
Thanks @pseudomata for the heads up.

Release Notes:
- N/A
2024-02-03 12:04:15 +02:00
Dzmitry Malyshau
2e32f5867e linux: various fixes across the crates to make it compile 2024-02-03 00:06:20 -08:00
Dzmitry Malyshau
7c7aad5e76 blade: port underline shader 2024-02-02 23:04:56 -08:00
Dzmitry Malyshau
04e49dc493 blade: refactor the atlas to not own the command encoder 2024-02-02 22:22:18 -08:00
Conrad Irwin
1a82470897
Open URLs with cmd-click (#7312)
Release Notes:

- Added ability to cmd-click on URLs in all buffers

---------

Co-authored-by: fdionisi <code@fdionisi.me>
2024-02-02 22:05:28 -07:00
Conrad Irwin
583273b6ee
Bump alacritty to fix some panics (#7313)
Release Notes:

- Fixed some panics in the Terminal
([#6835](https://github.com/zed-industries/zed/issues/6835)).
2024-02-02 20:39:51 -07:00
Conrad Irwin
fcbc220408
Don't log errors on main (#7289)
Release Notes:

- N/A
2024-02-02 19:24:49 -07:00
Conrad Irwin
f09da1a1c8
vim hml (#7298)
- Add a setting for `vertical_scroll_offset`
- Fix H/M/L in vim with scrolloff



Release Notes:

- Added a settings for `vertical_scroll_offset`
- vim: Fix H/M/L with various values of vertical_scroll_offset

---------

Co-authored-by: Vbhavsar <vbhavsar@gmail.com>
Co-authored-by: fdionisi <code@fdionisi.me>
2024-02-02 19:24:36 -07:00
Tom Planche
e1efa7298e
Update configuring_zed__key_bindings.md (#7310)
Added explanations for binding `null` to a keyboard binding.

Release Notes:

- N/A
2024-02-03 02:15:31 +02:00
WindSoilder
430f5d5d53
vim: Convert from visual mode to normal mode with a single click (#6985)
Release Notes:

- Fixed #4319

Here is a demo after the fix:

https://github.com/zed-industries/zed/assets/22256154/a690f146-73c9-4b0e-8527-e4faf690cca2

Actually I'm not really sure should I submit my idea to discussion,
since it's not a large change, and it's something like a bug fix. So I
directly create a pr here.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-02-02 16:44:47 -07:00
Antonio Scandurra
15edc46827
Maintain smooth frame rates when ProMotion and direct mode are enabled (#7305)
This is achieved by starting a `CADisplayLink` that will invoke the
`on_request_frame` callback at the refresh interval of the display.

We only actually draw frames when the window was dirty, or for 2 extra
seconds after the last input event to ensure ProMotion doesn't downclock
the refresh rate when the user is actively interacting with the window.

Release Notes:

- Improved performance when using a ProMotion display with fast key
repeat rates.

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2024-02-02 16:42:46 -07:00
tomholford
f2ba969d5b
Dismiss update notification when viewing releases notes (#7297)
After updating zed, a notification is shown in the bottom right with the
new version number, a link to the release notes, and an 'x' to dismiss
the dialog.

Before this PR, clicking the link to the release notes would not dismiss
the modal. So, a user returning to the IDE after viewing the notes in
the browser would still see the notification. With this change, clicking
'View release notes' also dismisses the notification.

Co-authored-by: tomholford <tomholford@users.noreply.github.com>

Release Notes:

- Made update notification to dismiss when viewing releases notes
2024-02-02 22:52:28 +02:00
Kirill Bulatov
2d58226a9b
Avoid logging errors about missing themes dir (#7290) 2024-02-02 20:47:45 +02:00
Marshall Bowers
115f0672fb
gpui: Add support for observing window appearance (#7294)
This PR adds support to GPUI for observing when the appearance of a
window changes.

Based on the initial work done in
https://github.com/zed-industries/zed/pull/6881.

Release Notes:

- N/A
2024-02-02 13:13:35 -05:00
Conrad Irwin
1f6bd6760f
Fix main (#7293)
Release Notes:

- N/A
2024-02-02 12:21:45 -05:00
Antonio Scandurra
a0b52cc69a
Scope line layout cache to each window (#7235)
This improves a performance problem we were observing when having
multiple windows updating at the same time, where each window would
invalidate the other window's layout cache.

Release Notes:

- Improved performance when having multiple Zed windows open.

Co-authored-by: Max Brunsfeld <max@zed.dev>
2024-02-02 09:11:20 -08:00
Marshall Bowers
5360c0ea28
theme_importer: Make VS Code theme parsing more lenient (#7292)
This PR updates the `theme_importer` to use `serde_json_lenient` to
parse VS Code themes.

This should allow us to parse themes that have trailing commas and such,
in addition to the comment support that we already had.

Release Notes:

- N/A
2024-02-02 12:09:05 -05:00
James Roberts
3995c22414
Use async-native-tls for websockets (#7254)
This change switches from using async_tungstenite::async_tls to
async_tungstenite::async_std with the async-native-tls feature.

The previous feature, async_tls, used async-tls which wraps rustls.
rustls bundles webpki-roots, which is a copy of Mozilla's root
certificates. These certificates are used by default, and manual
configuration is required to support custom certificates, such as those
required by web security gateways in enterprise environments.

Instead of introducing a new configuration option to Zed,
async-native-tls integrates with the platform-native certificate store
to support enterprise environments out-of-the-box. For MacOS, this adds
support for Security.framework TLS. This integration is provided through
openssl-sys, which is also the SSL certificate provider for isahc, the
library underlying Zed's HTTP client. Making websockets and HTTP
communications use the same SSL provider should keep Zed consistent
operations and make the project easier to maintain.



Release Notes:

- Fixed WebSocket communications using custom TLS certificates
([#4759](https://github.com/zed-industries/zed/issues/4759)).
2024-02-02 09:08:15 -08:00
Antonio Scandurra
659423a4a1
Use Mutex instead of a RefCell to acquire/release instance buffers (#7291)
This fixes a panic happening when releasing an instance buffer.
Releasing the buffer happens on a different thread but the borrow
checker was not catching it because the metal buffer completion handler
API doesn't have a `Send` marker on it.

Release Notes:

- N/A
2024-02-02 09:53:07 -07:00
Conrad Irwin
074acacdf7
Do more on channel join (#7268)
This change makes it so that if you are the first to join a channel,
your project is automatically shared.

It also makes it so that if you join a channel via a link and there are
no shared projects, you open the notes instead of an empty workspace
with nothing.

This is to try and address the discoverability of project sharing: we've
had
two reviews that have talked about channels, but not talked about
sharing
projects into them, which makes me suspect they didn't know about the
feature.

Release Notes:

- Added a setting `share_on_join` (defaulting to true). When set, and
you join an empty channel, your project is automatically shared.
2024-02-02 09:52:30 -07:00
Marshall Bowers
6f6cb53fad
Tweak pull request template to (hopefully) make it clearer (#7287)
I keep seeing people leave the wrapping parentheses, like `(Added)` in
their release notes.

This PR tries making it clearer that we only want *one* of "Added",
"Fixed", or "Improved".

Release Notes:

- N/A
2024-02-02 11:41:47 -05:00
Thorsten Ball
3d76ed96f5
Use command_buffer.wait_until_scheduled in metal renderer (#7283)
This commit goes back to using `wait_until_scheduled` as opposed to
`wait_until_completed`. What this means, however, is that another draw
could take place before the previous one finished. When that happens we
don't want to reuse the same instance buffer because the GPU is actively
reading from it, so we use a pool instead.

Release Notes:

- Fixed a bug that caused inconsistent frame rate when scrolling on
certain hardware.

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Antonio <antonio@zed.dev>
2024-02-02 09:09:58 -07:00
Bennet Bo Fenner
cf4f3ed79a
Fix padding for notes label (#7280)
Fixes the padding of the "notes" button in collab-ui. I'm not sure why
the previous code used `div().h_7().w_full()`. Am I missing something
here?

### Before
![Screenshot 2024-02-02 at 15 26
44](https://github.com/zed-industries/zed/assets/53836821/0577b706-b433-4e02-802b-b6eccefb3acd)

### After
![Screenshot 2024-02-02 at 15 27
26](https://github.com/zed-industries/zed/assets/53836821/00fd81d8-82a1-4936-829c-022554259fd5)



Release Notes:
- Fixed padding of the "notes" button in the collaboration panel.

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-02-02 11:04:43 -05:00
Kirill Bulatov
bacb2a266a
Add more data into LSP header parsing error contexts (#7282)
Follow-up of https://github.com/zed-industries/zed/pull/6929 

Release Notes:

- N/A
2024-02-02 18:04:23 +02:00
Marshall Bowers
33e5ba6278
Revert "Add YAML file type icon (#7185)" (#7286)
This PR reverts the addition of the YAML icon, as it doesn't look good
at the moment:

<img width="305" alt="Screenshot 2024-02-02 at 10 55 16 AM"
src="https://github.com/zed-industries/zed/assets/1486634/2fe2ddd5-5b73-4c52-a121-562d07352005">

This reverts commit a853a80634.

Release Notes:

- N/A
2024-02-02 11:02:10 -05:00
Thorsten Ball
11bd28870a
editor: Add MoveUpByLines and MoveDownByLines actions (#7208)
This adds four new actions:

- `editor::MoveUpByLines`
- `editor::MoveDownByLines`
- `editor::SelectUpByLines`
- `editor::SelectDownByLines`

They all take a count by which to move the cursor up and down.
(Requested by Adam here:
https://twitter.com/adamwathan/status/1753017094248018302)


Example `keymap.json` entries:

```json
{
  "context": "Editor",
  "bindings": [
    "alt-up":         [ "editor::MoveUpByLines",     { "lines": 3 } ],
    "alt-down":       [ "editor::MoveDownByLines",   { "lines": 3 } ],
    "alt-shift-up":   [ "editor::SelectUpByLines",   { "lines": 3 } ],
    "alt-shift-down": [ "editor::SelectDownByLines", { "lines": 3 } ]
  ]
}
```

They are *not* bound by default, so as to not conflict with the
`alt-up/down` bindings that already exist.

Release Notes:

- Added four new actions: `editor::MoveUpByLines`,
`editor::MoveDownByLines`, `editor::SelectUpByLines`,
`editor::SelectDownByLines` that can take a line count configuration and
move the cursor up by the count.

### Demo



https://github.com/zed-industries/zed/assets/1185253/e78d4077-5bd5-4d72-a806-67695698af5d




https://github.com/zed-industries/zed/assets/1185253/0b086ec9-eb90-40a2-9009-844a215e6378
2024-02-02 08:48:04 -07:00
Thorsten Ball
01ddf840f5
completions: do not render empty multi-line documentation (#7279)
I ran into this a lot with Go code: the documentation would be empty so
we'd display a big box with nothing in it.

I think it's better if we only display the box if we have documentation.

Release Notes:

- Fixed documentation box in showing up when using auto-complete even if
documentation was empty.

## Before

![screenshot-2024-02-02-14 00
18@2x](https://github.com/zed-industries/zed/assets/1185253/e4915d51-a573-41f4-aa5d-21de6d1b0ff1)

## After

![screenshot-2024-02-02-14 01
58@2x](https://github.com/zed-industries/zed/assets/1185253/74b244af-3fc7-45e9-8cb3-7264e34b7ab7)
2024-02-02 16:42:43 +01:00
Thorsten Ball
ec9f44727e
Fix Go tests failing on main (#7285)
Follow-up to #7276 in which I broke tests.

Release Notes:

- N/A
2024-02-02 16:35:58 +01:00