Commit Graph

1700 Commits

Author SHA1 Message Date
Luis Cossío
7b5fdcee7f
lsp: Support Goto Declaration (#15785)
Adds support for [Goto
Declaration](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_declaration)
LSP command.

I am particularly interested in [this for Rust
projects](https://rust-analyzer.github.io/manual.html#go-to-declaration),
to be able to navigate to the place where a trait method is declared,
coming from a trait method implementation.

I noticed this was something I could do in VSCode before, but was
somehow missing is Zed. Thanks to the already existing infrastructure
for Goto Definition, I just followed and copy-paste-adapted it for Goto
Declaration.

As a bonus, I added `ctrl-F12` and `alt-ctrl-F12` as default macOS
keybindings for `GoToDeclaration` and `GoToDeclarationSplit`,
respectively. They are not keybindings from another editor, but I
figured they made sense to be grouped along with the other *F12
commands.

### Release Notes:

- Added "Go to declaration" editor action.
- vim: Breaking change to keybindings after introduction of the `Go to
declaration` editor action. The new keybindings are the following (and
can be found [here](https://zed.dev/docs/vim), alongside the other key
bindings):
  - `g d` - Go to definition
  - `g D` - Go to declaration
  - `g y` - Go to type definition
  - `g I` - Go to implementation




https://github.com/user-attachments/assets/ee5c10a8-94f0-4e50-afbb-6f71db540c1b

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-08-06 11:20:51 +02:00
Marshall Bowers
7652045903
Remove primary/secondary distinction for CachedLspAdapter (#15634)
This PR removes the primary/secondary distinction for
`CachedLspAdapter`s.

After #15624 we weren't relying on the `is_primary` field anywhere, so
we can remove it.

Release Notes:

- N/A
2024-08-01 13:51:34 -04:00
Marshall Bowers
3bd9a3f478
Respect the language_servers setting's order when determining the primary language server (#15624)
This PR updates how we determine the "primary" language server for a
buffer to make it respect the order specified by the `language_servers`
setting.

Previously we were relying on the language servers to be registered in
the right order in order to select the primary one effectively.

However, in my testing I observed some cases where a native language
server (e.g., `tailwindcss-language-server`) could end up first in the
list of language servers despite not being first in the
`language_servers` setting.

While this wasn't a problem for the Tailwind or ESLint language servers
on account of them being defined natively with the designation of
"secondary" language servers, this could cause problems with
extension-based language servers.

To remedy this, every time we start up language servers we reorder the
list of language servers for a given language to reflect the order in
the `language_servers` setting. This ordering then allows us to treat
the first language server in the list as the "primary" one.

Related issues:

- https://github.com/zed-industries/zed/issues/15023
- https://github.com/zed-industries/zed/issues/15279

Release Notes:

- The ordering of language servers will now respect the order in the
`language_servers` setting.
- The first language server in this list will be used as the primary
language server.
2024-08-01 11:58:23 -04:00
Piotr Osiewicz
ac1a15f5d7
assistant: Report all worktree entries in /file completions (#15617)
We were reporting file count as worktree entry count, which led to us
missing some of the entries in /file command completion.

/cc @bennetbo

The other components that used `PathMatchCandidateSet` are
`/diagnostics` and file finder. File finder is unaffected, as it used
`Candidates::Files` - thus previously reported count was correct for it;
`/diagnostics` were using `::Entries` as well, so it could miss entries
just like `/files`.

Release Notes:

- Fixed /file and /diagnostics slash commands omitting entries in it's
completions menu.
2024-08-01 16:09:53 +02:00
Antonio Scandurra
fef95110bb
If paths from edit steps omit worktree root, search worktrees for relative path (#15543)
Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>
2024-07-31 17:55:11 +02:00
Conrad Irwin
583b6235fb
SSH remoting: terminal & tasks (#15321)
This also rolls back the `TerminalWorkDir` abstraction I added for the
original remoting, and tidies up the terminal creation code to be clear
about whether we're creating a task *or* a terminal. The previous logic
was a little muddy because it assumed we could be doing both at the same
time (which was not true).

Release Notes:

- remoting alpha: Removed the ability to specify `gh cs ssh` or `gcloud
compute ssh` etc. See https://zed.dev/docs/remote-development for
alternatives.
- remoting alpha: Added support for terminal and tasks to new
experimental ssh remoting
2024-07-28 22:45:00 -06:00
Thorsten Ball
0360cda543
tasks: Use environment variables from project (#15266)
This fixes #12125 and addresses what's described in here:

-
https://github.com/zed-industries/zed/issues/4977#issuecomment-2162094388

Before the changes in this PR, when running tasks, they inherited the
Zed process environment, but that might not be the process environment
that you'd get if you `cd` into a project directory.

We already ran into that problem with language servers and we fixed it
by loading the shell environment in the context of a projects root
directory and then passing that to the language servers when starting
them (or when looking for their binaries).

What the change here does is to add the behavior for tasks too: we use
the project-environment as the base environment with which to spawn
tasks. Everything else still works the same, except that the base env is
different.

Release Notes:

- Improved the environment-variable detection when running tasks so that
tasks can now access environment variables as if the task had been
spawned in a terminal that `cd`ed into a project directory. That means
environment variables set by `direnv`/`asdf`/`mise` and other tools are
now picked up.
([#12125](https://github.com/zed-industries/zed/issues/12125)).

Demo:


https://github.com/user-attachments/assets/8bfcc98f-0f9b-4439-b0d9-298aef1a3efe
2024-07-26 18:19:53 +02:00
CharlesChen0823
7aa6f4788d
regression: Fix a panic when removing git-containing worktree from the project panel (#15256)
Follow-up of #14989

Opening a project with git metadata and clicking "Remove from Project" will panic:
![image](https://github.com/user-attachments/assets/ba00dc55-d299-4edc-9a1f-01e92f0dd9ca)

Release Notes:

- N/A
2024-07-26 14:20:59 +03:00
Piotr Osiewicz
0d5de88c4b
chore: Bump Rust version to 1.80 (#15186)
Release Notes:

- N/A
2024-07-25 22:48:42 +02:00
Max Brunsfeld
b14bb6bda4
Make git blame for SSH remote projects (#15106)
This also refactors the BufferStore + WorktreeStore interfaces to make
them cleaner, more fully encapsulating the RPC aspects of their
functionality.

Release Notes:

- N/A
2024-07-24 15:50:29 -07:00
Kirill Bulatov
fd4a4127eb
Use proper names for sorting path entries (#15116)
Closes https://github.com/zed-industries/zed/issues/12470

Release Notes:

- Fixed project panel not showing properly file entries for directories
with dots in their names
([#12470](https://github.com/zed-industries/zed/issues/12470))
2024-07-24 23:36:13 +03:00
Marshall Bowers
0297a42735
Use US English spelling of "behavior" and "customize" (#15117)
This PR fixes some instances that weren't using US English spellings of
"behavior" and "customize".

Release Notes:

- N/A
2024-07-24 16:36:01 -04:00
Vitaly Slobodin
9c9a0bd24f
lsp: Check if "Goto Definition" supported before request (#15111)
This is related to #15023 where we have the running Rubocop LSP that
provides diagnostics and formatting capabilities. Rubocop LSP sends its
capabilities
back to Zed without support for "textDocument/definition" request, Zed
actually does not check that and sends a request to Rubocop that results
in the server error "Unsupported method: textDocument/definition".

The fix here is related to
https://github.com/zed-industries/zed/pull/14666

Release Notes:

- N/A
2024-07-24 23:28:23 +03:00
Nathan Sobo
87d93033d1
Support Jupytext-style line comments for REPL evaluation ranges (#15073)
This adds support for detecting line comments in the
[Jupytext](https://jupytext.readthedocs.io/) format. When line comments
such as `# %%` is present, invoking `repl: run` will evaluate the code
between these line comments as a unit.

/cc @rgbkrk 

```py
# %%
# This is my first block
print(1)
print(2)

# %%
# This is my second block
print(3)
```

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-07-24 11:53:58 +02:00
Mikayla Maki
855048041d
Update http crate name (#15041)
Release Notes:

- N/A
2024-07-23 15:01:05 -07:00
Kirill Bulatov
b2b9d4ccb6
Extend task templates with shell and hide fields to use custom shells and custom close behavior (#15031) 2024-07-23 22:58:36 +03:00
Max Brunsfeld
38e3182bef
Handle buffer diff base updates and file renames properly for SSH projects (#14989)
Release Notes:

- N/A

---------

Co-authored-by: Conrad <conrad@zed.dev>
2024-07-23 11:32:37 -07:00
Piotr Osiewicz
3d1bf09299
Allow user to use multiple formatters (#14846)
Fixes #4822
- [x] Release note
- [ ] Surface formatting errors via a toast
- [x] Doc updates
- [x] Have "language-server" accept an optional name of the server.

Release Notes:

- `format` and `format_on_save` now accept an array of formatting
actions to run.
- `language_server` formatter option now accepts the name of a language
server to use (e.g. `{"language_server": {"name: "ruff"}}`); when not
specified, a primary language server is used.

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-07-23 20:05:09 +02:00
Piotr Osiewicz
865904a0c9
lsp: Pass back diagnostic .data when querying code actions for it (#14962)
Per the LSP spec, we should pass .data field of diagnostics into code
action request:
```
	/**
	 * A data entry field that is preserved between a
	 * `textDocument/publishDiagnostics` notification and
	 * `textDocument/codeAction` request. *
	 * @since 3.16.0 */ data?: LSPAny;
```


Release Notes:

- Fixed rare cases where a code action triggered by diagnostic may not
be available for use.
2024-07-22 17:49:11 +02:00
Max Brunsfeld
b9a53ffa0b
Add the ability to edit remote directories over SSH (#14530)
This is a first step towards allowing you to edit remote projects
directly over SSH. We'll start with a pretty bare-bones feature set, and
incrementally add further features.

### Todo

Distribution
* [x] Build nightly releases of `zed-remote-server` binaries
    * [x] linux (arm + x86)
    * [x] mac (arm + x86)
* [x] Build stable + preview releases of `zed-remote-server`
* [x] download and cache remote server binaries as needed when opening
ssh project
* [x] ensure server has the latest version of the binary


Auth
* [x] allow specifying password at the command line
* [x] auth via ssh keys
* [x] UI password prompt

Features
* [x] upload remote server binary to server automatically
* [x] opening directories
* [x] tracking file system updates
* [x] opening, editing, saving buffers
* [ ] file operations (rename, delete, create)
* [ ] git diffs
* [ ] project search

Release Notes:

- N/A

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-07-19 10:27:26 -07:00
Antonio Scandurra
4d177918c1
Start on adding support for editing via the assistant panel (#14795)
Note that this shouldn't have any visible user-facing behavior yet. The
feature is incomplete but we wanna merge early to avoid a long-running
branch.

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-07-19 11:13:15 +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
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
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
Mathias
bd02f4fe28
Respect user preference for JS/TS on_type formatting (#14536)
Release Notes:

- Fix user preferences for JS/TS on_type formatting not being respected by VTSLS.
([#13733](https://github.com/zed-industries/zed/issues/13733),
[#14499](https://github.com/zed-industries/zed/issues/14499))
2024-07-17 11:11:00 +02:00
Conrad Irwin
62ab6e1a11
remoting: Allow Add/Remove remote folder (#14532)
Release Notes:

- remoting (alpha only): Allow add/remove folders to projects

---------

Co-authored-by: Max <max@zed.dev>
2024-07-16 12:01:59 -06:00
Conrad Irwin
abc5abcd8b
open picker (#14524)
Release Notes:

- linux: Added a fallback Open picker for when XDG is not working
- Added a new setting `use_system_path_prompts` (default true) that can
be disabled to use Zed's builtin keyboard-driven prompts.

---------

Co-authored-by: Max <max@zed.dev>
2024-07-15 17:04:15 -06:00
Kirill Bulatov
d7a25c1696
Add an experimental, WIP diagnostics grouping panel (#14515)
Provide a current, broken state as an experimental way to browse
diagnostics.
The diagnostics are grouped by lines and reduced into a block that, in
case of multiple diagnostics per line, could be toggled back and forth
to show more diagnostics on the line.
Use `grouped_diagnostics::Deploy` to show the panel.

Issues remaining:
* panic on warnings toggle due to incorrect excerpt manipulation
* badly styled blocks
* no key bindings to navigate between blocks and toggle them
* overall odd usability gains for certain groups of people

Due to all above, the thing is feature-gated and not exposed to regular
people.


Release Notes:

- N/A
2024-07-15 22:58:18 +03:00
Kirill Bulatov
977a1b7a82
Support dynamic formatting capabilities [un]registration (#14478)
Closes https://github.com/zed-industries/zed/issues/12661

Release Notes:

- Added dynamic [un]registration for LSP formatting capabilities
([#12661](https://github.com/zed-industries/zed/issues/12661))
2024-07-15 12:27:33 +03:00
Kirill Bulatov
f8b5e42070
Do not send textDocument/didSave message if server does not declare its support (#14412)
Release Notes:

- Improved Zed logic for sending `textDocument/didSave` request
([14286](https://github.com/zed-industries/zed/issues/14286))
2024-07-13 21:59:21 +03:00
Kirill Bulatov
9ce989a704
Tidy up collab-related signature help data (#14377)
Follow-up of https://github.com/zed-industries/zed/pull/12909

* Fully preserve LSP data when sending it via collab, and only strip it
on the client.
* Avoid extra custom request handlers, and extend multi LSP server query
protocol instead.


Release Notes:

- N/A
2024-07-13 04:06:01 +03:00
Max Brunsfeld
489077befc
Extract a BufferStore object from Project (#14037)
This is a ~small~ pure refactor that's a step toward SSH remoting. I've
extracted the Project's buffer state management into a smaller, separate
struct called `BufferStore`, currently in the same crate. I did this as
a separate PR to reduce conflicts between main and `remoting-over-ssh`.

The idea is to make use of this struct (and other smaller structs that
make up `Project`) in a dedicated, simpler `HeadlessProject` type that
we will use in the SSH server to model the remote end of a project. With
this approach, as we develop the headless project, we can avoid adding
more conditional logic to `Project` itself (which is already very
complex), and actually make `Project` a bit smaller by extracting out
helper objects.

Release Notes:

- N/A
2024-07-12 15:25:54 -07:00
Stanislav Alekseev
8abc000553
Fix nushell local env detection by using direnv export (#13902)
I don't intend fully on getting this merged, this is just an experiment
on using `direnv` directly without relying on shell-specific behaviours.
It works though, so this finally closes #8633
Release Notes:

- Fixed nushell not picking up `direnv` environments by directly
interfacing with it using `direnv export`

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-07-12 10:29:32 +02:00
Donough Liu
d49727ff10
terminal: Set TERM_PROGRAM and TERM_PROGRAM_VERSION environment variables in integrated terminal (#14213)
![image](https://github.com/zed-industries/zed/assets/31354274/9d1c5410-897b-40a1-8256-2d7e207f69ff)

These two environment variables are essential when people need to detect
terminal type and do something. Many popular terminals set them.

fixes https://github.com/zed-industries/zed/issues/4571

Release Notes:

- Set `TERM_PROGRAM` and `TERM_PROGRAM_VERSION` environment variables in
the integrated terminal
([#4571](https://github.com/zed-industries/zed/issues/4571)).
2024-07-11 20:48:46 +03:00
Piotr Osiewicz
2727f55772
Add support for projects managed with Yarn (#13644)
TODO:
- [ ] File a PR with Yarn to add Zed to the list of supported IDEs.

Fixes: https://github.com/zed-industries/zed/issues/10107
Fixes: https://github.com/zed-industries/zed/issues/13706
Release Notes:

- Improved experience in projects using Yarn. Run `yarn dlx
@yarnpkg/sdks base` in the root of your project in order to elevate your
experience.

---------

Co-authored-by: Saurabh <79586784+m4saurabh@users.noreply.github.com>
2024-07-11 14:56:07 +02:00
tomoikey
291d64c803
lsp: Implement textDocument/signatureHelp for ProjectClientState::Local environment (#12909)
Closes https://github.com/zed-industries/zed/issues/5155
Closes https://github.com/zed-industries/zed/issues/4879


# Purpose
There was no way to know what to put in function signatures or struct
fields other than hovering at the moment. Therefore, it was necessary to
implement LSP's `textDocument/signatureHelp`.

I tried my best to match the surrounding coding style, but since this is
my first contribution, I believe there are various aspects that may be
lacking. I would greatly appreciate your code review.

# Description
When the window is displayed, the current argument or field at the
cursor's position is automatically bolded. If the cursor moves and there
is nothing to display, the window closes automatically.
To minimize changes and reduce the burden of review and debugging, the
SignatureHelp feature is implemented only when `is_local` is `true`.
Some `unimplemented!()` macros are embedded, but rest assured that they
are not called in this implementation.

# How to try it out
Press `cmd + i` (MacOS), `ctrl + i` (Linux).

# Enable auto signature help (2 ways)
### Add `"auto_signature_help": true` to `settings.json`
<img width="426" alt="image"
src="https://github.com/zed-industries/zed/assets/55743826/61310c39-47f9-4586-94b0-ae519dc3b37c">

Or

### Press `Auto Signature Help`. (Default `false`)
<img width="226" alt="image"
src="https://github.com/zed-industries/zed/assets/55743826/34155215-1eb5-4621-b09b-55df2f1ab6a8">

# Disable to show signature help after completion
### Add `"show_signature_help_after_completion": false` to
`settings.json`
<img width="438" alt="image"
src="https://github.com/zed-industries/zed/assets/55743826/5e5bacac-62e0-4921-9243-17e1e72d5eb6">

# Movie

https://github.com/zed-industries/zed/assets/55743826/77c12d51-b0a5-415d-8901-f93ef92098e7

# Screen Shot
<img width="628" alt="image"
src="https://github.com/zed-industries/zed/assets/55743826/3ebcf4b6-2b94-4dea-97f9-ac4f33e0291e">

<img width="637" alt="image"
src="https://github.com/zed-industries/zed/assets/55743826/6dc3eb4d-beee-460b-8dbe-d6eec6379b76">

Release Notes:

- Show function signature popovers
([4879](https://github.com/zed-industries/zed/issues/4879),
[5155](https://github.com/zed-industries/zed/issues/5155))

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2024-07-11 13:38:33 +03:00
Ephram
945764e409
Selectable popover text (#12918)
Release Notes:

- Fixed #5236
- Added the ability to select and copy text from information popovers



https://github.com/zed-industries/zed/assets/50590465/d5c86623-342b-474b-913e-d07cc3f76de4

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Antonio <ascii@zed.dev>
2024-07-10 21:14:34 -06:00
Piotr Osiewicz
33a67ad6b9
chore: Clippy fixes for 1.80 (#13987)
The biggest hurdle turned out to be use of `Arc<Language>` in maps, as
`clippy::mutable_key_type` started triggering on it (due to - I suppose
- internal mutability on `HighlightMap`?). I switched over to using
`LanguageId` as the key type in some of the callsites, as that's what
`Language` uses anyways for it's hash/eq, though I've still had to
suppress the lint outside of language crate.

/cc @maxdeviant , le clippy guru.

Release Notes:

- N/A
2024-07-10 17:53:17 +02:00
Antonio Scandurra
8944af7406
Lay the groundwork for collaborating on assistant panel (#13991)
This pull request introduces collaboration for the assistant panel by
turning `Context` into a CRDT. `ContextStore` is responsible for sending
and applying operations, as well as synchronizing missed changes while
the connection was lost.

Contexts are shared on a per-project basis, and only the host can share
them for now. Shared contexts can be accessed via the `History` tab in
the assistant panel.

<img width="1819" alt="image"
src="https://github.com/zed-industries/zed/assets/482957/c7ae46d2-cde3-4b03-b74a-6e9b1555c154">


Please note that this doesn't implement following yet, which is
scheduled for a subsequent pull request.

Release Notes:

- N/A
2024-07-10 17:36:22 +02:00
Piotr Osiewicz
09e7b481b8
lsp: Add support for ShowMessage notification (#14012)
When "one newer language" sends these messages, "one newer editor" will
display a pop-up for users to see. :)

Related to https://github.com/gleam-lang/gleam/issues/3274


![image](https://github.com/zed-industries/zed/assets/24362066/00d2c168-59f0-4033-91c8-af29c47516b3)

Release Notes:

- A certain popular language recently had to work around a missing LSP
notification. This has been fixed
2024-07-09 20:12:05 +02:00
Piotr Osiewicz
9a6f30fd95
Snippets: Move snippets into the core of editor (#13937)
Release Notes:

- Move snippet support into core editor experience, marking the official
extension as deprecated. Snippets now show up in any buffer (including
plain text buffers).
2024-07-09 14:02:36 +02:00
Piotr Osiewicz
bac6e2fee7
tasks: Add experimental support for user-defined task variables (#13699)
Context:
@bennetbo spotted a regression in handling of `cargo run` task in zed
repo following a merge of #13658. We've started invoking `cargo run`
from the folder of an active file whereas previously we did it from the
workspace root. We brainstormed few solutions that involved adding a
separate task that gets invoked at a workspace level, but I realized
that a cleaner solution may be to finally add user-configured task
variables. This way, we can choose which crate to run by default at a
workspace level.

This has been originally brought up in the context of javascript tasks
in
https://github.com/zed-industries/zed/pull/12118#issuecomment-2129232114

Note that this is intended for internal use only for the time being.
/cc @RemcoSmitsDev we should be unblocked on having runner-dependant
tasks now.

Release notes:

- N/A
2024-07-01 15:59:19 +02:00
Conrad Irwin
cd81dad2fa
fix panics (#13554)
Release Notes:

- Fixed a panic when editing HTML near the end of a file
- Fixed a panic when editing settings.json from inside the .zed
directory
2024-06-26 14:32:16 -06:00
Max Brunsfeld
6fba1e46a8
Remove never-used client parameter from message handler functions (#13406)
Every single client-side RPC message handler function took an unused
`Arc<Client>` parameter. This removes that.

Release Notes:

- N/A
2024-06-22 16:07:36 -07:00
Max Brunsfeld
89d2ace713
Make LSP task cancellation discoverable (#13226)
Release Notes:

- Added the ability to cancel a cargo check by clicking on the status
bar item.
2024-06-18 12:44:35 -07:00
Marshall Bowers
81475ac4cd
paths: Replace lazy_static! with OnceLock (#13213)
This PR replaces the `lazy_static!` usages in the `paths` crate with
`OnceLock` from the standard library.

This allows us to drop the `lazy_static` dependency from this crate.

The paths are now exposed as accessor functions that reference a private
static value.

Release Notes:

- N/A
2024-06-18 12:22:37 -04:00
Piotr Osiewicz
5dc26c261d
util: Use GlobSet in PathMatcher (#13197)
Previously we were using a single globset::Glob in PathMatcher; higher
up the stack, we were then resorting to using a list of PathMatchers.
globset crate exposes a GlobSet type that's better suited for this use
case. In my benchmarks, using a single PathMatcher with GlobSet instead
of a Vec of PathMatchers with Globs is about 3 times faster with the
default 'file_scan_exclusions' values. This slightly improves our
project load time for projects with large # of files, as showcased in
the following videos of loading a project with 100k source files. This
project is *not* a git repository, so it should measure raw overhead on
our side.

Current nightly: 51404d4ea0


https://github.com/zed-industries/zed/assets/24362066/e0aa9f8c-aae6-4348-8d42-d20bd41fcd76

versus this PR:


https://github.com/zed-industries/zed/assets/24362066/408dcab1-cee2-4c9e-a541-a31d14772dd7



Release Notes:

- Improved performance in large worktrees
2024-06-18 16:12:24 +02:00
Piotr Osiewicz
3a26a4809d
lsp: Revert URL type change (#13193)
This reverts URI changes made in
https://github.com/zed-industries/zed/pull/12928 while keeping the perf
goodies in tact. We should keep an eye out for
https://github.com/gluon-lang/lsp-types/issues/284
Fixes: https://github.com/zed-industries/zed/issues/13135
Fixes: https://github.com/zed-industries/zed/issues/13131
Release Notes:

- N/A
2024-06-18 12:39:56 +02:00
Max Brunsfeld
7003b0f211
Allow canceling in-progress language server work (e.g. cargo check) (#13173)
Release Notes:

- Added a more detailed message in place of the generic `checking...`
messages when Rust-analyzer is running.
- Added a rate limit for language server status messages, to reduce
noisiness of those updates.
- Added a `cancel language server work` action which will cancel
long-running language server tasks.

---------

Co-authored-by: Richard <richard@zed.dev>
2024-06-17 17:58:47 -07:00
Marshall Bowers
258a8a37d8
Extract paths out of util (#13182)
This PR extracts the definition of the various Zed paths out of `util`
and into a new `paths` crate.

`util` is for generic utils, while these paths are Zed-specific. For
instance, `gpui` depends on `util`, and it shouldn't have knowledge of
these paths, since they are only used by Zed.

Release Notes:

- N/A
2024-06-17 19:27:42 -04:00
Joseph T. Lyons
ca035dbdd8
Move project event logic to telemetry.rs (#13166)
I previously put this logic directly into `project.rs`, but it doesn't
feel good to pollute that code with telemetry logic, so I've moved it
over to `telemetry.rs`.

Release Notes:

- N/A
2024-06-17 15:52:59 -04:00
Joseph T. Lyons
ff2347dff5
Add events for identifying node projects (#13078)
Release Notes:

- N/A
2024-06-15 00:34:04 -04:00
Max Brunsfeld
af45db6d1e
Fix FS-related issues that were causing a test failure on linux (#13072)
This fixes `project_tests::rescan_and_remote_updates` .

That test was actually correctly failing, revealing two bugs on Linux.

Release Notes:

- Fixed an issue where file renames were not detected on Linux.
- Fixed performance problems caused by excessive file system events on
Linux.

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-06-14 16:03:34 -07:00
Marshall Bowers
6ca09bd4ba
project: Disable project_tests::test_rescan_and_remote_updates on Linux (#13062)
This PR disables the
`project::project_tests::test_rescan_and_remote_updates` test on Linux,
as we've been seeing it fail quite consistently in CI.

We can re-enable it once we've had a chance to investigate and fix.

Release Notes:

- N/A
2024-06-14 14:20:52 -04:00
Conrad Irwin
993109aee1
Fix panic in worktree scanning (#13057)
Release Notes:

- Fixed a panic when worktree paths are incorrectly relative.
2024-06-14 10:23:20 -07:00
Kirill Bulatov
a8481099ca
Prefer the same order of entries inside outline and project panels, project search multi buffer (#13044)
Release Notes:

- N/A
2024-06-14 18:33:36 +03:00
Bennet Bo Fenner
0d8e6e6b12
assistant: Add diagnostics slash command (#12998)
This adds a `diagnostics` command to the assistant which allows to
inject compile errors/warnings into the context.

Release Notes:

- N/A
2024-06-14 17:14:50 +02:00
Piotr Osiewicz
dcb8dc16ca
editor: Update insert_text_format based on resolved completion (#13041)
Fixes #12920

VTSLS does not mark snippet completions as such in the initial
completion response - not until we resolve them; however, we do not
touch initial contents of completion during resolution, which led to us
not treating a snippet as such.

Release Notes:

- Fixed snippet completions sometimes being treated as plain text
completions when using VTSLS
2024-06-14 13:31:02 +02:00
Mikayla Maki
10d3ad4e33
Enable linux tests (#12493)
Note:
- We have disabled all tests that rely on Postgres in the Linux CI. We
only really need to test these once, and as macOS is our team's primary
platform, we'll only enable them on macOS for local reproduction.
- We have disabled all tests that rely on the font metrics. We
standardized on Zed Mono in many fonts, but our CoreText Text System and
Cosmic Text System proved to be very different in effect. We should
revisit if we decide to standardize our text system across platforms
(e.g. using Harfbuzz everywhere)
- Extended the condition timeout significantly. Our CI machines are slow
enough that this is causing spurious errors in random tests.

Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-06-13 16:38:53 -07:00
Piotr Osiewicz
0a13b9ee01
lsp: Provide completion reason in the request (#12893)
This should help LS make a better call about the completions it should
return back to the caller. For example, it speeds up import completions
for typescript.
Before: 


https://github.com/zed-industries/zed/assets/24362066/b38fd565-f9ff-4db7-a87f-c3b31a9fdc96

after: 


https://github.com/zed-industries/zed/assets/24362066/d4fbc9ae-9aab-4543-b9f6-16acf1619576


This should be merged after 06.12 Preview to give it some time on
Nightly.

Release Notes:

- N/A
2024-06-13 14:38:34 +02:00
Piotr Osiewicz
7798f64d1b
chore: Bump lsp-types to 0.97.0 (#12928)
This also includes https://github.com/gluon-lang/lsp-types/pull/287,
which should significantly reduce the time it takes for us to
deserialize completion lists.


Release Notes:
- N/A
2024-06-13 13:48:12 +02:00
Mikayla Maki
80c14c9198
Pull app / OS info out of GPUI, add Linux information, make fallible window initialization (#12869)
TODO:
- [x] Finish GPUI changes on other operating systems 

This is a largely internal change to how we report data to our
diagnostics and telemetry. This PR also includes an update to our blade
backend which allows us to report errors in a more useful way when
failing to initialize blade.


Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-06-11 11:43:12 -07:00
Piotr Osiewicz
b6ea393d14
lsp: Add support for linked editing range edits (HTML tag autorenaming) (#12769)
This PR adds support for [linked editing of
ranges](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_linkedEditingRange),
which in short means that editing one part of a file can now change
related parts in that same file. Think of automatically renaming
HTML/TSX closing tags when the opening one is changed.
TODO:
- [x] proto changes
- [x] Allow disabling linked editing ranges on a per language basis.

Fixes #4535 

Release Notes:
- Added support for linked editing ranges LSP request. Editing opening
tags in HTML/TSX files (with vtsls) performs the same edit on the
closing tag as well (and vice versa). It can be turned off on a language-by-language basis with the following setting:
```
  "languages": {
    "HTML": {
      "linked_edits": true
    },
  }
```

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-06-11 15:52:38 +02:00
Conrad Irwin
4e98c23463
Reconnect button for remote projects (#12669)
Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2024-06-10 18:09:47 -06:00
Max Brunsfeld
e174f16d50
Refactor: Make it possible to share a remote worktree (#12775)
This PR is an internal refactor in preparation for remote editing. It
restructures the public interface of `Worktree`, reducing the number of
call sites that assume that a worktree is local or remote.

* The Project no longer calls `worktree.as_local_mut().unwrap()` in code
paths related to basic file operations
* Fewer code paths in the app rely on the worktree's `LocalSnapshot`
* Worktree-related RPC message handling is more fully encapsulated by
the `Worktree` type.

to do:
* [x] file manipulation operations
* [x] sending worktree updates when sharing

for later
* opening buffers
* updating open buffers upon worktree changes

Release Notes:

- N/A
2024-06-07 12:53:01 -07:00
Joseph T. Lyons
3eac83eece
Add event for yarn project identification (#12785)
Report a `open yarn project` `app_event` for each worktree where
`yarn.lock` is found and only report it once per session.

Release Notes:

- N/A
2024-06-07 14:30:38 -04:00
Stanislav Alekseev
07dbd2bce8
Use rust-analyzer from path if possible (#12418)
Release Notes:

- Added support for looking up the `rust-analyzer` binary in `$PATH`. This allows using such tools as `asdf` and nix to configure per-folder rust installations. To enable this behavior, use the `path_lookup` key when configuring the `rust-analyzer` `binary`: `{"lsp": {"rust-analyzer": {"binary": {"path_lookup": true }}}}`.
2024-06-07 06:56:38 +02:00
Max Brunsfeld
48581167b7
Remove dependencies from the Worktree crate and make it more focused (#12747)
The `worktree` crate mainly provides an in-memory model of a directory
and its git repositories. But because it was originally extracted from
the Project crate, it also contained lingering bits of code that were
outside of that area:
* it had a little bit of logic related to buffers (though most buffer
management lives in `project`)
* it had a *little* bit of logic for storing diagnostics (though the
vast majority of LSP and diagnostic logic lives in `project`)
* it had a little bit of logic for sending RPC message (though the
*receiving* logic for those RPC messages lived in `project`)

In this PR, I've moved those concerns entirely to the project crate
(where they were already dealt with for the most part), so that the
worktree crate can be more focused on its main job, and have fewer
dependencies.

Worktree no longer depends on `client` or `lsp`. It still depends on
`language`, but only because of `impl language::File for
worktree::File`.

Release Notes:

- N/A
2024-06-06 11:16:58 -07:00
Piotr Osiewicz
377e24b798
chore: Fix clippy for upcoming 1.79 Rust release (#12727)
1.79 is due for release in a week.
Release Notes:

- N/A
2024-06-06 12:46:53 +02:00
Conrad Irwin
c7d56302d2
Always open the project panel for dev server projects (#12654)
Release Notes:

- N/A
2024-06-04 16:07:12 -06:00
Conrad Irwin
1c617474fe
Allow restarting remote language servers (#12652)
Release Notes:

- Added the ability to restart the remote language servers when
collaborating
2024-06-04 14:09:01 -06:00
Kirill Bulatov
47122a3115
Fix excluded file creation (#12620)
Fixes https://github.com/zed-industries/zed/issues/10890

* removes `unwrap()` that caused panics for text elements with no text,
remaining after edit state is cleared but project entries are not
updated, having the fake, "new entry"
* improves discoverability of the FS errors during file/directory
creation: now those are shown as workspace notifications
* stops printing anyhow backtraces in workspace notifications, printing
the more readable chain of contexts instead
* better indicates when new entries are created as excluded ones


Release Notes:

- Improve excluded entry creation workflow in the project panel
([10890](https://github.com/zed-industries/zed/issues/10890))
2024-06-04 10:31:43 +03:00
Bennet Bo Fenner
d0fa012bf8
Support formatting unsaved buffers with external formatter (#12597)
Closes #4529


https://github.com/zed-industries/zed/assets/53836821/b84efd5e-89da-4ff7-9a29-2b2f7285d427

Release Notes:

- Added ability to format unsaved buffers with external formatters
([#4529](https://github.com/zed-industries/zed/issues/4529))
2024-06-03 16:32:16 +02:00
Jason Lee
ae55d35f19
windows: Fix project prepare_ssh_shell to support setting PATH on Windows (#12370)
Release Notes:

- N/A

Update to use `std::env::join_paths` to prepare `PATH` env.

Ref
https://github.com/zed-industries/zed/pull/12087#issuecomment-2122852384
@mrnugget

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-06-03 11:57:50 +02:00
Max Brunsfeld
8f942bf647
Use repository mutex more sparingly. Don't hold it while running git status. (#12489)
Previously, each git `Repository` object was held inside of a mutex.
This was needed because libgit2's Repository object is (as one would
expect) not thread safe. But now, the two longest-running git operations
that Zed performs, (`status` and `blame`) do not use libgit2 - they
invoke the `git` executable. For these operations, it's not necessary to
hold a lock on the repository.

In this PR, I've moved our mutex usage so that it only wraps the libgit2
calls, not our `git` subprocess spawns. The main user-facing impact of
this is that the UI is much more responsive when initially opening a
project with a very large git repository (e.g. `chromium`, `webkit`,
`linux`).

Release Notes:

- Improved Zed's responsiveness when initially opening a project
containing a very large git repository.
2024-05-30 09:37:11 -07:00
Kirill Bulatov
0f927fa6fb
One less unwrap (#12448)
Fixes
https://zed-industries.slack.com/archives/C04S6T1T7TQ/p1717011343884699

Release Notes:

- N/A
2024-05-29 23:44:56 +03:00
Antonio Scandurra
66affa969a
Show recently-opened files when autocompleting /file without arguments (#12434)
<img width="1588" alt="image"
src="https://github.com/zed-industries/zed/assets/482957/ea63b046-64d6-419e-8135-4863748b58fa">


Release Notes:

- N/A
2024-05-29 17:46:18 +02:00
Jason Lee
3c6c850390
task: Add re-run task button to terminal title (#12379)
Release Notes:

- Added re-run task button to terminal title.

Close #12277

## Demo


https://github.com/zed-industries/zed/assets/5518/4cd05fa5-4255-412b-8583-68e22f86561e

---------

Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
2024-05-29 11:40:43 +02:00
Antonio Scandurra
7e3ab9acc9
Rework context insertion UX (#12360)
- Confirming a completion now runs the command immediately
- Hitting `enter` on a line with a command now runs it
- The output of commands gets folded away and replaced with a custom
placeholder
- Eliminated ambient context

<img width="1588" alt="image"
src="https://github.com/zed-industries/zed/assets/482957/b1927a45-52d6-4634-acc9-2ee539c1d89a">

Release Notes:

- N/A

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2024-05-27 17:44:54 -06:00
Max Brunsfeld
f7a86967fd
Avoid holding worktree lock for a long time while updating large repos' git status (#12266)
Fixes https://github.com/zed-industries/zed/issues/9575
Fixes https://github.com/zed-industries/zed/issues/4294

### Problem

When a large git repository's `.git` folder changes (due to a `git
commit`, `git reset` etc), Zed needs to recompute the git status for
every file in that git repository. Part of computing the git status is
the *unstaged* part - the comparison between the content of the file and
the version in the git index. In a large git repository like `chromium`
or `linux`, this is inherently pretty slow.

Previously, we performed this git status all at once, and held a lock on
our `BackgroundScanner`'s state for the entire time. On my laptop, in
the `linux` repo, this would often take around 13 seconds.

When opening a file, Zed always refreshes the metadata for that file in
its in-memory snapshot of worktree. This is normally very fast, but if
another task is holding a lock on the `BackgroundScanner`, it blocks.

###  Solution

I've restructured how Zed handles Git statuses, so that when a git
repository is updated, we recompute files' git statuses in fixed-sized
batches. In between these batches, the `BackgroundScanner` is free to
perform other work, so that file operations coming from the main thread
will still be responsive.

Release Notes:

- Fixed a bug that caused long delays in opening files right after
performing a commit in very large git repositories.
2024-05-24 17:41:35 -07:00
Marshall Bowers
82f5f36422
Allow defining slash commands in extensions (#12255)
This PR adds initial support for defining slash commands for the
Assistant from extensions.

Slash commands are defined in an extension's `extension.toml`:

```toml
[slash_commands.gleam-project]
description = "Returns information about the current Gleam project."
requires_argument = false
```

and then executed via the `run_slash_command` method on the `Extension`
trait:

```rs
impl Extension for GleamExtension {
    // ...

    fn run_slash_command(
        &self,
        command: SlashCommand,
        _argument: Option<String>,
        worktree: &zed::Worktree,
    ) -> Result<Option<String>, String> {
        match command.name.as_str() {
            "gleam-project" => Ok(Some("Yayyy".to_string())),
            command => Err(format!("unknown slash command: \"{command}\"")),
        }
    }
}
```

Release Notes:

- N/A
2024-05-24 15:44:32 -04:00
Kirill Bulatov
055a13a9b6
Allow clients to run Zed tasks on remote projects (#12199)
Release Notes:

- Enabled Zed tasks on remote projects with ssh connection string
specified

---------

Co-authored-by: Conrad Irwin <conrad@zed.dev>
2024-05-24 22:26:57 +03:00
Piotr Osiewicz
0eff1eae76
task: Add ZED_DIRNAME and ZED_RELATIVE_FILE task variables (#12245)
Release Notes:

- Added ZED_RELATIVE_FILE (path to current file relative to worktree
root) and ZED_DIRNAME (path to the directory containing current file)
task variables.
2024-05-24 16:04:24 +02:00
Elliot Thomas
b9697fb487
Enable manual worktree organization (#11504)
Release Notes:

- Preserve order of worktrees in project
([#10883](https://github.com/zed-industries/zed/issues/10883)).
- Enable drag-and-drop reordering for project worktrees

Note: worktree order is not synced during collaboration but guests can
reorder their own project panels.

![Reordering
worktrees](https://github.com/zed-industries/zed/assets/1347854/1c63d83c-5d4e-4b55-b840-bfbf32521b2a)

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2024-05-24 12:15:48 +03:00
Remco Smits
1e5389a2be
rust: Add runnable icon for #[cfg(test)] mod tests (#12017)
This allows you to run all the tests inside the `mod tests` block. 
Fixes #11967.

<img width="366" alt="Screenshot 2024-05-18 at 16 07 32"
src="https://github.com/zed-industries/zed/assets/62463826/01fc378c-1546-421d-8250-fe0227c1e5a0">

<img width="874" alt="Screenshot 2024-05-18 at 16 37 21"
src="https://github.com/zed-industries/zed/assets/62463826/4a880b91-df84-4917-a16e-5d5fe20e22ac">

Release Notes:

- Added runnable icon for Rust `#[cfg(test)] mod tests` blocks
([#11967](https://github.com/zed-industries/zed/issues/11967)).
2024-05-24 11:02:23 +02:00
Piotr Osiewicz
58796a8480
tasks: Expose captured variables to ContextProvider (#12134)
This PR changes the interface of ContextProvider, allowing it to inspect
*all* variables set so far during the process of building
`TaskVariables`. This makes it possible to capture e.g. an identifier in
tree-sitter query, process it and then export it as a task variable.

Notably, the list of variables includes captures prefixed with leading
underscore; they are removed after all calls to `build_context`, but it
makes it possible to capture something and then conditionally preserve
it (and perhaps modify it).

Release Notes:

- N/A
2024-05-22 19:45:43 +02:00
Kirill Bulatov
c4e87444e7
Tidy up the code (#12116)
Small follow-ups for https://github.com/zed-industries/zed/pull/12063
and https://github.com/zed-industries/zed/pull/12103

Release Notes:

- N/A
2024-05-22 14:36:15 +03:00
Conrad Irwin
e5b9e2044e
Allow ssh connection for setting up zed (#12063)
Co-Authored-By: Mikayla <mikayla@zed.dev>



Release Notes:

- Magic `ssh` login feature for remote development

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
2024-05-21 22:39:16 -06:00
Thorsten Ball
c290d924f1
Allow formatting of unsaved buffers with prettier (#12095)
This fixes #4529 by allowing unsaved buffers to be formatted with
prettier.

Steps to do that:

1. Create a new buffer
2. Set language for the buffer (e.g.: `language selector: toggle` and
JSON)
3. In settings, set prettier parser for language (can't be inferred,
since we don't have filename) and allow formatting with prettier:

   ```json
   {
     "languages": {
       "JSON": {
         "prettier": {
           "allowed": true,
           "parser": "json"
         }
       }
     }
   }
   ```

4. Use `editor: format`

Release Notes:

- Added ability to format unsaved buffers with Prettier. Requirement is
to set a Prettier parser in the user settings. Example for JSON: `{
"languages": { "JSON": { "prettier": { "allowed": true, "parser": "json"
} } } }` ([#4529](https://github.com/zed-industries/zed/issues/4529)).

Demo:


https://github.com/zed-industries/zed/assets/1185253/d24e490b-2e2c-4a5d-95a8-fc8675523780
2024-05-22 06:19:32 +02:00
Thorsten Ball
b89f360199
lsp: Handle client/unregisterCapability to fix gopls (#12086)
This fixes #10224 by handling `client/unregisterCapability` requests
that have a `workspace/didChangeWatchedFiles` method.

While debugging the issue, I found out that `gopls` seems to block
indefinitely when there's no reply to the `client/unregisterCapability`
request. Even an empty response would fix the issue.

Seems like gopls 15.x and later seem to handle nested subfolders well,
but do not handle unanswered requests.

Instead of replying with an empty response, I decided to change how we
handle file watching and keep a list of all registered paths so that we
can then unregister paths and recreate the glob patterns.

Release Notes:

- Fixed `gopls` not working correctly when the `go.mod` file was in a
subfolder and not the root folder of the project opened in Zed.
([#10224](https://github.com/zed-industries/zed/issues/10224)).
2024-05-21 19:17:29 +02:00
Piotr Osiewicz
0b8c1680fb
html: Add support for autoclosing of tags (#11761)
Fixes #5267 
TODO:
- [x] Publish our fork of vscode-langservers-extracted on GH and wire
that through as a language server of choice for HTML extension.
- [x] Figure out how to prevent edits made by remote participants from
moving the cursor of a host.

Release Notes:

- Added support for autoclosing of HTML tags in local projects.
2024-05-20 17:00:27 +02:00
Kirill Bulatov
8631280baa
Support terminals with ssh in remote projects (#11913)
Release Notes:

- Added a way to create terminal tabs in remote projects, if an ssh
connection string is specified
2024-05-17 17:48:07 +03:00
Marshall Bowers
13bbaf1e18
Use UpdateGlobal accessors in more places (#11925)
This PR updates a number of instances that were previously using
`cx.update_global` to use `UpdateGlobal::update_global` instead.

Release Notes:

- N/A
2024-05-16 13:30:04 -04:00
Thorsten Ball
8c681d0db3
lsp: Use itemDefaults if sent along with completion items (#11902)
This fixes #10532 by properly making use of `itemDefaults.data` when
that is sent along next to completion `items`.

With this line here we tell the language server that we support `data`
in `itemDefaults`, but we actually never checked for it and never used
it:


a0d7ec9f8e/crates/lsp/src/lsp.rs (L653)

In the case of `tailwindcss-language-server` that means that most of the
items it returns (more than 10k items!) were missing the `data`
attribute, since the language server thought it can send it along in the
`itemDefaults` (because we advertised our capability to use it.)

When we then did a `completionItem/resolve`, we would not send a `data`
attribute along, which lead to an error on the
`tailwindcss-language-server` side and thus no documentation.

This PR also adds support for the other `itemDefaults` that could be
sent along and that we say we support:


a0d7ec9f8e/crates/lsp/src/lsp.rs (L650-L653)

`editRange` we handle separately, so this PR only adds the other 3.

Release Notes:

- Fixed documentation not showing up for completion items coming from
`tailwindcss-language-server`.
([#10532](https://github.com/zed-industries/zed/issues/10532)).

Demo:


https://github.com/zed-industries/zed/assets/1185253/bc5ea0b3-7d83-499f-a908-b0d2a1db8a41
2024-05-16 13:26:07 +02:00
Kirill Bulatov
cb430fc3e4
Autodetect parser name with prettier by default (#11558)
Closes https://github.com/zed-industries/zed/issues/11517 

* Removes forced prettier parser name for languages, making `auto`
command to run prettier on every file by default.
* Moves prettier configs away from plugin language declarations into
language settings

Release Notes:

- N/A
2024-05-15 22:51:46 +03:00
Piotr Osiewicz
1db136ff65
tasks: Refresh available tasks in editor when tasks.json changes (#11811)
Release Notes:

- N/A
2024-05-14 21:26:35 +02:00
Thorsten Ball
db89353193
git: Support git repos with .git folder above project root (#11550)
TODOs:

- [x] Add assertions to the test to ensure that the git status is
propagated
- [x] Get collaboration working
- [x] Test opening a git repository inside another git repository
- [x] Test opening the sub-folder of a repository that itself contains
another git repository in a subfolder

Fixes:
- Fixes https://github.com/zed-industries/zed/issues/10154
- Fixes https://github.com/zed-industries/zed/issues/8418
- Fixes https://github.com/zed-industries/zed/issues/8275
- Fixes https://github.com/zed-industries/zed/issues/7816
- Fixes https://github.com/zed-industries/zed/issues/6762
- Fixes https://github.com/zed-industries/zed/issues/4419
- Fixes https://github.com/zed-industries/zed/issues/4672
- Fixes https://github.com/zed-industries/zed/issues/5161

Release Notes:

- Added support for opening subfolders of git repositories and treating
them as part of a repository (show git status in project panel, show git
diff in gutter, git blame works, ...)
([#4672](https://github.com/zed-industries/zed/issues/4672)).

Demo video:


https://github.com/zed-industries/zed/assets/1185253/afc1cdc3-372c-404e-99ea-15708589251c
2024-05-14 18:34:51 +02:00
Piotr Osiewicz
95e0d5ed74
tasks: Reorganize task modal (#11752)
![image](https://github.com/zed-industries/zed/assets/24362066/bc7cc3d3-d9fc-4be6-b9b6-e3d8edf5b533)

Release Notes:
- Improved tasks modal by highlighting a distinction between a task
template and concrete task instance and surfacing available keybindings
more prominently. Task templates are now always available in the modal,
even if there's already a history entry with the same label.
- Changed default key binding for "picker::UseSelectedQuery" to `opt-e`.
2024-05-14 11:22:09 +02:00
Conrad Irwin
5515ba6043
Extract http from util (#11680)
This avoids the CLI linking libssl etc...

Release Notes:

- N/A
2024-05-10 15:50:20 -06:00
Thorsten Ball
df190ea846
vcs menu: Use project's repositories, do not open directly (#11652)
I ran into this when trying to get #11550 working: the VCS menu would
open repositories on its owned, based on paths, instead of going through
the worktree on which we already store the git repositories.



Release Notes:

- N/A
2024-05-10 11:06:32 +02:00