Commit Graph

14054 Commits

Author SHA1 Message Date
Marshall Bowers
7ac055627e
Reorganize extensions_ui.rs (#7779)
This PR reorganizes `extensions_ui.rs` by moving the `Render` impl down
below the primary `ExtensionsPage` impl.

Release Notes:

- N/A
2024-02-14 11:44:51 -05:00
Marshall Bowers
db0455beb0
Give explicit heights to items in the extension list (#7777)
This PR gives the items in the extension list an explicit height so that
they work properly within the uniform list when descriptions are
missing.

<img width="1235" alt="Screenshot 2024-02-14 at 10 19 14 AM"
src="https://github.com/zed-industries/zed/assets/1486634/01222902-6b05-4e9a-bb5a-bada14b1fd45">

I think we may want to consider using a `list` here instead of a
`uniform_list` to allow them to have variable heights.

Fixes #7756.

Release Notes:

- N/A
2024-02-14 10:43:11 -05:00
Thorsten Ball
017b2db630
Fix case-only renaming of files (#7768)
This fixes #5211 and #7732 by fixing the case-only file renaming.

The fix here works by checking hooking into function that produces the
data to populate the project panel.

It checks whether we're on a case-insensitive file system (default on
macOS, but you can have case-sensitive FS on macOS too) and if so, it
ignores the metadata for files for which the absolute path (returned by
the FS scanner) and canonicalized path do NOT match.

That's the case for (a) symlinks and (b) case-only renames of files.

It only does this check for case-only renames.

Release Notes:

- Fixed case-only renaming of files producing duplicate entries in
project panel.
([#5211](https://github.com/zed-industries/zed/issues/5211)).

Co-authored-by: Antonio <antonio@zed.dev>
2024-02-14 16:00:31 +01:00
Piotr Osiewicz
75eac4783b
gpui: patch pathfinder_simd to fix nightly build, bump ahash for the … (#7770)
…same reason

Fixes #7644 

Release Notes:

- N/A
2024-02-14 12:55:31 +01:00
Conrad Irwin
7956a9a547
Don't wait to dispatch commands (#7755)
I added this when porting vim mode to gpui2 to work around life-cycle
problems.
Since #7647, this is no longer needed for vim mode, and causes other
problems (c.f. #7748)

Release Notes:

- Improved command to drop fewer keystrokes
2024-02-13 21:45:46 -07:00
Max Brunsfeld
c357e37dde
Reload extensions more robustly when manually modifying installed extensions directory (#7749)
Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-13 16:15:19 -08:00
Marshall Bowers
c3176392c6
Remove themes from the registry when the extension is uninstalled (#7745)
This PR makes it so uninstalling an extension will remove any themes
provided by that extension from the theme registry.

Release Notes:

- N/A
2024-02-13 16:41:34 -05:00
Conrad Irwin
e9b95fde68
Force upgrade people on nightly (#7744)
Release Notes:

- N/A
2024-02-13 13:34:49 -07:00
Max Brunsfeld
e73e93f333
Unload languages when uninstalling their extension (#7743)
Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-13 15:25:54 -05:00
Conrad Irwin
a2144faf9c
Remove environment guards (#7741)
Release Notes:

- N/A
2024-02-13 13:20:14 -07:00
Conrad Irwin
d744aa896f v0.123.1 2024-02-13 13:13:07 -07:00
Conrad Irwin
2294d99046
revert single channel click (#7738)
- Revert "collab tweaks (#7706)"
- Revert "2112 (#7640)"
- Revert "single click channel (#7596)"
- Reserve protobufs
- Don't revert migrations

Release Notes:

- N/A

**or**

- N/A
2024-02-13 12:53:49 -07:00
Carlos Lopez
fecb5a82f1
Add an extensions installation view (#7689)
This PR adds a view for installing extensions within Zed.

My subtasks:

- [X] Page Extensions and assign in App Menu
- [X] List extensions 
- [X] Button to Install/Uninstall
- [x] Search Input to search in extensions registry API
- [x] Get Extensions from API
- [x] Action install to download extension and copy in /extensions
folder
- [x] Action uninstall to remove from /extensions folder
- [x] Filtering
- [x] Better UI Design

Open to collab!

Release Notes:

- Added an extension installation view. Open it using the `zed:
extensions` action in the command palette
([#7096](https://github.com/zed-industries/zed/issues/7096)).

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Carlos <foxkdev@gmail.com>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Max <max@zed.dev>
2024-02-13 14:09:02 -05:00
Thorsten Ball
33f713a8ab
Optimize construction and insertion of large SumTrees (#7731)
This does two things:

1. It optimizes the constructions of `SumTree`s to not insert nodes
one-by-one, but instead inserts them level-by-level. That makes it more
efficient to construct large `SumTree`s.
2. It adds a `from_par_iter` constructor that parallelizes the
construction of `SumTree`s.

In combination, **loading a 500MB plain text file went from from
~18seconds down to ~2seconds**.

Disclaimer: I didn't write any of this code, lol! It's all @as-cii and
@nathansobo.

Release Notes:

- Improved performance when opening very large files.

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Julia <julia@zed.dev>
2024-02-13 16:24:40 +01:00
Thorsten Ball
798c9a7d8b
Improve sorting of completion results (#7727)
This is an attempt to fix #5013 by doing two things:

1. Rank "obvious" matches in completions higher (see the code comment)
2. When tied: rank keywords higher than variables

Release Notes:

- Improved sorting of completion results to prefer literal matches.
([#5013](https://github.com/zed-industries/zed/issues/5013)).

### Before

![screenshot-2024-02-13-13 08
13@2x](https://github.com/zed-industries/zed/assets/1185253/77decb0b-5b47-45de-ab69-f7b333072b45)
![screenshot-2024-02-13-13 10
42@2x](https://github.com/zed-industries/zed/assets/1185253/ae33d0fe-06f5-4fc1-84f8-ddf6dbe80ba5)


### After

![screenshot-2024-02-13-13 06
22@2x](https://github.com/zed-industries/zed/assets/1185253/3c526bab-6392-4eeb-a2f2-dd73ccf228e8)
![screenshot-2024-02-13-13 06
50@2x](https://github.com/zed-industries/zed/assets/1185253/b5b9d513-766d-4a53-94de-b46271f5978c)

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: bennetbo <bennetbo@gmx.de>
2024-02-13 14:08:03 +01:00
Andrew Lygin
98fff014da
Fix minor buffer search bar design issues (#7715)
This PR fixes the buffer search bar design issues mentioned in #7703.

It doesn't affect the project search bar.

Changes:

<img width="943" alt="zed-search-bar-design-issues"
src="https://github.com/zed-industries/zed/assets/2101250/af3bd0da-36cb-46ee-9af6-6b69911863d0">

Release Notes:

- N/A
2024-02-13 09:45:24 +01:00
Conrad Irwin
a1899bac4e
vim: Fix renaming (#7714)
This was broken by #7647

Release Notes:

- N/A
2024-02-12 22:28:26 -07:00
Derrick Laird
04fc0dde1a
languages: go.mod/go.work fix highlighting no longer working (#7705)
At some point go.mod and go.work syntax highlighting quit working. Looks
like the grammars weren't matching for some reason and I'm not sure how
they were working originally.

Not sure if we could write a test to make sure the tree-sitter queries
are being loaded for the grammars or not but seems like something that
could be useful to avoid something like this in the future.
2024-02-12 21:01:08 -07:00
Conrad Irwin
b800fe96d2
Fix dealloc of MacWindow (#7708)
We see some panics in the Drop handler for MacWindow

Looking into this, I noticed that our drop implementation was not
correctly
cleaning up the window state.

Release Notes:

- N/A
2024-02-12 20:01:09 -07:00
Conrad Irwin
21d2b5fe50
collab tweaks (#7706)
- Don't leave call when clicking on channel
- Don't prompt to leave a call you're not in

Release Notes:

- N/A
2024-02-12 16:08:35 -07:00
Conrad Irwin
d13a731cd6
Crash sooner on invalid background highlights (#7702)
Release Notes:

- N/A
2024-02-12 14:44:10 -07:00
Max Brunsfeld
ede9600ab4
Improve panic message for invalid anchors (#7700)
Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-12 12:58:30 -08:00
Greg Morenz
48a4cbad37 Don't move traffic lights while fullscreen
Fixes #4712, or at least works around it. As discussed in the issue,
setting the buttons frames while fullscreen can cause them to render
in the wrong location. This fixes that by simply not moving them when
fullscreen.
2024-02-12 14:17:10 -05:00
Roman
266988adea
gpui: Decouple X11 logic from LinuxPlatform (#7598)
Release Notes:

- Separated Linux platform and X11-specific code, so that we can add
Wayland support now.

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-02-12 10:44:34 -08:00
Alvaro Gaona
2e7db57e16
Add Astro Support (#6896)
Attempt to add `@astrojs/language-server` and
[virchau13/tree-sitter-astro](https://github.com/virchau13/tree-sitter-astro).

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
2024-02-12 10:10:40 -08:00
Andrew Lygin
1c2081c10c
Search bar UI enhancements (#7675)
This PR introduces several enhancements (along with fixing a couple of
bugs) in the search bar UI (copied from [this
comment](https://github.com/zed-industries/zed/issues/7663#issuecomment-1937659091)):

- Moving the Replace field under the Search field makes it easier to
compare texts and avoid typos. Also, less eyes movements.
- Use red (error) color to indicate that nothing matched. VSCode, IDEA
do this. Again, it helps to get a quicker feedback on typos without
moving your eyes.
- Much less moving parts and no place for flickering.
- Better fits to narrow panes.
- The Close button that allows to close the search bar with the mouse.
- Better keyboard handling (tab, shift+tab in the replacement mode),
autofocus on the Replace field.

How it looks:


https://github.com/zed-industries/zed/assets/2101250/93b0edb4-4311-4a7f-9f43-b30c4d1aede5

Implementation details:

- Using `Self::on_query_editor_event` looked suspicious
[here](2880135037/crates/search/src/buffer_search.rs (L491))
because it triggered searching on the replacement text changes. I've
created a separate method for the replacement editor.
- These changes don't affect the project search bar. If the PR is
accepted, the same changes may be implemented there.

Fixed issues:

- #7661
- #7663

Release Notes:

- Buffer search bar UI enhancements.
2024-02-12 10:01:57 -08:00
Robin Pfäffle
a23313928b
Add JSX and TSX syntax highlighting (#7686)
This PR fixes / adds support for syntax highlighting in JSX and TSX.

Previously to this PR the syntax highlighting was not really working.
HTML tags have not been displayed as such.

<img width="1127" alt="SCR-20240212-ihne"
src="https://github.com/zed-industries/zed/assets/67913738/793c778f-aa11-4574-883f-6d336247bd9e">

After:

<img width="1225" alt="SCR-20240212-jqvv"
src="https://github.com/zed-industries/zed/assets/67913738/f4d96b1d-6063-41ac-bd46-76ce1fc0a131">

Release Notes:

- Added support for JSX and TSX syntax highlighting
2024-02-12 09:59:19 -08:00
Yesterday17
9e17018416
Allow OpenAI API URL to be configured via assistant.openai_api_url (#7552)
Partially fixes #4321, since Azure OpenAI API can be converted to OpenAI
API.

Release Notes:

- Added `assistant.openai_api_url` setting to allow OpenAI API URL to be
configured.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-02-12 11:37:27 -05:00
Julia
d959719f3e Use local player selection color, not cursor, for terminal selection 2024-02-12 10:52:44 -05:00
白山風露
2880135037
Use try_from_bytes in handle_file_urls (#7652)
Reduce build error on Windows.

Release Notes:

- N/A
2024-02-10 23:05:52 -07:00
Dzmitry Malyshau
664a195721
linux: switch to srgb color space output (#7666)
This matches the behavior of the existing Metal backend.

Picks up https://github.com/kvark/blade/pull/76

Release Notes:
- N/A
2024-02-10 20:19:00 -08:00
Conrad Irwin
bd882c66d6
vim lifecycle (#7647)
Release Notes:

- Fixed :0 and :% in vim mode
([#4303](https://github.com/zed-industries/zed/issues/4303)).
- Improved keymap loading to not load vim key bindings unless vim is
enabled

**or**

- N/A
2024-02-10 16:21:13 -07:00
Paulo Roberto de Oliveira Castro
a159183f52
Add Clojure language support with tree-sitter and LSP (#6988)
Current limitations:
* Not able to navigate into JAR files 

Release Notes:

- Added Clojure language support

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-02-10 13:28:48 -08:00
N8th8n8el
b4b59f8706
terminal: Fix non regex search to actually be non regex (#7330)
Alacritty seems to support only regex search out of the box.
This PR just escapes all special regex chars to make non regex search
work as expected.
Disclaimer: New to Rust.

Release Notes:

-Fixed text search not working correctly in terminal ([#4880](https://github.com/zed-industries/zed/issues/4880))
2024-02-10 21:34:41 +02:00
N8th8n8el
4f5fea5dba
terminal: Fix supported search options (regex: true) (#7659)
Release Notes:

- Fixes [#7327](https://github.com/zed-industries/zed/issues/7327).
2024-02-10 21:29:06 +02:00
Matthew Gramigna
67839a967b
Add Prisma language support (#7267)
Fixes #4832

Adds tree-sitter grammar and LSP adapter for Prisma



https://github.com/zed-industries/zed/assets/16297930/0f288ab1-ce5c-4e31-ad7f-6bb9655863c1
2024-02-10 10:26:39 -08:00
Conrad Irwin
68893c2ae6
Fix notes unread status (#7643)
1. The client-side comparison was wrong
2. The server never told the client about the version it remembered
3. The server generated broken timestamps in some cases

Release Notes:

- Fixed the notes/chat appearing as unread too often

**or**

- N/A
2024-02-09 23:12:26 -07:00
Colin Cai
e2a3e89318
Stop unnecessary repeat cursor movements in Vim mode (#7641)
Fixes: #7605

When repeating some cursor movements in Vim mode (e.g. `99999999 w`),
Zed tries to repeat the movement that many times, even if further
actions don't have any effect. This causes Zed to hang.

This commit makes those movements like other actions (like moving the
cursor left/right), stopping the repeat movement if a boundary of the
text is reached/the cursor can't move anymore.

Release Notes:

- Fixed [#7605](https://github.com/zed-industries/zed/issues/7605).
2024-02-09 22:50:38 -07:00
Conrad Irwin
0304edd8ab
2112 (#7640)
It's still slow, but should now work reliably

Release Notes:

- N/A
2024-02-09 18:33:28 -07:00
Max Brunsfeld
36b89571e9
Add binary for exporting JSON schemas for validating extensions (#7639)
Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-09 18:50:41 -05:00
Conrad Irwin
3635d2dced
Highlight selections on vim yank (#7638)
Fixes: #7311

Co-Authored-By: WindSoilder <WindSoilder@outlook.com>

Release Notes:

- Added a highlight on yanked text in vim normal mode

**or**

- N/A

Co-authored-by: WindSoilder <WindSoilder@outlook.com>
2024-02-09 16:18:09 -07:00
Conrad Irwin
efe23ebfcd
single click channel (#7596)
- Open channel notes and chat on channel click
- WIP
- Fix compile error
- Don't join live kit until requested
- Track in_call state separately from in_room



Release Notes:

- Improved channels: you can now be in a channel without joining the
audio call automatically

**or**

- N/A

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2024-02-09 14:18:27 -07:00
Matt Bond
2b39a9512a
Canonicalize settings to avoid overwriting symlinks (#7632)
Release Notes:

- Fixed theme selector overwriting settings file symlinks
([#4469](https://github.com/zed-industries/zed/issues/4469)).
2024-02-09 22:31:14 +02:00
Dzmitry Malyshau
2b383b854a
linux: fix getting the initial content size (#7604)
Fix found by @h3mosphere (thanks!)

Solves the Vulkan validation on start on some platforms about the
mismatched surface size, e.g.
```
VUID-VkSwapchainCreateInfoKHR-imageExtent-01274(ERROR / SPEC): msgNum: 2094043421 - Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 ] Object 0: handle = 0x55dff99554c0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x7cd0911d | vkCreateSwapchainKHR() called with imageExtent = (1920,1080), which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): currentExtent = (1920,1016), minImageExtent = (1920,1016), maxImageExtent = (1920,1016). The Vulkan spec states: imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageExtent-01274)
```

Release Notes:
- N/A

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-09 10:34:00 -08:00
Christian Bergschneider
862a9512b5
gpui: Activate window on Linux (#7617)
Release Notes:
- N/A

Hello everyone,
it's me again! This is another todo!(linux) thing in gpui.

Best Regards,
Christian Bergschneider
2024-02-09 10:15:00 -08:00
Kirill Bulatov
5175c8963a
Actually fail on clippy failures (#7619)
Before the change to `script/clippy`, bash ignored first `clippy`
invocation failure and CI moved on with Linux errors and warnings
emitted.


Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-09 10:13:00 -08:00
Federico Dionisi
2651037472
Read LSP message headers at once (#7449)
The current LSP headers reader implementation assumes a specific order
(i.e., `Content-Length` first, and then `Content-Type`). Unfortunately,
this assumption is not always valid, as no specification enforces the
rule. @caius and I encountered this issue while implementing the
Terraform LSP, where `Content-Type` comes first, breaking the
implementation in #6929.

This PR introduces a `read_headers` function, which asynchronously reads
the incoming pipe until the headers' delimiter (i.e., '\r\n\r\n'),
adding it to the message buffer, and returning an error when delimiter's
not found.

I added a few tests but only considered scenarios where headers are
delivered at once (which should be the case?). I'm unsure if this
suffices or if I should consider more scenarios; I would love to hear
others' opinions.


Release Notes:

- N/A

---------

Co-authored-by: Caius <caius@caius.name>
2024-02-09 09:40:50 -08:00
Antonio Scandurra
93ceb89c0c
Never show whitespace-only Copilot suggestions (#7623)
Fixes https://github.com/zed-industries/zed/issues/7582

Release Notes:

- Fixed a bug that caused Copilot to suggest leading indentation even
after the user accepted/discarded a suggestion
([#7582](https://github.com/zed-industries/zed/issues/7582))

Co-authored-by: Thorsten Ball <thorsten@zed.dev>
Co-authored-by: Bennet <bennetbo@gmx.de>
2024-02-09 18:05:14 +01:00
Thorsten Ball
ad97e447f5
Load worktree settings when loading options for language servers (#7615)
Previously we only looked at the global settings, this changes that to
start looking in local settings first and then fall back to global ones.

Fixes #4279.

Release Notes:

- Fixed language server configurations not being picked up from local,
worktree-specific settings.
([#4279](https://github.com/zed-industries/zed/issues/4279)).

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Bennet <bennetbo@gmx.de>
2024-02-09 16:06:29 +01:00
Kirill Bulatov
f3bfa11148
Show better errors when failing to start golps (#7614)
Part of
https://github.com/zed-industries/zed/issues/4471#issuecomment-1936008584

Improves gopls error logging to actually see what is wrong with the
output we failed to match against the version regex.

Release Notes:

- N/A
2024-02-09 16:44:13 +02:00
Thorsten Ball
775bce3e1a
Handle autoclose when composing text (#7611)
This fixes two annoyances when composing text and autoclose is enabled.

Example: use a Brazilian keyboard and type `"`, which triggers a
dead-key state.

Previously when a user would type `"<space>` to get a quote, we'd end up
with 4 quotes.

When text was selected and a user then typed `"<space>` the selected
text would be deleted.

This commit fixes both of these issues.

Fixes https://github.com/zed-industries/zed/issues/4298

Release Notes:

- Fixed autoclose behavior not working when composing text via IME (e.g.
using quotes on a Brazilian keyboard)
([#4298](https://github.com/zed-industries/zed/issues/4298)).

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: bennetbo <bennetbo@gmx.de>
2024-02-09 15:36:39 +01:00
Robert Clover
901279a044
Implement terminal text dimming (#7600)
Dims text by a certain factor - this respects theme opacity. The amount
is documented in the code. As far as I can tell, all other terminals
also dim text using this same method. Dim only affects the foreground.

<img width="755" alt="SCR-20240209-mfls"
src="https://github.com/zed-industries/zed/assets/52195359/c32f2aff-1142-4333-a05d-6aca425cb235">

Release Notes:

- Added terminal text dimming (fixes #7497)
2024-02-09 13:42:30 +01:00
Antonio Scandurra
0cebf68306
Introduce a new ToggleGraphicsProfiler command (#7607)
On macOS, this will enable or disable the Metal HUD at runtime. Note
that this only works when Zed is bundled because it requires to set the
`MetalHudEnabled` key in the Info.plist.

Release Notes:

- Added a new `ToggleGraphicsProfiler` command that can be used as an
action (or via the `Help -> Toggle Graphics Profiler` menu) to
investigate graphics performance.
2024-02-09 13:29:40 +01:00
Thorsten Ball
04e1641a29
Properly handle backspace when in dead key state (#7494)
Previously we wouldn't handle Backspace in dead key state correctly:
instead of removing what was typed, we'd insert the text that was in the
dead key state.

Example: on a US English layout, press `opt-u` to end up in a dead key
state with `¨` waiting for the next character to be typed. Type
`backspace`. The `¨` should be removed, but it's not.

With this change, the `backspace` is interpreted instead of being
ignored.

Release Notes:

- Fixed backspace not working for dead keys (i.e. when typing accents or
umlauts)

---------

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Conrad <conrad@zed.dev>
2024-02-09 12:22:12 +01:00
Piotr Osiewicz
f4d7b3e3b1
chore: Bump Rust version to 1.76 (#7592)
Release Notes:

- N/A
2024-02-09 10:45:39 +02:00
h3mosphere
67d280b8cb
Linux: Experiment with CosmicText based Text System (#7539)
This is a rebase of @gabydds text_system updates. with some small
cleanups.

Currently cannot test this as build is not working in linux. Im just
putting it up here before I forget about it.

---------

Co-authored-by: gabydd <gabydinnerdavid@gmail.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-08 22:49:03 -08:00
Dzmitry Malyshau
0ab1094f0c
linux: quit after the last window is closed (#7602)
Release Notes:
- N/A
2024-02-08 21:41:15 -08:00
Christian Bergschneider
07891b4978
gpui: Set window title on Linux (#7589)
Release Notes:
- N/A


Hello everyone,
glad to be contributing to this awesome project! This just fixes a
simple todo!(linux) in gpui.

I also considered setting the window title in the hello world example,
let me know if I should add it in this PR as well.

Best Regards,
Christian Bergschneider
2024-02-08 14:31:14 -08:00
Max Brunsfeld
ed54665711
Cleanup logic for registering languages and grammars (#7593)
This is a refactor, follow-up to the work we've been doing on loading
WASM language extensions.

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-08 16:24:49 -05:00
Mikayla Maki
ad88e9754e
Add Linux build CI (#7581)
Release Notes:

- N/A
2024-02-08 12:56:29 -08:00
Jason Lee
e7fcddff69
Parse version from GitHub tag name instead of release name (#7423)
If we not change this, some release will parse error.

https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28

```json
{
  "name": {
    "type": [
      "string",
      "null"
    ]
  }
}
```

<img width="1188" alt="image"
src="https://github.com/zed-industries/zed/assets/5518/bd53dbc4-ae2c-4f19-afd7-58e70b4f87d8">

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-02-08 15:28:51 -05:00
Marshall Bowers
bde509fa74
Expose Python docstrings for syntax highlighting (#7587)
This PR extends our Tree-sitter highlights for Python to allow
highlighting docstrings differently from other strings.

Docstrings in Python will now use `string.doc` instead of just `string`,
which will allow for them to be styled independently of other strings.
If no `string.doc` is present in the theme, then it will fall back to
using the `string` styles.

<img width="272" alt="Screenshot 2024-02-08 at 1 52 21 PM"
src="https://github.com/zed-industries/zed/assets/1486634/034cffa0-91c0-4924-8ccc-3a385cf31126">

This is slightly different than the approach I took in #7585 in that we
are still treating docstrings as strings by default (which appears to be
the more common behavior), but allowing theme authors to hook in and
style them separately, if desired.

Release Notes:

- Added ability add custom styles for Python docstrings using
`string.doc`
([#7346](https://github.com/zed-industries/zed/issues/7346)).
2024-02-08 14:20:21 -05:00
Antonio Scandurra
67b96b2b40
Replace CADisplayLink with CVDisplayLink (#7583)
Release Notes:

- Fixed a bug that caused Zed to render at 60fps even on ProMotion
displays.
- Fixed a bug that could saturate the main thread event loop in certain
circumstances.

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Max <max@zed.dev>
2024-02-08 13:47:12 -05:00
Daniel Banck
9e538e7916
Support Terraform Variable Definitions as separate language (#7524)
With https://github.com/zed-industries/zed/pull/6882 basic syntax
highlighting support for Terraform has arrived in Zed. To fully support
all features of the language server (when it lands), it's necessary to
handle `*.tfvars` slightly differently.

TL;DR: [terraform-ls](https://github.com/hashicorp/terraform-ls) expects
`terraform` as language id for `*.tf` files and `terraform-vars` as
language id for `*.tfvars` files because the allowed configuration
inside the files is different. Duplicating the Terraform language
configuration was the only way I could see to achieve this.

---

In the
[LSP](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentItem),
text documents have a language identifier to identify a document on the
server side to avoid reinterpreting the file extension.

The Terraform language server currently uses two different language
identifiers:
* `terraform` - for `*.tf` files
* `terraform-vars` - for `*.tfvars` files

Both file types contain HCL and can be highlighted using the same
grammar and tree-sitter configuration files. The difference in the file
content is that `*.tfvars` files only allow top-level attributes and no
blocks. [_So you could argue that `*.tfvars` can use a stripped down
version of the grammar_]. To set the right context (which affects
completion, hover, validation...) for each file, we need to send a
different language id.

The only way I could see to achieve this with the current architecture
was to copy the Terraform language configuration with a different `name`
and different `path_suffixes`. Everything else is the same.

A Terraform LSP adapter implementation would then map the language
configurations to their specific language ids:

```rust
fn language_ids(&self) -> HashMap<String, String> {
    HashMap::from_iter([
        ("Terraform".into(), "terraform".into()),
        ("Terraform Vars".into(), "terraform-vars".into()),
    ])
}
```

I think it might be helpful in the future to have another way to map
file extensions to specific language ids without having to create a new
language configuration.

### UX Before

![CleanShot 2024-02-07 at 23 00
56@2x](https://github.com/zed-industries/zed/assets/45985/2c40f477-99a2-4dc1-86de-221acccfcedb)

### UX After

![CleanShot 2024-02-07 at 22 58
40@2x](https://github.com/zed-industries/zed/assets/45985/704c9cca-ae14-413a-be1f-d2439ae1ae22)

Release Notes:

- N/A

---

* Part of https://github.com/zed-industries/zed/issues/5098
2024-02-08 13:12:12 -05:00
Mikayla Maki
d4be15b2b2
Suppress related warnings, fix nanoid, and get the build green (#7579)
This is in preparation for adding a Linux build step to our CI.

Release Notes:

- N/A
2024-02-08 09:32:53 -08:00
Robert Clover
8f7d7863d6
Fix text in terminal showing as bold when dimmed (#7491)
Fixes text in the terminal displaying as bold when it's actually just
dim. I think it was just a simple oversight because the original code
`|`'s together the BOLD and DIM_BOLD flags, which is the same as
DIM_BOLD, which is wrong because it should only be BOLD :p

Release Notes:

- Fixed #4464

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-08 09:12:45 -08:00
Marshall Bowers
b77d452b90
Remove unneeded maybe! (#7576)
This PR removes an unneeded `maybe!` from `get_permalink_to_line`.

As this is a `Result`-returning function, we don't need the inner level
of wrapping.

Release Notes:

- N/A
2024-02-08 11:52:18 -05:00
Daniel Schmidt
b25044393e
Add open permalink to line action (#7562)
Release Notes:

- Added `open permalink to line` action.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-02-08 11:40:38 -05:00
gmorenz
17c203fef9
Translate notify::Event to fsevent::Event on linux (#7545)
This isn't exactly a great solution, but it's a step in the right
direction, and it's simple allowing us to quickly unblock linux. Without
this (or an equivalent) PR linux builds are broken.

I spent a bunch of time investigating using notify on macos, and have a
branch with that working and FakeFs updated to use notify events.
unfortunately I think this would come with some drawbacks. Primarily
that files that don't yet exist yet aren't handled as well as with using
events directly leading to some less than ideal tradeoffs.

This PR is very much a placeholder for a better cross platform solution.
Most problematically, it only fills in the portion of fsevent::Event
that is currently used, despite there being a lot more information in
the ones collected from macos. At the very least a followup PR should
hide those implementation details behind a cross platform Event type so
that if people try and access data that hasn't been translated, they
find out about it.

Release Notes:

- N/A
2024-02-08 08:35:37 -08:00
h3mosphere
006e7a77d5
Linux: Fix some crashes from new functions having unimplemented!() (#7567)
Release Notes:

- N/A
2024-02-08 10:53:39 -05:00
h3mosphere
4048dbfafd
Linux: Disable PureScript grammar to avoid linking error (#7543)
Release Notes:

- N/A
2024-02-08 10:40:26 -05:00
Marshall Bowers
9f4ce7fba5
Remove unneeded type annotations where inference will do (#7573)
This PR removes some unneeded type annotations where we're able to infer
the type accurately.

Release Notes:

- N/A
2024-02-08 10:32:08 -05:00
dalton-oliveira
a0b2614d57
Add unique lines command (#7526)
Changes `Editor::manipulate_lines` to allow line adding and removal
through callback function.

- Added `editor::UniqueLinesCaseSensitive` and `editor::UniqueLinesCaseInsensitive` commands
([#4831](https://github.com/zed-industries/zed/issues/4831))
2024-02-08 17:13:15 +02:00
Kirill Bulatov
89b1e76003
Fix gopls langserver downloads (#7571)
Fixes https://github.com/zed-industries/zed/issues/7534 by not requiring
assets for gopls and vscode-eslint langservers — those two are the only
ones in Zed that do not use assets directly when determining langserver
version and retrieving those.
All other servers deal with assets, hence require those to be present.

The problem with https://github.com/tamasfe/taplo/releases is that they
host multiple binary releases in the same release list, so for now the
code works because only the langserver has assets — but as soon as
another release there gets assets, it will break again.
We could filter out those by names also, but they also tend to change
(and can be edited manually), so keeping it as is for now.

Release Notes:

- Fixed gopls language server downloads
([7534](https://github.com/zed-industries/zed/issues/7534))
2024-02-08 16:17:47 +02:00
Kirill Bulatov
f734365b7b
Avoid another confirmation when submitting/discarding feedback (#7569)
Fixes https://github.com/zed-industries/zed/issues/7515

Release Notes:

- Fixed feedback modal spawning extra confirmations on cancel and submit
([7515](https://github.com/zed-industries/zed/issues/7515))
2024-02-08 16:13:54 +02:00
Dzmitry Malyshau
d457eef099
blade: fix path rasterization (#7546)
There were mistakes in the blending mode, primitive topology, and the
equation.

![gpui-text-selection](https://github.com/zed-industries/zed/assets/107301/13f1285e-1338-4c87-b1bb-7e426606f939)



Release Notes:
- N/A
2024-02-08 09:08:04 -05:00
Dzmitry Malyshau
00024b791b
Uprev blade to 26bc5e8 (#7556)
Picks up https://github.com/kvark/blade/pull/73 to make it possible to
start experimenting with GLES backend.

Release Notes:
- N/A
2024-02-08 08:41:55 -05:00
Kieran Gill
61b8d3639f
markdown_preview: Improved markdown rendering support (#7345)
This PR improves support for rendering markdown documents.

## After the updates


https://github.com/zed-industries/zed/assets/18583882/48315901-563d-44c6-8265-8390e8eed942

## Before the updates


https://github.com/zed-industries/zed/assets/18583882/6d7ddb55-41f7-492e-af12-6ab54559f612

## New features

- @SomeoneToIgnore's [scrolling feature
request](https://github.com/zed-industries/zed/pull/6958#pullrequestreview-1850458632).
- Checkboxes (`- [ ]` and `- [x]`)
- Inline code blocks.
- Ordered and unordered lists at an arbitrary depth.
- Block quotes that render nested content, like code blocks.
- Lists that render nested content, like code blocks.
- Block quotes that support variable heading sizes and the other
markdown features added
[here](https://github.com/zed-industries/zed/pull/6958).
- Users can see and click internal links (`[See the docs](./docs.md)`).

## Notable changes

- Removed dependency on `rich_text`.
- Added a new method for parsing markdown into renderable structs. This
method uses recursive descent so it can easily support more complex
markdown documents.
- Parsing does not happen for every call to
`MarkdownPreviewView::render` anymore.

## TODO

- [ ] Typing should move the markdown preview cursor.

## Future work under consideration

- If a title exists for a link, show it on hover.
- Images. 
- Since this PR brings the most support for markdown, we can consolidate
`languages/markdown` and `rich_text` to use this new renderer. Note that
the updated inline text rendering method in this PR originated from
`langauges/markdown`.
- Syntax highlighting in code blocks.
- Footnote references.
- Inline HTML.
- Strikethrough support.
- Scrolling improvements:
- Handle automatic preview scrolling when multiple cursors are used in
the editor.
- > great to see that the render now respects editor's scrolls, but can
we also support the vice-versa (as syntax tree does it in Zed) — when
scrolling the render, it would be good to scroll the editor too
- > sometimes it's hard to understand where the "caret" on the render
is, so I wonder if we could go even further with its placement and place
it inside the text, as a regular caret? Maybe even support the
selections?
- > switching to another markdown tab does not change the rendered
contents and when I call the render command again, the screen gets
another split — I would rather prefer to have Zed's syntax tree
behavior: there's always a single panel that renders things for whatever
tab is active now. At least we should not split if there's already a
split, rather adding the new rendered tab there.
- > plaintext URLs could get a highlight and the click action

## Release Notes

- Improved support for markdown rendering.
2024-02-08 11:19:31 +02:00
Robert Clover
cbe7a12e65
Add information to Copilot sign-in UI when disabled (#7496)
I'd love to take on fixing this but:

1. I don't think this is the right solution - it would be really nice to
have something actionable that I could do when presented with this
message.
2. Should signing in to Copilot be independent from whether it's
enabled? You can only access the sign-in modal when `features.copilot`
isn't disabled, but when `show_copilot_suggestions` is `false` the
server is disabled but you can't sign in. So I guess another solution
might be to just not show the UI if copilot suggestions are disabled?
3. I don't know what other circumstances could trigger the empty modal.
I see `Status::Error` and that seems like it might be important to
surface gracefully?

Would love some thoughts on this

Release Notes:

- Improved UX for enabling Copilot when it's disabled in settings
2024-02-07 22:28:02 -07:00
Marshall Bowers
ccc6d76708
Clean up util::paths (#7536)
This PR cleans up the path definitions in `util::paths` following the
Linux merge.

We were using a bunch of target-specific compilation that made these
declarations kind of messy, when really we can limit the conditional
compilation to just the base directories that we use as the basis for
the other directories.

Release Notes:

- N/A
2024-02-07 21:01:45 -05:00
Max Brunsfeld
7b03e977e4
Reload grammars in extensions when they are updated on disk (#7531)
Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
2024-02-07 16:39:11 -08:00
Marshall Bowers
f2a4dbaf7f
Fix typo in mark_language_loaded doc comment (#7533)
This PR fixes a small typo in the `mark_language_loaded` doc comment.

Release Notes:

- N/A
2024-02-07 18:50:11 -05:00
Antar
219ec91748
Fix compile errors on Linux (#7527)
Added some missing trait functions and `unimplemented` markings

Release Notes:

- N/A
2024-02-07 18:46:24 -05:00
Bennet Bo Fenner
6cdd7796c3
terminal: strikethrough text (#7507)
#7363 added support for rendering strikethrough text, so now we can
handle this case in the terminal.

Should close: #7434

Before:

![image](https://github.com/zed-industries/zed/assets/53836821/cb7a4eae-5bc9-425c-974d-07a9f089917a)

After:

![image](https://github.com/zed-industries/zed/assets/53836821/5aaacee2-95bc-4039-972d-96bd7c01ea59)

Release Notes:

- Fixed rendering strikethrough text inside the terminal #7434
2024-02-07 16:36:30 -07:00
Conrad Irwin
f55aba51ec
Fix panic! caused by bad utf16 clipping (#7530)
Release Notes:

- Fixed a panic in diagnostics with emojis

**or**

- N/A
2024-02-07 16:35:30 -07:00
Marshall Bowers
374c8a4c8c
Reload theme using ThemeSettings::reload_current_theme (#7522)
This PR updates the various spots where we reload the theme to use
`ThemeSettings::reload_current_theme` instead of duplicating the code
each time.

Release Notes:

- N/A
2024-02-07 16:56:24 -05:00
d1y
45cf36e870
theme_importer: Add --output flag for outputting the theme to a file (#7486)
```bash
cargo run -p theme_importer -- dark-plus-syntax-color-theme.json --output output.json
```

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-02-07 16:23:36 -05:00
Joseph T. Lyons
e6dad23154
chat: closing reply preview with action (#7517)
This is a follow up to #7170. Closing the reply to preview overlay is
now configurable with an action (keybinding set escape in the default
keymap).


https://github.com/zed-industries/zed/assets/53836821/d679e734-f90b-4490-8e79-7dfe5407988a


Release Notes:
- N/A
2024-02-07 16:12:33 -05:00
Marshall Bowers
2f4bb79553
Reload themes defined in extensions (#7520)
This PR extends the extension directory watcher to also watch and reload
themes defined in extensions.

Release Notes:

- N/A

Co-authored-by: Max <max@zed.dev>
2024-02-07 16:11:24 -05:00
Daniel Banck
31d9edfaaa
Fix Terraform syntax highlighting (#7518)
https://github.com/zed-industries/zed/pull/7467 introduced a new
`grammar` field in the language configuration files.
The underlying tree-sitter grammar for Terraform should be `hcl` instead
of `terraform`. This PR fixes that typo.

Release Notes:

- N/A
2024-02-07 16:06:13 -05:00
Mikayla
3a53db6502
Merge branch 'main' into kvark-linux 2024-02-07 12:30:36 -08:00
Max Brunsfeld
6edeea7c8a
Add logic for managing language and theme extensions (#7467)
This PR adds the initial support for loading extensions in Zed.

### Extensions Directory

Extensions are loaded from the extensions directory.

The extensions directory has the following structure:

```
extensions/
  installed/
    extension-a/
      grammars/
      languages/
    extension-b/
      themes/
  manifest.json
```

The `manifest.json` file is used internally by Zed to keep track of
which extensions are installed. This file should be maintained
automatically, and shouldn't require any direct interaction with it.

Extensions can provide Tree-sitter grammars, languages, and themes.

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-07 15:14:50 -05:00
Bennet Bo Fenner
ef8cab65b0 allow closing reply to preview with action
Co-Authored-By: Remco Smits <62463826+RemcoSmitsDev@users.noreply.github.com>
2024-02-07 21:14:36 +01:00
Mikayla
be455f7f28
Restore nanoid dependency 2024-02-07 12:04:29 -08:00
Mikayla
f507698c62
Fix a few out of date warnings 2024-02-07 11:59:52 -08:00
Mikayla
67555ee5b4
Merge branch 'main' into kvark-linux 2024-02-07 11:52:44 -08:00
Bennet Bo Fenner
6b598a07d9
chat: fix autocompletion for usernames with dash (#7514)
Github usernames are allowed to contain `-`, but the autocompletion was
not working correctly.
We added `-` as an allowed character for markdown files. We are not
aware of any completions for markdown files, so this should be fine to
add.


Before:

![image](https://github.com/zed-industries/zed/assets/53836821/5b456ed6-3098-48e8-90db-f5f42b4aa535)

After:

![image](https://github.com/zed-industries/zed/assets/53836821/a544f465-0b68-46f5-9a15-83b4c755c3c0)


Release Notes:

- Fixed autocompletion for usernames with dash character in the chat
message editor

Co-authored-by: Remco Smits <62463826+RemcoSmitsDev@users.noreply.github.com>
2024-02-07 12:48:33 -07:00
Mikayla
3734a390b2
Mark TODOs and prep for merging main 2024-02-07 11:39:26 -08:00
Antonio Scandurra
07fce7aae1
Stop display link when window is occluded (#7511)
Release Notes:

- Fixed a bug that caused the window to become unresponsive after
foregrounding.

---------

Co-authored-by: Conrad <conrad@zed.dev>
2024-02-07 11:45:30 -07:00
Joseph T. Lyons
114889b8bb v0.123.x dev 2024-02-07 12:19:41 -05:00
Kirill Bulatov
83cffdde1f
Use collections::{HashMap, HashSet} instead of its std:: counterpart (#7502) 2024-02-07 19:06:03 +02:00
Marshall Bowers
c322179bb9
Initialize the SystemAppearance using the app's global window appearance (#7508)
This PR changes our approach to initializing the `SystemAppearance` so
that we can do it earlier in the startup process.

Previously we were using the appearance from the window, meaning that we
couldn't initialize the value until we first opened the window.

Now we read the `window_appearance` from the `AppContext`. On macOS this
is backed by the
[`effectiveAppearance`](https://developer.apple.com/documentation/appkit/nsapplication/2967171-effectiveappearance)
on the `NSApplication`.

We currently still watch for changes to the appearance at the window
level, as the only hook I could find in the documentation is
[`viewDidChangeEffectiveAppearance`](https://developer.apple.com/documentation/appkit/nsview/2977088-viewdidchangeeffectiveappearance),
which is at the `NSView` level.

In my testing this makes it so Zed appropriately chooses the correct
light/dark theme on startup.

Release Notes:

- N/A
2024-02-07 11:51:18 -05:00
Conrad Irwin
b59e110c59
Attempt to fix random lag (#7506)
Co-Authored-By: Antonio <antonio@zed.dev>
Co-Authored-By: Thorsten <thorsten@zed.dev>
Co-Authored-By: Mikayla <mikayla@zed.dev>

Release Notes:

- N/A

**or**

- N/A

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-02-07 09:45:49 -07:00
白山風露
42a5081aff
Use try_from_bytes for windows build (#7500)
Reduce windows build error.

Release Notes:

- N/A
2024-02-07 11:27:26 -05:00
d1y
c7b022144f
theme_importer: Read theme name from VS Code theme (#7489)
apply theme_name(fallback use "")

Release Notes:

- N/A
2024-02-07 10:13:46 -05:00
Kieran Gill
ad3940c66f
text rendering: support strikethroughs (#7363)
<img width="1269" alt="image"
src="https://github.com/zed-industries/zed/assets/18583882/d4c93033-b2ac-4ae0-8e12-457f256ee869">

Release Notes:

- Added support for styling text with strikethrough.

Related: 
- https://github.com/zed-industries/zed/issues/5364
- https://github.com/zed-industries/zed/pull/7345
2024-02-07 16:51:27 +02:00
Antonio Scandurra
55129d4d6c
Revert "Use Fx* variants of HashMap and HashSet everywhere in Zed" (#7492)
Reverts zed-industries/zed#7481

This would regress performance because we'd be using the standard
library's hash maps everywhere, so reverting for now.
2024-02-07 13:16:22 +01:00
Thorsten Ball
5c8073d344
Underline text if in dead key state (#7488)
This highlights dead keys. Example: when in Brazilian keyboard layout
and typing `"` it's now underlined.



https://github.com/zed-industries/zed/assets/1185253/a6b65f7b-1007-473d-ab0f-5d658faa191b



Release Notes:

- Fixed dead keys not being underlined.

Co-authored-by: Antonio <antonio@zed.dev>
2024-02-07 12:52:49 +01:00
Thorsten Ball
db39b9dadc
Add ability to bind to pane::RevealInProjectPanel (#7487)
Previously it wasn't possible to create a keybinding for this action
because it required an argument.

Now the action takes the active item of the pane and if it's a
multi-buffer the first one.

This also adds a default keybinding for Vim mode: `-` will reveal the
file in the project panel.

Fixes #7485.

Release Notes:

- Added `pane::RevealInProjectPanel` as an action in the command
palette. ([#7485](https://github.com/zed-industries/zed/issues/7485)).

Co-authored-by: Antonio <antonio@zed.dev>
2024-02-07 12:50:22 +01:00
Todsaporn Banjerdkit
2aa8ccd6b1
fix: use OPEN_AI_API_URL (#7484)
Release Notes:

- N/A
2024-02-07 10:13:52 +01:00
Dzmitry Malyshau
e3ae7c4fe0 linux: query window geometry for determining the surface extents 2024-02-07 00:33:40 -08:00
Kirill Bulatov
eb236302c2
Use Fx* variants of HashMap and HashSet everywhere in Zed (#7481)
Release Notes:

- N/A
2024-02-07 09:45:37 +02:00
Amin Yahyaabadi
d3562d4c9c
Fixes for file-watching, user assets, and system dependencies (#2)
* fix: avoid panics in case of non-existing path for watching

* fix: copy the themes and plugins

* Revert "add a few more libraries to the linux script"

This reverts commit 7509677003.

* fix: add vulkan validation layers to the system deps

* fix: fix the themes paths
2024-02-06 22:54:40 -08:00
Conrad Irwin
9fd221271a
Go back to an alacritty release (#7474)
Release Notes:

- N/A
2024-02-06 20:58:38 -07:00
Andrew Marek
3aa4e0c90b
Fix Vim 'e' Behavior When Boundary Is Last Point on Line (#7424)
This was originally just to fix
https://github.com/zed-industries/zed/issues/4354, which I did by just
returning the previous offset in `find_boundary`.. but `find_boundary`
is used in the "insert mode" / normal editor too, so returning the
previous boundary breaks existing functionality in that case.

I was considering a new `find_boundary` function just for some of the
vim motions like this, but I thought that this is straightforward enough
and future Vim functions might need similar logic too.

Release Notes:

- Fixed https://github.com/zed-industries/zed/issues/4354
2024-02-06 20:25:56 -07:00
Conrad Irwin
90cd3b5e87
Prevent terminal being a single column wide (#7471)
Fixes: #2750
Fixes: #7457



Release Notes:

- Fixed a hang/panic that could happen rendering a double-width
character in a single-width terminal
([#2750](https://github.com/zed-industries/zed/issues/2750),
[#7457](https://github.com/zed-industries/zed/issues/7457)).
2024-02-06 20:25:02 -07:00
Max Brunsfeld
1264e36429
Remove Default impl for ConnectionId (#7452)
We noticed the following message in my logs when trying to debug some
lag when collaborating:

```
2024-02-06T09:42:09-08:00 [ERROR] error handling message. client_id:3, sender_id:Some(PeerId { owner_id: 327, id: 1123430 }), type:GetCompletions, error:no such connection: 0/0
```

That `0/0` looks like a bogus connection id, constructed via a derived
`Default`. We didn't ever find a code path that would *use* a default
`ConnectionId` and lead to this error, but it did seem like an
improvement to not have a `Default` for that type.

Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-06 15:45:15 -05:00
Max Brunsfeld
4e519e3af7
Make diagnostics with empty messages take up one line (#7456)
When a supporting diagnostic had an empty message, we were accidentally
giving the corresponding block a height of zero lines.

Release Notes:

- Fixed an issue where an editors' lines were not laid out correctly
when showing certain diagnostics.

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-06 15:38:54 -05:00
Remco Smits
6c4b96ec76
Add the ability to reply to a message (#7170)
Feature
- [x] Allow to click on reply to go to the real message
    - [x] In chat
- [x] Show only a part of the message that you reply to
    - [x] In chat
    - [x] In reply preview

TODO’s
- [x] Fix migration
    - [x] timestamp(in filename)
    - [x] remove the reference to the reply_message_id
- [x] Fix markdown cache for reply message
- [x] Fix spacing when first message is a reply to you and you want to
reply to that message.
- [x] Fetch message that you replied to
    - [x] allow fetching messages that are not inside the current view 
- [x] When message is deleted, we should show a text like `message
deleted` or something
    - [x] Show correct GitHub username + icon after `Replied to: `
    - [x] Show correct message(now it's hard-coded)
- [x] Add icon to reply + add the onClick logic
- [x] Show message that you want to reply to
  - [x] Allow to click away the message that you want to reply to
  - [x] Fix hard-coded GitHub user + icon after `Reply tp:`
  - [x] Add tests

<img width="242" alt="Screenshot 2024-02-06 at 20 51 40"
src="https://github.com/zed-industries/zed/assets/62463826/a7a5f3e0-dee3-4d38-95db-258b169e4498">
<img width="240" alt="Screenshot 2024-02-06 at 20 52 02"
src="https://github.com/zed-industries/zed/assets/62463826/3e136de3-4135-4c07-bd43-30089b677c0a">


Release Notes:

- Added the ability to reply to a message.
- Added highlight message when you click on mention notifications or a
reply message.

---------

Co-authored-by: Bennet Bo Fenner <53836821+bennetbo@users.noreply.github.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-02-06 13:22:54 -07:00
Piotr Osiewicz
743f9b345f
chore: Move workspace dependencies to workspace.dependencies (#7454)
We should prefer referring to local deps via `.workspace = true` from
now on.

Release Notes:

- N/A
2024-02-06 20:41:36 +01:00
Piotr Osiewicz
70e7ea365c
chore: Fix up warnings from cargo +beta check. (#7453)
With upcoming release of 1.76 I did a check of current +beta (which
seems to already be at 1.77). These would cause CI pipeline failures
once 1.77 is out.

Release Notes:

- N/A
2024-02-06 20:36:02 +01:00
Marshall Bowers
792c832205
Improve error handling when copying a permalink fails (#7447)
This PR improves the error handling when the `editor: copy permalink to
line` action fails.

Right now if something goes wrong nothing happens, and we don't write
anything to the logs.

This PR makes it so we display a toast when the operation fails with the
error message, as well as write it to the Zed logs.

Release Notes:

- Improved error behavior for `editor: copy permalink to line` action.
2024-02-06 12:08:11 -05:00
Marshall Bowers
0b2a9d2bea
Remove empty message editor placeholder (#7444)
This PR removes the placeholder that we previously displayed for the
chat message editor.

With the changes in #7441 we can no longer hit this codepath.

Release Notes:

- N/A
2024-02-06 11:37:08 -05:00
Thorsten Ball
960eaf6245
Remove unused TerminalView.has_new_content (#7429)
Found this last week with @osiewicz and we realized that it's unused. So
I think it's fine to remove it, but I want to hear whether @mikayla-maki
has some thoughts here.



Release Notes:

- N/A
2024-02-06 16:58:10 +01:00
Thorsten Ball
068c141559
Fix shell environment not loading for Nushell (#7442)
Turns out that Nushell doesn't like `-lic` and `&&`, but works perfectly
fine with `-l -i -c` and `;`, which the other shells do too.

These all work:

    bash -l -i -c 'echo lol; /usr/bin/env -0'
    nu -l -i -c 'echo lol; /usr/bin/env -0'
    zsh -l -i -c 'echo lol; /usr/bin/env -0'
    fish -l -i -c 'echo lol; /usr/bin/env -0'

Release Notes:

- Fixed shell environment not being loaded if Nushell was set as
`$SHELL`.
2024-02-06 16:44:24 +01:00
Marshall Bowers
56f7f18033
Hide the chat message editor when there is no active chat (#7441)
This PR makes it so the chat message editor is hidden when not in an
active chat.

Release Notes:

- Changed the chat message editor to be hidden when not in an active
chat.
2024-02-06 10:18:17 -05:00
Piotr Osiewicz
1446fb7632
Outline a bunch of methods in gpui that leaked SubscriberSet types (#7430)
This takes down LLVM IR size of theme_selector from 316k to ~250k. Note
that I do not care about theme_selector in particular, though it acts as
a benchmark for smaller crates to me ("how much static overhead in
compile time does gpui have").

The title is a bit dramatic, so just to shed some light: by leaking a
type I mean forcing downstream crates to codegen it's methods/know about
it's drop code. Since SubscriberSet is no longer used directly in the
generic (==inlineable) methods, users no longer have to codegen `insert`
and co.

Release Notes:

- N/A
2024-02-06 11:10:15 +01:00
Thorsten Ball
c591681bad
Fix Terminal focus handlers not being called (#7428)
This fixes #7401 and probably a few other things that seemed odd with
the terminal.

Turns out that `TerminalView` has `focus_in` and `focus_out` callbacks,
but they were never called. The `focus_handle` on which they were set
was not passed in to `TerminalView`.

That meant that the `impl FocusableView for TerminalView` never returned
the focus handle with the right callbacks.

This change here uses the already created focus handle and passes it in,
so that `focus_in` and `focus_out` are now correctly called.

Release Notes:

- Fixed terminal not handling focus-state correctly and, for example,
not restoring cursor blinking state correctly.
([#7401](https://github.com/zed-industries/zed/issues/7401)).
2024-02-06 10:31:01 +01:00
Oliver N
038d2a84e8
Respect RUST_LOG when started in terminal (#7425)
Release Notes:

- N/A
2024-02-06 10:14:50 +02:00
Dzmitry Malyshau
11964dc731 blade: cull mask support for sprites 2024-02-05 23:04:54 -08:00
Dzmitry Malyshau
78f32f30f5 linux: introduce platform callbacks 2024-02-05 21:49:19 -08:00
Dzmitry Malyshau
7721b55808 Refactor cli and gpui dependnecies based on PR review feedback 2024-02-05 21:49:00 -08:00
Mikayla Maki
c7c4166724
Disable extra frames for ProMotion when screen is not active. (#7410)
This was causing an issue where windows about 1/10 of the way across the
display would hang for a fully second after being deactivated.

Release Notes:

- N/A

Co-authored-by: max <max@zed.dev>
Co-authored-by: nathan <nathan@zed.dev>
Co-authored-by: antonio <antonio@zed.dev>
2024-02-05 14:48:54 -08:00
Conrad Irwin
d04a286634
Fix prompting the user to hang up when opening a workspace (#7408)
Before this change if you had joined a call with an empty workspace,
then we'd prompt you to hang up when you tried to open a recent project.



Release Notes:

- Fixed an erroneous prompt to "hang up" when opening a new project from
an empty workspace.
2024-02-05 15:21:18 -07:00
Pseudomata
1a40c9f0f2
Add Haskell buffer symbol search (#7331)
This PR is a follow-up from
https://github.com/zed-industries/zed/pull/6786#issuecomment-1912912550
and adds an `outline.scm` file for buffer symbol search support in
Haskell.

Release Notes:

- Added buffer symbol search support for Haskell
2024-02-05 17:20:40 -05:00
Conrad Irwin
0c34bd8935
fix following bugs (#7406)
- Another broken following test
- Fix following between two windows

Release Notes:

- Fixed following when the leader has multiple Zed windows open
2024-02-05 15:12:25 -07:00
Marshall Bowers
a80a3b8706
Add support for specifying both light and dark themes in settings.json (#7404)
This PR adds support for configuring both a light and dark theme in
`settings.json`.

In addition to accepting just a theme name, the `theme` field now also
accepts an object in the following form:

```jsonc
{
  "theme": {
    "mode": "system",
    "light": "One Light",
    "dark": "One Dark"
  }
}
```

Both `light` and `dark` are required, and indicate which theme should be
used when the system is in light mode and dark mode, respectively.

The `mode` field is optional and indicates which theme should be used:
- `"system"` - Use the theme that corresponds to the system's
appearance.
- `"light"` - Use the theme indicated by the `light` field.
- `"dark"` - Use the theme indicated by the `dark` field.

Thank you to @Yesterday17 for taking a first stab at this in #6881!

Release Notes:

- Added support for configuring both a light and dark theme and
switching between them based on system preference.
2024-02-05 15:39:01 -05:00
N8th8n8el
46464ebe87
terminal: Fix copy to clipboard lag (#7323)
Fixes #7322

Release Notes:

- Fixed terminal's copy to clipboard being non-instant ([7322](https://github.com/zed-industries/zed/issues/7322))
2024-02-05 22:06:43 +02:00
Kirill Bulatov
28a62affe4
Clean up visible inlay hints that got removed from the cache (#7399)
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
2024-02-05 22:03:44 +02:00
Caius Durling
6863b9263e
Add Terraform & HCL syntax highlighting (#6882)
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)).
2024-02-05 11:38:30 -08:00
Marshall Bowers
21797bad4d
file_finder: Simplify removal of file name from file path (#7398)
This PR simplifies the removal of the file name from the file path when
computing the file finder matches.

Release Notes:

- N/A
2024-02-05 13:26:42 -05:00
Marshall Bowers
ce62404e24
Correctly use the base element in HighlightedLabel (#7397)
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
2024-02-05 13:21:07 -05:00
Kirill Bulatov
8911e1b365
Make inlay hints test less flacky (#7396)
Suppresses a flacky inlay hints test failures like
https://github.com/zed-industries/zed/actions/runs/7788741514a for now.

Release Notes:

- N/A
2024-02-05 20:19:50 +02:00
Andrew Lygin
2ed45d72d8
File finder UI enhancement (#7364)
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
2024-02-05 11:12:47 -07:00
Conrad Irwin
e2e8e52ec4
Beancount syntax highlighting (#7389)
Release Notes:

- Added syntax highlighting for [Beancount](https://beancount.github.io)
2024-02-05 11:07:26 -07:00
Conrad Irwin
4195f27964
Fix hover links in channel buffers (#7393)
Release Notes:

- N/A
2024-02-05 10:57:53 -07:00
Thorsten Ball
583ce44359
Fix cmd+k in terminal and fix sporadic keybind misses (#7388)
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>
2024-02-05 10:55:27 -07:00
Antonio Scandurra
d742b3bfac
Mark the window as dirty when first opening it (#7384)
Otherwise we won't display anything if the window never notifies.

Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>
2024-02-05 09:09:49 -07:00
Julia
3bf412feff Use window's screen rather than window itself to start display link
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2024-02-05 11:03:23 -05:00
Marshall Bowers
8030e8cf47
Improve the contrast of the default search_match_background colors (#7382)
This PR improves the contrast of the default `search_match_background`
colors.

Release Notes:

- Improved the contrast of the default `search.match_background` colors.
2024-02-05 10:45:41 -05:00
Kirill Bulatov
45429a4528
Fix inlay hints using stale editor data (#7376)
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
2024-02-05 15:46:48 +02:00
Piotr Osiewicz
0755ce6486 picker: Outline Editor::new
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.
2024-02-05 14:01:06 +01:00
Thorsten Ball
87d3f59515
Do not show completion documentation if disabled (#7372)
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))
2024-02-05 11:43:16 +01:00
Amin Yahyaabadi
81bfa5fac4 fix: create the settings and keymaps to unblock file watching 2024-02-04 23:56:45 -08:00
Dzmitry Malyshau
521b2b12e4 linux: create a hidden window inside the platform
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.
2024-02-04 23:52:22 -08:00
Dzmitry Malyshau
282cc71df9 linux: refactor LinuxPlatform to avoid recursive locking from the window callbacks 2024-02-04 22:37:34 -08:00
Dzmitry Malyshau
8d339ede1c linux: HACK disable watcher and crash uploader temporarily 2024-02-04 20:23:06 -08:00
Dzmitry Malyshau
d03f3b9f18 linux: switch folders to use CONFIG_DIR 2024-02-04 20:14:11 -08:00
Dzmitry Malyshau
1c410c1b99 linux: only tick the main thread tasks and one at a time in the event loop 2024-02-04 19:36:58 -08:00
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
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
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
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
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