Commit Graph

363 Commits

Author SHA1 Message Date
Kirill Bulatov
882cd6e52f
Revert "Bump tree-sitter, wasmtime (#8306)" (#8373)
This reverts commit d4973846c0.

Fixes https://github.com/zed-industries/zed/issues/8360 and
https://github.com/zed-industries/zed/issues/8362


Release Notes:

- N/A
2024-02-25 10:35:19 +02:00
Marshall Bowers
401798d9b8
Remove unused plugin crates (#8350)
This PR removes the unused crates for plugin support.

We're currently exploring Wasm-based extensions, and it's unlikely that
we'll be reusing any of this existing work.

Release Notes:

- N/A
2024-02-24 19:05:18 -05:00
Max Brunsfeld
d4973846c0
Bump tree-sitter, wasmtime (#8306)
Fixes
https://github.com/zed-industries/zed/issues/8296#issuecomment-1961957369

Release Notes:

- Fixed a crash that would happen when loading an extension that added a
grammar that was generated using a very old version of Tree-sitter
([#8296](https://github.com/zed-industries/zed/issues/8296)).

---------

Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>
2024-02-24 14:24:29 -08:00
Bennet Bo Fenner
dc7e14f888
Respect user preferences when formatting timestamp (#7994)
This is a follow up to #7945. The current behaviour reads the locale and
infers from that which type of time format should be used (12 hour/24
hour).
However, in macOS you can override this behaviour, e.g. you can use
en_US locale but still use the 24 hour clock format (Can be customized
under Settings > General > Date & Format > 24-hour time). You can even
customize the date format.

This PR uses the macOS specific `CFDateFormatter` API, which outputs
time format strings, that respect those settings.

Partially fixes #7956 (as its not implemented for linux)

Release Notes:

- Added localization support for all macOS specific date and time
configurations in chat
2024-02-23 19:18:06 -07:00
Conrad Irwin
0fbd0d6649
collab: Log HTTP requests (#8297)
Co-Authored-By: Marshall <marshall@zed.dev>



Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-02-23 14:50:06 -05:00
Conrad Irwin
f19ab464c7
Add telemetry events backend for collab (#8220)
Send telemetry to collab not zed.dev

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-02-23 11:13:28 -05:00
Piotr Osiewicz
0f584cb353
chore: Extract languages from zed crate (#8270)
- Moves languages module from `zed` into a separate crate. That way we
have less of a long pole at the end of compilation.
- Removes moot dependencies on editor/picker. This is totally harmless
and might help in the future if we decide to decouple picker from
editor.

Before:
```
Number of crates that depend on 'picker' but not on 'editor': 1
Total number of crates that depend on 'picker': 13
Total number of crates that depend on 'editor': 30
```
After:
```
Number of crates that depend on 'picker' but not on 'editor': 5
Total number of crates that depend on 'picker': 12
Total number of crates that depend on 'editor': 26
```
The more crates depend on just picker but not editor, the better in that
case.

Release Notes:

- N/A
2024-02-23 15:56:08 +01:00
Thorsten Ball
42ac9880c6
Detect and possibly use user-installed gopls / zls language servers (#8188)
After a lot of back-and-forth, this is a small attempt to implement
solutions (1) and (3) in
https://github.com/zed-industries/zed/issues/7902. The goal is to have a
minimal change that helps users get started with Zed, until we have
extensions ready.

Release Notes:

- Added detection of user-installed `gopls` to Go language server
adapter. If a user has `gopls` in `$PATH` when opening a worktree, it
will be used.
- Added detection of user-installed `zls` to Zig language server
adapter. If a user has `zls` in `$PATH` when opening a worktree, it will
be used.

Example:

I don't have `go` installed globally, but I do have `gopls`:

```
~ $ which go
go not found
~ $ which gopls
/Users/thorstenball/code/go/bin/gopls
```

But I do have `go` in a project's directory:

```
~/tmp/go-testing φ which go
/Users/thorstenball/.local/share/mise/installs/go/1.21.5/go/bin/go
~/tmp/go-testing φ which gopls
/Users/thorstenball/code/go/bin/gopls
```

With current Zed when I run `zed ~/tmp/go-testing`, I'd get the dreaded
error:

![screenshot-2024-02-23-11 14
08@2x](https://github.com/zed-industries/zed/assets/1185253/822ea59b-c63e-4102-a50e-75501cc4e0e3)

But with the changes in this PR, it works:

```
[2024-02-23T11:14:42+01:00 INFO  language::language_registry] starting language server "gopls", path: "/Users/thorstenball/tmp/go-testing", id: 1
[2024-02-23T11:14:42+01:00 INFO  language::language_registry] found user-installed language server for Go. path: "/Users/thorstenball/code/go/bin/gopls", arguments: ["-mode=stdio"]
[2024-02-23T11:14:42+01:00 INFO  lsp] starting language server. binary path: "/Users/thorstenball/code/go/bin/gopls", working directory: "/Users/thorstenball/tmp/go-testing", args: ["-mode=stdio"]
```

---------

Co-authored-by: Antonio <antonio@zed.dev>
2024-02-23 13:39:14 +01:00
postsolar
65318cb6ac
Re-enable PureScript on Linux and Windows (#8252)
Relevant PRs:
- https://github.com/zed-industries/zed/pull/7543
- https://github.com/zed-industries/zed/pull/7827

Release Notes:

- Fixed build issues with PureScript on Windows and Linux
2024-02-23 13:19:36 +02:00
Dzmitry Malyshau
991c9ec441
Integrate profiling into gpui (#8176)
[Profiling](https://crates.io/crates/profiling) crate allows easy
integration with various profiler tools. The best thing is - annotations
compile to nothing unless you request a specific feature.

For example, I used this command to enable Tracy support:
```bash
cargo run --features profiling/profile-with-tracy
```
At the same time I had Tracy tool open and waiting for connection. It
gathered nice stats from the run:

![zed-profiler](https://github.com/zed-industries/zed/assets/107301/5233045d-078c-4ad8-8b00-7ae55cf94ebb)


Release Notes:
- N/A
2024-02-22 10:59:52 -08:00
Kirill Bulatov
2679457b02
Rename runnables into tasks (#8119)
Release Notes:

- N/A
2024-02-21 14:56:43 +02:00
Darren Schroeder
91b97387b6
bump tree-sitter-nu to latest (#8059)
This PR bumps the tree-sitter-nu commit to the latest supported by the
nushell team. It also includes the latest highlights.scm

Release Notes:

Bumped `nu` tree sitter dependency and highlights.scm
2024-02-20 12:05:09 -05:00
Bennet Bo Fenner
3ef8a9910d
chat: auto detect links (#8028)
@ConradIrwin here's our current implementation for auto detecting links
in the chat.
We also fixed an edge case where the close reply to preview button was
cut off (rendered off screen).

Release Notes:

- Added auto detection for links in the chat panel.

---------

Co-authored-by: Remco Smits <62463826+RemcoSmitsDev@users.noreply.github.com>
2024-02-19 21:49:47 -07:00
白山風露
0037f0b2fd
Avoid dependencies build errors on Windows (#7827)
This is a compilation of fixes for errors that appeared in dependent
crates in Windows.

- wezterm (zed-industries/wezterm#1)
- tree-sitter-svelte (Himujjal/tree-sitter-svelte#54)
- tree-sitter-uiua (shnarazk/tree-sitter-uiua#25)
- tree-sitter-haskell (I sent a PR, but upstream source is regenerated
and no longer errors.)

Release Notes:

- N/A
2024-02-19 16:44:24 -08:00
Abdullah Alsigar
f4bafd5899
Dart support (#7220)
This is my first contribution, feedback is welcome.

Release Notes:

- Added Dart language support
([#5343](https://github.com/zed-industries/zed/issues/5343)).
2024-02-19 11:10:08 -08:00
Piotr Osiewicz
f17d0b5729
Add static Runnables (#8009)
Part of #7108

This PR includes just the static runnables part. We went with **not**
having a dedicated panel for runnables.
This is just a 1st PR out of N, as we want to start exploring the
dynamic runnables front. Still, all that work is going to happen once
this gets merged.

Release Notes:

- Added initial, static Runnables support to Zed. Such runnables are defined in
`runnables.json` file (accessible via `zed: open runnables` action) and
they can be spawned with `runnables: spawn` action.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Pitor <pitor@zed.dev>
Co-authored-by: Beniamin <beniamin@zagan.be>
2024-02-19 18:41:43 +02:00
d1y
12b12ba17a
Add syntax highlighting and LSP for Dockerfiles(#6905) (#7977)
Release Notes:

- Added Dockerfile syntax highlighting and LSP support

---------

Co-authored-by: Bryce Palmer <bpalmer@redhat.com>
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2024-02-18 20:44:54 +02:00
Marshall Bowers
b91d6da6b6
Remove Beancount as a built-in language (#7934)
This PR removes Beancount as a built-in language, as it is now available
as an [extension](https://github.com/zed-extensions/beancount).

Release Notes:

- Removed built-in support for Beancount, as it is now provided by an
[extension](https://github.com/zed-extensions/beancount).
2024-02-18 09:58:12 -05:00
evrsen
98ffdca32e
Add locale-based time formatting in the chat panel (#7945)
This commit addresses the issue of time formats displayed in the chat
panel. Previously, the time was always displayed in a 12-hour format,
regardless of the user's locale. The `format_timestamp` function has
been updated to check the system locale and format the time accordingly.


Release Notes:
- Fixed time formatting in the chat panel to be locale based.
2024-02-17 08:44:28 -07:00
Marshall Bowers
3cbc18895a
Upgrade toml to v0.8 (#7931)
This PR upgrades our `toml` dependency to v0.8.

I noticed that our current version of `toml` wasn't able to parse
certain kinds of documents involving enums, whereas the newer version
can.

Release Notes:

- N/A
2024-02-16 17:43:40 -05:00
Dzmitry Malyshau
9ad1862f2f
Enable Blade on MacOS via "macos-blade" feature (#7669)
Depends on https://github.com/zed-industries/font-kit/pull/2 and
https://github.com/kvark/blade/pull/77

This change enables Blade to be also used on MacOS. It will also make it
easier to use it on Windows.

What works: most of the things. Zed loads as fast and appears equally
responsive to the current renderer.
<img width="306" alt="Screenshot 2024-02-11 at 12 09 15 AM"
src="https://github.com/zed-industries/zed/assets/107301/66d82f45-5ea2-4e2b-86c6-5b3ed333c827">

Things missing:
- [x] video streaming. ~~Requires a bit of plumbing on both Blade and
Zed sides, but all fairly straightforward.~~
  -  verified with a local setup
- [x] resize. ~~Not sure where exactly to hook up the reaction on the
window size change. Once we know where, the fix is one line.~~
- [ ] fine-tune CA Layer
- this isn't a blocker for merging the PR, but it would be a blocker if
we wanted to switch to the new path by default
- [ ] rebase on latest, get the dependency merged (need review/merge of
https://github.com/zed-industries/font-kit/pull/2!)

Update: I implemented resize support as well as "surface" rendering on
the Blade path (which will be useful on Linux/Windows later on). I
haven't tested the latter though - not sure how to get something
streaming. Would appreciate some help! I don't think this should be a
blocker to this PR, anyway.

The only little piece that's missing for the Blade on MacOS path to be
full-featured is fine-tuning the CALayer configuration. Zed does a lot
of careful logic in configuring the layer, such as switching the
"present with transaction" on/off intermittently, which Blade path
doesn't have yet.

Release Notes:
- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-02-16 13:39:40 -08:00
Marshall Bowers
ab6b9196e1
Fix Cargo.toml formatting (#7886)
This PR disables the formatting for `.toml` files within the Zed repo,
as the formatter provided by the TOML language server messes things up.

Release Notes:

- N/A
2024-02-15 21:54:43 -05:00
Max Brunsfeld
e1ae0d46da
Add an extensions API to the collaboration server (#7807)
This PR adds a REST API to the collab server for searching and
downloading extensions. Previously, we had implemented this API in
zed.dev directly, but this implementation is better, because we use the
collab database to store the download counts for extensions.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Conrad <conrad@zed.dev>
2024-02-15 12:53:57 -08:00
Piotr Osiewicz
75eac4783b
gpui: patch pathfinder_simd to fix nightly build, bump ahash for the … (#7770)
…same reason

Fixes #7644 

Release Notes:

- N/A
2024-02-14 12:55:31 +01:00
Carlos Lopez
fecb5a82f1
Add an extensions installation view (#7689)
This PR adds a view for installing extensions within Zed.

My subtasks:

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

Open to collab!

Release Notes:

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

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Carlos <foxkdev@gmail.com>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Max <max@zed.dev>
2024-02-13 14:09:02 -05:00
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
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
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
Mikayla
3a53db6502
Merge branch 'main' into kvark-linux 2024-02-07 12:30:36 -08:00
Max Brunsfeld
6edeea7c8a
Add logic for managing language and theme extensions (#7467)
This PR adds the initial support for loading extensions in Zed.

### Extensions Directory

Extensions are loaded from the extensions directory.

The extensions directory has the following structure:

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

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

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

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-07 15:14:50 -05:00
Mikayla
67555ee5b4
Merge branch 'main' into kvark-linux 2024-02-07 11:52:44 -08:00
Mikayla
3734a390b2
Mark TODOs and prep for merging main 2024-02-07 11:39:26 -08:00
Piotr Osiewicz
743f9b345f
chore: Move workspace dependencies to workspace.dependencies (#7454)
We should prefer referring to local deps via `.workspace = true` from
now on.

Release Notes:

- N/A
2024-02-06 20:41:36 +01:00
Caius Durling
6863b9263e
Add Terraform & HCL syntax highlighting (#6882)
Terraform and HCL are almost the same language, but not quite so
proposing them as separate languages within Zed. (Terraform is an
extension of HCL, with a different formatter.)

This is just adding the language definition, parsing and highlighting
functionality, not any LSP or formatting beyond that for either
language.

I've taken a bunch of inspiration from Neovim for having the separate
languages, and also lifted some of their `scm` files (with attribution
comments in this codebase) as the tree-sitter repo doesn't contain them.
(Neovim's code is Apache-2.0 licensed, so should be fine here with
attribution from reading Zed's licenses files.) I've then amended to
make sure the capture groups are named for things Zed understands. I'd
love someone from Zed to confirm that's okay, or if I should clean-room
implement the `scm` files.

Highlighting in Terraform & HCL with a moderate amount of syntax in a
file (Terraform on left, HCL on right.)

<img width="1392" alt="Screenshot 2024-01-31 at 18 07 45"
src="https://github.com/zed-industries/zed/assets/696/1d3c9a08-588e-4b8f-ad92-98ce1e419659">

Release Notes:

- (|Improved) ...
([#5098](https://github.com/zed-industries/zed/issues/5098)).
2024-02-05 11:38:30 -08:00
Conrad Irwin
e2e8e52ec4
Beancount syntax highlighting (#7389)
Release Notes:

- Added syntax highlighting for [Beancount](https://beancount.github.io)
2024-02-05 11:07:26 -07:00
Dzmitry Malyshau
59642bf29a blade: point to master, remove the override 2024-02-03 14:13:36 -08:00
Rashid Almheiri
998f6cf80d
Add OCaml support (#6929)
This pull request implements support for the [OCaml
Language](https://ocaml.org/).

### Additions
- [x]
[tree-sitter-ocaml](https://github.com/tree-sitter/tree-sitter-ocaml)
grammar
- [x] Highlight, Indents, Outline queries
- [x] A new file icon for .ml(i) files. Based on
[ocaml/ocaml-logo](https://github.com/ocaml/ocaml-logo/blob/master/Colour/SVG/colour-transparent-icon.svg)
- [x] LSP Integration with
[ocaml-language-server](https://github.com/ocaml/ocaml-lsp)
- [x] Completion Labels
- [x] Symbol Labels

### Bug Fixes
- [x] Improper parsing of LSP headers. 

### Missing [will file a separate issue]
- Documentation on completionItem, requires: `completionItem/resolve`
with support for `documentation` as a provider.

### Screenshots

<details><summary>Zed</summary>
<img width="1800" alt="Screenshot 2024-02-01 at 03 33 20"
src="https://github.com/zed-industries/zed/assets/69181766/e17c184e-203e-40c3-a08f-4de46226b79c">
</details>

Release Notes:
- Added OCaml Support
([#5316](https://github.com/zed-industries/zed/issues/5316)).

> [!NOTE]
> Partially completes #5316 
> To complete #5316:
> 1. addition of a reason tree-sitter grammar.
> 2. opam/esy integration, however it may be better as it's own plugin.
2024-02-02 16:58:07 +02:00
Dzmitry Malyshau
666b134d20 linux: shadow rendering 2024-02-01 21:43:28 -08:00
Dzmitry Malyshau
8aa768765f linux: basic quad renderer logic 2024-02-01 21:41:15 -08:00
Dzmitry Malyshau
ef4ef5f0e8 Add blade dependency 2024-02-01 21:27:43 -08:00
Dairon M
97be0a930c
Add syntax highlighting and LSP (erlang_lsp) for Erlang (#7093)
This pull request implements support for the [Erlang
Language](https://erlang.org/).

**It adds:**

* [tree-sitter-erlang](https://github.com/WhatsApp/tree-sitter-erlang)
grammar
highlights (Licensed under Apache-2 from WhatsApp which is compatible
with Zed licensing model), folds and indents
* Erlang file icon based on the [official
one](https://www.erlang.org/doc/erlang-logo.png)
* [erlang_ls](https://github.com/erlang-ls/erlang_ls) support

Fixes https://github.com/zed-industries/zed/issues/4939, possibly a
duplicate of https://github.com/zed-industries/zed/pull/7085 with more
features. Suppose @wingyplus wants to join efforts here.

**To complete (out of scope for this PR):**

* Support for the ELP language server from WhatsApp. CC @robertoaloi
* Better indentation handling, need something like
`indentNextLinePattern` in VS Code

**Screenshots:**

![Screenshot 2024-01-30 at 11 03 51
AM](https://github.com/zed-industries/zed/assets/168440/5289c245-9edd-46b8-b443-d7b3210f6510)
![Screenshot 2024-01-30 at 11 01 19
AM](https://github.com/zed-industries/zed/assets/168440/bd22b322-5344-44e6-b5f7-6e352fb3deef)
![Screenshot 2024-01-30 at 11 01 37
AM](https://github.com/zed-industries/zed/assets/168440/f28f6a15-383e-4719-8a87-fceae5062436)
![Screenshot 2024-01-30 at 11 02 03
AM](https://github.com/zed-industries/zed/assets/168440/980d5213-0367-4a08-86eb-5743dfa628eb)
![Screenshot 2024-01-30 at 11 02 19
AM](https://github.com/zed-industries/zed/assets/168440/ea998891-604d-48d6-929f-ae4c1bb3fae1)

Outline: 
![Screenshot 2024-01-31 at 9 09 36
AM](https://github.com/zed-industries/zed/assets/168440/46d56d94-21c3-414d-84fb-9251fa2506ab)



**Release Notes:**

* Added Erlang Support
([7093](https://github.com/zed-industries/zed/pull/7093)).

---------

Signed-off-by: Thanabodee Charoenpiriyakij <wingyminus@gmail.com>
Co-authored-by: Thanabodee Charoenpiriyakij <wingyminus@gmail.com>
2024-02-01 18:54:26 +02:00
Kieran Gill
8bafc61ef5
Add initial markdown preview to Zed (#6958)
Adds a "markdown: open preview" action to open a markdown preview.

https://github.com/zed-industries/zed/assets/18583882/6fd7f009-53f7-4f98-84ea-7dd3f0dd11bf


This PR extends the work done in `crates/rich_text` to render markdown
to also support:

- Variable heading sizes
- Markdown tables
- Code blocks
- Block quotes

## Release Notes

- Added `Markdown: Open preview` action to partially close
([#6789](https://github.com/zed-industries/zed/issues/6789)).

## Known issues that will not be included in this PR

- Images.
- Nested block quotes.
- Footnote Reference.
- Headers highlighting.
- Inline code highlighting (this will need to be implemented in
`rich_text`)
- Checkboxes (`- [ ]` and `- [x]`)
- Syntax highlighting in code blocks.
- Markdown table text alignment.
- Inner markdown URL clicks
2024-02-01 11:03:09 +02:00
d1y
5d85801d1f
Add highlighting for go.work (#7142)
<img width="617" alt="image"
src="https://github.com/zed-industries/zed/assets/45585937/ecb28152-db02-450e-bc81-395abd1c1eef">

Release Notes:

- Added  highlighting for go.work
2024-01-31 12:11:03 -07:00
d1y
b7ced3943e
Add highlighting for git_commit (#7147)
https://github.com/zed-industries/zed/assets/45585937/32cf5622-e960-4775-986d-bcfd30c81098

Release Notes:

- Added highlighting for git_commit
2024-01-31 09:41:19 -08:00
Marshall Bowers
8c8a5ad275
Make theme parsing more lenient (#7154)
This PR improves the theme parsing to be a bit more lenient, allowing
things like comments and trailing commas in theme files.

Release Notes:

- N/A
2024-01-31 11:05:22 -05:00
Derrick Laird
ba91adf48a
languages: add highlighting for go.mod (#7137)
Release Notes:

- Added syntax highlighting for go.mod files. Fixes #7133 

<img width="863" alt="image"
src="https://github.com/zed-industries/zed/assets/8725798/dc521a02-c53a-44aa-b0c1-eebf31835679">
2024-01-31 08:46:13 +01:00
Max Brunsfeld
9459394ea0
Re-enable language plugin functionality with some fixes (#7105)
Part of https://github.com/zed-industries/zed/issues/7096

* [x] Load all queries for language plugins, not just highlight query
* [x] Auto-reload languages when changing the `plugins` directory
* [x] Bump Tree-sitter for language loading and unloading fixes
* [x] Figure out code signing

Release Notes:

- N/A

---------

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-01-30 19:59:13 -08:00
Marshall Bowers
e338f34097
Sort dependencies in Cargo.toml files (#7126)
This PR sorts the dependency lists in our `Cargo.toml` files so that
they are in alphabetical order.

This should make them easier to visually scan when looking for a
dependency.

Apologies in advance for any merge conflicts 🙈 

Release Notes:

- N/A
2024-01-30 21:41:29 -05:00
Marshall Bowers
176f63e86e
Add ability to copy a permalink to a line (#7119)
This PR adds the ability to copy the permalink to a line from within
Zed.

This functionality is available through the `editor: copy permalink to
line` action in the command palette:

<img width="589" alt="Screenshot 2024-01-30 at 7 07 46 PM"
src="https://github.com/zed-industries/zed/assets/1486634/332282cb-211f-4f16-9eb1-415bcfee9b7b">

Executing this action will create a permalink to the currently selected
line(s) and copy it to the clipboard.

Here is an example line:

```
56c80e8011/src/lib.rs (L25)
```

Currently, both GitHub and GitLab are supported.

### Notes and known limitations

- In order to determine where to permalink to, we read the URL of the
`origin` remote in Git. This feature will not work if the `origin`
remote is not present.
- Attempting to permalink to a ref that is not pushed to the origin will
result in the link 404ing.
- Attempting to permalink when Git is in a dirty state may not generate
the right link.
- For instance, modifying a file (e.g., adding new lines) and grabbing a
permalink to it will result in incorrect line numbers.

Release Notes:

- Added the ability to copy a permalink to a line
([#6777](https://github.com/zed-industries/zed/issues/6777)).
- Available via the `editor: copy permalink to line` action in the
command palette.
2024-01-30 19:20:15 -05:00
Piotr Osiewicz
e6ebe7974d
gpui: Add Global marker trait (#7095)
This should prevent a class of bugs where one queries the wrong type of
global, which results in oddities at runtime.

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-01-30 14:08:20 -05:00