Commit Graph

20958 Commits

Author SHA1 Message Date
Marshall Bowers
f7ff9b0811
vue: Bump to v0.1.0 (#14748)
This PR bumps the Vue extension to v0.1.0.

Changes:

- https://github.com/zed-industries/zed/pull/14747

Release Notes:

- N/A
2024-07-18 11:39:30 -04:00
Marshall Bowers
be1ff8aee9
vue: Install a global version of TypeScript if not present in the project (#14747)
This PR updates the Vue extension with support for installing and using
its own copy of TypeScript if it can't find one in the project.

The way we resolve `typescript` is as follows:

- We check the project's `package.json` for `typescript` in either the
`devDependencies` or `dependencies`
- If found, we set the `typescript.tsdk` to
`node_modules/typescript/lib` to use the project's copy of TypeScript
- If not found, we install the latest version of `typescript` (if not
already downloaded) to the extension's `package.json` and use that
version for `typescript.tsdk`

This should resolve instances where Vue projects that do not have an
explicit `typescript` dependency—such as those using Vue with plain
JavaScript—fail to load the language server due to TypeScript not being
found.

Release Notes:

- N/A
2024-07-18 11:32:46 -04:00
Thorsten Ball
3a83fecea9
gpui: Prefer removable over integrated Metal devices (#14744)
For context, see:

-
https://github.com/zed-industries/zed/issues/5124#issuecomment-2227743811
-
https://github.com/zed-industries/zed/pull/14738#issuecomment-2236613976

Short version: on Intel MacBooks it's better to prefer integrated
(`is_low_poer()`) GPUs, except when a user has an eGPU plugged-in, in
which case they very likely want to prefer that.

Before this change, we'd always prefer the integrated GPU, even if an
eGPU was available.

Now, with this change, if a user has

- eGPU
- integrated GPU
- discrete GPU

We'd first prefer eGPU, then integrated, then discrete.



Release Notes:

- Changed preference for GPUs on macOS so that eGPUs are now preferred
over integrated ones (and both of which are preferred over discrete
GPUs) on Intel Macs.
2024-07-18 16:52:38 +02:00
CharlesChen0823
bac4a0428d
project_panel: Select the newly created file when copy/pasting a file (#14705)
Closes: #14361 

Release Notes:

- Improved project panel to select newly created file on copy/paste ([#14361](https://github.com/zed-industries/zed/issues/14361))
2024-07-18 17:26:33 +03:00
Kirill Bulatov
ed3d3dc690
Improve same line diagnostic rendering (#14741)
Follow-up of https://github.com/zed-industries/zed/pull/14515

Fixed certain visual artifacts, related to multi line diagnostics and
block toggle rendering.
Also enabled diagnostics toolbar controls for the experimental view too.


Release Notes:

- N/A
2024-07-18 17:22:38 +03:00
Marshall Bowers
24d9374744
Add text_color helper for tab contents (#14737)
This PR adds a `text_color` method to `TabContentParams` to more easily
compute the text color to be used for tab contents.

This consolidates a number of conditionals that were scattered all over
the place to give us a singular source of truth for these colors.

Release Notes:

- N/A
2024-07-18 09:27:05 -04:00
Marshall Bowers
5d751f232c
collab_ui: Refine channel tab appearance (#14736)
This PR refines the appearance of the channel tabs.

We now display the channel icon in the tab's icon slot. We also now
adjust the icon based on whether the channel is public or members-only
(the same we do in the channel list):

<img width="214" alt="Screenshot 2024-07-18 at 9 02 00 AM"
src="https://github.com/user-attachments/assets/973d83c5-f045-4282-a43a-18e12ce93f78">

The `read-only` and `disconnected` states are now also shown in a
visually different style than the channel name:

<img width="247" alt="Screenshot 2024-07-18 at 9 01 13 AM"
src="https://github.com/user-attachments/assets/359f61cf-3b80-4a3f-8948-d705f6c24695">

Release Notes:

- Refined the appearance of channel tabs.
2024-07-18 09:18:09 -04:00
Piotr Osiewicz
3fb3148995
lsp: Use CompletionTriggerKind::TRIGGER_CHARACTER only for characters allowlisted by the server (#14734)
Fixes #13823


Release Notes:

- N/A
2024-07-18 14:53:31 +02:00
Thorsten Ball
76ce1a8f50
lsp: Use LspCommand.check_capabilities consistently (#14733)
This is a follow-up to #14666 in which I noticed that we don't need that
additional check, since each request will check whether it's supported
via the call to `check_capabilities` before sending the request.


Release Notes:

- N/A
2024-07-18 14:38:27 +02:00
Vitaly Slobodin
80558a3986
ruby: Bump to v0.0.8 (#14707)
Bump version of the Ruby extension to 0.0.8.

Changes:

- https://github.com/zed-industries/zed/pull/12642
- https://github.com/zed-industries/zed/pull/13216
- https://github.com/zed-industries/zed/pull/14661
- https://github.com/zed-industries/zed/pull/14693

Release Notes:

- N/A
2024-07-18 08:13:36 -04:00
Buzz
cdfadcc582
docs: Introduce command palette earlier (#14467)
Can't get to many of the settings on linux without opening it, and can't
know the default keystroke to get to it without knowing where to look
first, so its a chicken-n-egg problem of needing to use a
default-keystroke to set the key bindings, esp on linux.


Release Notes:

- N/A

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-07-18 14:09:43 +02:00
apricotbucket28
013c9f0420
linux: Implement local time zone support (#14610)
I decided to remove the GPUI APIs since `chrono` already provides this
functionality, and is already been used for this purpose in other parts
of the code (e.g.
[here](80402a6840/crates/zed/src/main.rs (L756))
or
[here](80402a6840/crates/ui/src/utils/format_distance.rs (L258)))

These usages end up calling the `time_format` crate, which takes in a
`UtcOffset`. It's probably cleaner to rewrite the crate to take in
`chrono` types, but that would require rewriting most of the code there.

Release Notes:

- linux: Use local time zone in chat and Git blame
2024-07-18 13:42:18 +02:00
Thorsten Ball
22a2cc6950
lsp: Check which code actions are supported before request (#14666)
This fixes https://github.com/zed-industries/zed/issues/13633 by not
sending `source.organizeImports` to the ESLint language server anymore.

Turns out that ESLint tells us through its capabilities that it doesn't
support that code action kind, but we ignored that.

What this code does is to check whether a given server supports specific
code action kinds.

It does this in two places:

1. When constructing the request: we now filter down the list of
   requested `kinds`, in case we can do so. If we can't filter down the
   list, we keep the previous behavior of sending the
   `language_server.code_action_kinds()`
2. Before sending the request: we now check whether the server even
   supports sending the request.

This fixes the issue by only sending actions to servers that support it.

I tested this with various language servers and setups and everything
still works (or works better). But of course there are a ton of
different combinations of language servers and code actions and file
types, so I couldn't test them all.

Release Notes:

- Fix ESLint language server adding comments on save if the
`source.organizeImports` code action was used on save. Zed now filters
out code actions sent to the language servers by checking whether they
are supported first.
([#13633](https://github.com/zed-industries/zed/issues/13633)).
2024-07-18 13:40:06 +02:00
Thorsten Ball
49effeb7ba
assistant: Fixed "quote selection" with Vim visual line mode (#14713)
Previously, when using Vim mode and doing a line-wise visual selection,
the `assistant: quote selection` action would not work correctly, since
it would ignore that these were line-wise selections.

With this change, one can now select lines using visual line mode and
"quote selection works"

Release Notes:

- Fixes `assistant: quote selection` not working correctly when making
visual-line-mode selections in Vim mode.
2024-07-18 10:30:01 +02:00
rimuy
edda634ca5
typescript: Highlight infer keyword (#14696)
This PR adds syntax highlighting to TypeScript's
[`infer`](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#inferring-within-conditional-types)
keyword.

Theme used: Sandcastle

**Before:**

![image](https://github.com/user-attachments/assets/e082cc8c-2e12-4cfa-a641-40324dd93f31)

**After:**

![image](https://github.com/user-attachments/assets/6263b5b2-19c8-4b64-87b6-ceead947bc03)



Release Notes:

- Added syntax highlighting to TypeScript's `infer` keyword
([#14696](https://github.com/zed-industries/zed/pull/14696))
2024-07-18 10:42:17 +03:00
Elliot Thomas
75948e536f
Fix worktree order serialization (#14676)
Fixes an issue in the serialization of workspaces that lead to incorrect
ordering of worktrees and refactors some other parts of the code to use
the new method.

Release Notes:

- N/A
2024-07-18 10:41:29 +03:00
Peter Tripp
eb7fe57453
Auto detect some DSLs (#14693)
- Brewfile, Vagrantfile, Puppetfile (ruby)
- Pipfile (toml)
2024-07-18 04:38:44 +00:00
Chung Wei Leong
6e08e49d30
docs: Fix tabs.file_icons default value (#14701)
Release Notes:

- Fixed `tabs.file_icons` default value in documentation, changed from
`true` to `false`
2024-07-17 23:03:57 -04:00
Marshall Bowers
2c8ead4423
Simplify constructing tab content that is purely textual (#14695)
This PR adds a streamlined way to consistently construct tab content for
items that only have textual content in the tabs.

The `Item` trait now has a new `tab_content_text` method that can be
used to return the textual content for the tab.

The `tab_content` method now has a default implementation that—unless
overridden—will construct a `Label` out of the text. This default
implementation also takes care of setting the label color based on the
active state of the tab, something that previously had to be repeated in
each `tab_content` implementation.

The majority of our tabs are now using `tab_content_text`.

Release Notes:

- N/A
2024-07-17 20:11:05 -04:00
Michael Angerman
ca2976559e
docs: Fix jupyter spelling in the command jupyter kernelspec list (#14694)
jupyter was spelled wrong in the repl docs

Release Notes:

- N/A
2024-07-17 20:03:04 -04:00
Marshall Bowers
457da7b27c
breadcrumbs: Use early return in set_active_pane_item (#14691)
This PR refactors the `set_active_pane_item` implementation for
`Breadcrumbs` to use an early return to avoid indenting the method body
more than necessary.

Release Notes:

- N/A
2024-07-17 18:58:44 -04:00
Marshall Bowers
a2424638f5
Improve multibuffer hints (#14690)
This PR improves the multibuffer hints added in #14668 to fix a few
issues.

The original implementation relied on bailing out early in `render` by
returning an `Empty` element. However, this had the unintended
side-effect that when initially opening a multibuffer (such as the
project search) there would be additional whitespace increasing the
height of the toolbar due to the empty element.

The reason we were doing this in the first place was because the hints
weren't updating when the item's breadcrumbs changed.

We're able to address this properly by using a subscription to the
item's events and recompute the visibility of the hint when the active
item's breadcrumbs change.

This also has the benefit of making the hints re-appear right away when
running the `welcome: reset hints` command with a multibuffer open.

Release Notes:

- N/A
2024-07-17 18:51:30 -04:00
Kyle Kelley
ba4fa17b83
Set the working directory according to the editor file path (#14688)
Kernels now launch in the same directory as the script invoking them,
similar to notebook behavior.


![image](https://github.com/user-attachments/assets/def86308-bea4-4fa3-8211-132a282a5ecc)


Release Notes:

- N/A
2024-07-17 15:37:47 -07:00
Conrad Irwin
f5f4578422
Tweak wording (#14686)
Co-Authored-By: Danilo <danilo@zed.dev>

Release Notes:

- N/A

Co-authored-by: Danilo <danilo@zed.dev>
2024-07-17 16:02:43 -06:00
Vitaly Slobodin
75775292b3
ruby: Add support for "rubocop" language server (#14661)
Hi, this pull request adds support for `rubocop` language server. I
noticed that `ruby-lsp` LS is becoming more popular but it still lacks
diagnostics support in Zed. To cover that missing feature, it could be
good to use `rubocop` LS to show diagnostics alongside with the running
Ruby LSP.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-07-17 17:29:42 -04:00
Justin Su
344e315174
Add -f to curl commands (#14667)
Release Notes:

- Updated curl commands with `-f` for improved error handling
([#14346](https://github.com/zed-industries/zed/issues/14346)).
2024-07-17 15:27:32 -06:00
Marshall Bowers
8ef53aafa2
Have Danger check the format of GitHub issue links (#14684)
This PR updates the Danger rules to check for GitHub issue links that
aren't in the desired format:

<img width="916" alt="Screenshot 2024-07-17 at 5 11 48 PM"
src="https://github.com/user-attachments/assets/c77d3c28-3b09-44aa-a97f-03c2400df2e6">

We don't yet check that the links are exactly formatted as expected,
just that they aren't incorrectly formatted in the way that people
typically get it wrong.

Release Notes:

- N/A
2024-07-17 17:15:47 -04:00
Marshall Bowers
00c3c02f7d
Render other tab icons in the start slot (#14683)
This PR reworks the rendering for tab icons to allow us to render all of
the tab icons—not just file icons—in the tab's start slot.

The `Item` trait now has a separate `tab_icon` method that can be used
to indicate what icon should be shown for the tab.

Release Notes:

- N/A
2024-07-17 16:59:41 -04:00
Nazar Matus
2edf224599
docs: Add openSUSE Tumbleweed to Linux installation options (#14642)
Add openSUSE Tumbleweed to the list

Release Notes:

- N/A
2024-07-17 14:22:55 -06:00
Congyu
16a4c59be0
Fix right clicks changing vim mode (#14626)
Release Notes:

- Fixed right clicks changing vim mode (#14625).

before:


https://github.com/user-attachments/assets/97f4c971-6b59-412d-844a-23e0bc4289aa

after:


https://github.com/user-attachments/assets/3fc9adf3-2572-428d-8674-b3c8317e457e
2024-07-17 14:19:35 -06:00
Conrad Irwin
90a46b0463
linux: Fix autoupdate in non-standard locations (#14624)
Release Notes:

- linux: Fixed auto-update into custom tarball locations (#14291)
2024-07-17 14:15:28 -06:00
Conrad Irwin
09b216cf5e
Make project search feel better (#14674)
Release Notes:

- Improved UX of project search

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-07-17 14:14:46 -06:00
Marshall Bowers
84b34677e2
Exclude dev extensions from auto-updates (#14680)
This PR makes it so dev extensions that are installed are excluded when
checking for extension updates.

We don't want to accidentally clobber dev extensions if the upstream
extension is deemed more "up-to-date".

Release Notes:

- Changed dev extensions to be excluded from extension auto-updates.
2024-07-17 15:35:09 -04:00
Marshall Bowers
5a090bc3f3
Dim the shared screen tab's icon when it is inactive (#14678)
This PR makes it so the icon of the shared screen tab is properly dimmed
when the tab is inactive.

Release Notes:

- Fixed an issue where the shared screen tab's icon would not render as
dimmed when the tab was inactive.
2024-07-17 15:25:56 -04:00
Conrad Irwin
4852e170ff
Introducing multibuffers (#14668)
Co-Authored-By: Marshall <marshall@zed.dev>

Release Notes:

- Added a hint the first few times you open a multibuffer to explain
what is going on.

Co-authored-by: Marshall <marshall@zed.dev>
2024-07-17 13:54:52 -04:00
Joseph T Lyons
53bcc3649a Add PR author to release notes scraper script 2024-07-17 13:20:19 -04:00
Thorsten Ball
9241b11e1f
Restore unsaved buffers on restart (#13546)
This adds the ability for Zed to restore unsaved buffers on restart. The
user is no longer prompted to save/discard/cancel when trying to close a
Zed window with dirty buffers in it. Instead those dirty buffers are
stored and restored on restart.

It does this by saving the contents of dirty buffers to the internal
SQLite database in which Zed stores other data too. On restart, if there
are dirty buffers in the database, they are restored.

On certain events (buffer changed, file saved, ...) Zed will serialize
these buffers, throttled to a 100ms, so that we don't overload the
machine by saving on every keystroke. When Zed quits, it waits until all
the buffers are serialized.


### Current limitations
- It does not persist undo-history (right now we don't persist/restore
undo-history regardless of dirty buffers or not)
- It does not restore buffers in windows without projects/worktrees.
Example: if you open a new window with `cmd-shift-n` and type something
in a buffer, this will _not_ be stored and you will be asked whether to
save/discard on quit. In the future, we want to fix this by also
restoring windows without projects/worktrees.

### Demo



https://github.com/user-attachments/assets/45c63237-8848-471f-8575-ac05496bba19



### Related tickets

I'm unsure about closing them, without also fixing the 2nd limitation:
restoring of worktree-less windows. So let's wait until that.

- https://github.com/zed-industries/zed/issues/4985
- https://github.com/zed-industries/zed/issues/4683

### Note on performance

- Serializing editing buffer (asynchronously on background thread) with
500k lines takes ~200ms on M3 Max. That's an extreme case and that
performance seems acceptable.

Release Notes:

- Added automatic restoring of unsaved buffers. Zed can now be closed
even if there are unsaved changes in buffers. One current limitation is
that this only works when having projects open, not single files or
empty windows with unsaved buffers. The feature can be turned off by
setting `{"session": {"restore_unsaved_buffers": false}}`.

---------

Co-authored-by: Bennet <bennet@zed.dev>
Co-authored-by: Antonio <antonio@zed.dev>
2024-07-17 18:10:20 +02:00
Joseph T Lyons
8e9e94de22 v0.146.x dev 2024-07-17 11:29:16 -04:00
Marshall Bowers
1607e4e0e1
elixir: Bump to v0.0.6 (#14657)
This PR bumps the Elixir extension to v0.0.6.

Changes:

- #14655

Release Notes:

- N/A
2024-07-17 11:14:52 -04:00
Marshall Bowers
ceffc7e1cf
elixir: Respect LSP settings for Lexical (#14655)
This PR updates the Elixir extension with support for reading the LSP
settings when using Lexical as the language server.

Release Notes:

- N/A
2024-07-17 11:04:34 -04:00
Thorsten Ball
e69b995a3b
zig: Bump to v0.1.4 (#14651)
This PR bumps the Zig extension to v0.1.4.

Changes:

- #14379

Release Notes:

- N/A
2024-07-17 10:41:12 -04:00
Marshall Bowers
f19b51c0b2
zig: Revert changes dependent on new zed_extension_api (#14652)
This PR reverts the changes to the Zig extension dependent on the new
`zed_extension_api` version so that we can publish the Zig extension.

Release Notes:

- N/A
2024-07-17 10:40:25 -04:00
Marshall Bowers
1d2d3b209e
svelte: Bump to v0.0.3 (#14650)
This PR bumps the Svelte extension to v0.0.3.

Changes:

- #14614

Release Notes:

- N/A
2024-07-17 10:20:50 -04:00
Marshall Bowers
959fbd5e45
docs: Fix typo in Svelte docs (#14649)
This PR fixes a typo in the Svelte docs to reflect the fixes from
#14614.

Release Notes:

- N/A
2024-07-17 10:08:20 -04:00
Nemo
ff85f1d608
Fix default sublime tab navigation (#14427)
Co-authored-by: Peter Tripp <peter@zed.dev>
2024-07-17 10:07:46 -04:00
Peter Tripp
d1300b7a66
Linux Keybinding Improvements (#14600)
- Fixed ctrl-shift-d (duplicate line) conflict.
- Fixes #14458
- Remove some duplicated definitions
- Fix Expand/Shrink selection (was ctrl-shift-up/down, now alt-shift-left/right)
- Add `ctrl-f2` / `cmd-f2` as alias for `editor::SelectAllMatches` matching VSCode
- Moved multi-cursor (Insert cursor above / below) from ctrl-shift-up/down to alt-shift-up/down
2024-07-17 10:06:47 -04:00
Mathias
62f5503e93
svelte: Fix typo in LSP config for inlayHints (#14614)
9b51c5b177/packages/service/configuration.schema.json (L158)

Before:
![Screenshot from 2024-07-17
02-45-37](https://github.com/user-attachments/assets/15f67b7b-ed29-418a-b6a5-23601c1ad820)

After:
![Screenshot from 2024-07-17
02-38-37](https://github.com/user-attachments/assets/c6cb71fc-70f4-4ea3-91d4-a184342163b4)

Release Notes:

- N/A
2024-07-17 09:59:21 -04:00
Kyle Kelley
738d079aa7
docs: Remove extra backtick within repl docs (#14611) 2024-07-17 06:59:05 -07:00
Marshall Bowers
4feb994ad8
php: Bump to v0.1.1 (#14647)
This PR bumps the PHP extension to v0.1.1.

Changes:

- #14643

Release Notes:

- N/A
2024-07-17 09:40:00 -04:00
Marshall Bowers
40ed3b6977
php: Allow using intelephense from PATH (#14643)
This PR updates the PHP extension to use `intelephense` from the PATH,
if it exists.

Tested using the following Nix shell:

```sh
NIXPKGS_ALLOW_UNFREE=1 nix-shell -p php nodePackages_latest.intelephense
```

Resolves #11994.

Release Notes:

- N/A
2024-07-17 09:20:31 -04:00