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: ``` https://github.com/maxdeviant/auk/blob/56c80e80112744740be1969c89fdd34db4be6f64/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.
57 lines
1.5 KiB
TOML
57 lines
1.5 KiB
TOML
[package]
|
|
name = "client"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
publish = false
|
|
license = "GPL-3.0-or-later"
|
|
|
|
[lib]
|
|
path = "src/client.rs"
|
|
doctest = false
|
|
|
|
[features]
|
|
test-support = ["collections/test-support", "gpui/test-support", "rpc/test-support"]
|
|
|
|
[dependencies]
|
|
chrono = { version = "0.4", features = ["serde"] }
|
|
collections = { path = "../collections" }
|
|
db = { path = "../db" }
|
|
gpui = { path = "../gpui" }
|
|
util = { path = "../util" }
|
|
release_channel = { path = "../release_channel" }
|
|
rpc = { path = "../rpc" }
|
|
text = { path = "../text" }
|
|
settings = { path = "../settings" }
|
|
feature_flags = { path = "../feature_flags" }
|
|
sum_tree = { path = "../sum_tree" }
|
|
|
|
anyhow.workspace = true
|
|
async-recursion = "0.3"
|
|
async-tungstenite = { version = "0.16", features = ["async-tls"] }
|
|
futures.workspace = true
|
|
image = "0.23"
|
|
lazy_static.workspace = true
|
|
log.workspace = true
|
|
parking_lot.workspace = true
|
|
postage.workspace = true
|
|
rand.workspace = true
|
|
schemars.workspace = true
|
|
serde.workspace = true
|
|
serde_derive.workspace = true
|
|
serde_json.workspace = true
|
|
smol.workspace = true
|
|
sysinfo.workspace = true
|
|
tempfile = "3"
|
|
thiserror.workspace = true
|
|
time.workspace = true
|
|
tiny_http = "0.8"
|
|
uuid.workspace = true
|
|
url.workspace = true
|
|
|
|
[dev-dependencies]
|
|
collections = { path = "../collections", features = ["test-support"] }
|
|
gpui = { path = "../gpui", features = ["test-support"] }
|
|
rpc = { path = "../rpc", features = ["test-support"] }
|
|
settings = { path = "../settings", features = ["test-support"] }
|
|
util = { path = "../util", features = ["test-support"] }
|