Commit Graph

18112 Commits

Author SHA1 Message Date
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
ea51536e0f
Disable vim in the feedback modal (#7716)
Fixes #7000 by disabling vim in this context

Release Notes:

- Fixed feedback modal in vim mode
([#7000](https://github.com/zed-industries/zed/issues/7000)).

**or**

- N/A
2024-02-12 22:28:36 -07: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
Valentine Briese
0fb6b32bc3
Correct typo in bundle script comment (#7682)
Release Notes:

- N/A
2024-02-12 10:30:38 +02: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
Jun
2f3ad9da4c
Use integer font size value in default settings (#7649)
Release Notes:

Fixed : default settings for terminal not containing a proper value for font size ([7469](https://github.com/zed-industries/zed/issues/7469))
2024-02-10 10:48:21 +02: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
Etienne Lacoursiere
eee00c3fef
Update configuring_zed.md with auto close section (#7625)
Adds a section for the `auto_close` feature  in `configuring_zed.md`

Release Notes:

- N/A
2024-02-09 19:59:09 +02: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
Kirill Bulatov
25c4cfe1d0 Bump action runners versions 2024-02-09 15:25:16 +02:00
Kirill Bulatov
702393af59 Use proper key for Linux rust cache 2024-02-09 15:25:16 +02: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
Conrad Irwin
91c699aeaa
Revert "Debug build (#7176)" (#7577)
This reverts commit aaba98d8ec.

Release Notes:

- N/A
2024-02-08 20:04:55 -07:00