Merge branch 'main' into in-app-feedback

This commit is contained in:
Joseph Lyons 2023-01-23 18:24:12 -05:00
commit 8e8f66a5e1
69 changed files with 246 additions and 61 deletions

View file

@ -41,16 +41,19 @@ jobs:
with: with:
clean: false clean: false
submodules: 'recursive' submodules: 'recursive'
- name: Run tests - name: Run tests
run: cargo test --workspace --no-fail-fast run: cargo test --workspace --no-fail-fast
- name: Build collab - name: Build collab
run: cargo build -p collab run: cargo build -p collab
- name: Build other binaries - name: Build other binaries
run: cargo build --workspace --bins --all-features run: cargo build --workspace --bins --all-features
- name: Generate license file
run: script/generate-licenses
bundle: bundle:
name: Bundle app name: Bundle app
runs-on: runs-on:
@ -109,6 +112,9 @@ jobs:
exit 1 exit 1
fi fi
- name: Generate license file
run: script/generate-licenses
- name: Create app bundle - name: Create app bundle
run: script/bundle run: script/bundle

1
.gitignore vendored
View file

@ -9,6 +9,7 @@
/assets/themes/*.json /assets/themes/*.json
/assets/themes/Internal/*.json /assets/themes/Internal/*.json
/assets/themes/Experiments/*.json /assets/themes/Experiments/*.json
/assets/licenses.md
**/venv **/venv
.build .build
Packages Packages

View file

@ -2,6 +2,7 @@
name = "activity_indicator" name = "activity_indicator"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/activity_indicator.rs" path = "src/activity_indicator.rs"

View file

@ -2,6 +2,7 @@
name = "assets" name = "assets"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/assets.rs" path = "src/assets.rs"

View file

@ -2,6 +2,7 @@
name = "auto_update" name = "auto_update"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/auto_update.rs" path = "src/auto_update.rs"

View file

@ -2,6 +2,7 @@
name = "breadcrumbs" name = "breadcrumbs"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/breadcrumbs.rs" path = "src/breadcrumbs.rs"

View file

@ -2,6 +2,7 @@
name = "call" name = "call"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/call.rs" path = "src/call.rs"

View file

@ -2,6 +2,7 @@
name = "cli" name = "cli"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/cli.rs" path = "src/cli.rs"

View file

@ -9,7 +9,13 @@ use core_foundation::{
use core_services::{kLSLaunchDefaults, LSLaunchURLSpec, LSOpenFromURLSpec, TCFType}; use core_services::{kLSLaunchDefaults, LSLaunchURLSpec, LSOpenFromURLSpec, TCFType};
use ipc_channel::ipc::{IpcOneShotServer, IpcReceiver, IpcSender}; use ipc_channel::ipc::{IpcOneShotServer, IpcReceiver, IpcSender};
use serde::Deserialize; use serde::Deserialize;
use std::{ffi::OsStr, fs, path::PathBuf, ptr}; use std::{
ffi::OsStr,
fs::{self, OpenOptions},
io,
path::{Path, PathBuf},
ptr,
};
#[derive(Parser)] #[derive(Parser)]
#[clap(name = "zed", global_setting(clap::AppSettings::NoAutoVersion))] #[clap(name = "zed", global_setting(clap::AppSettings::NoAutoVersion))]
@ -54,6 +60,12 @@ fn main() -> Result<()> {
return Ok(()); return Ok(());
} }
for path in args.paths.iter() {
if !path.exists() {
touch(path.as_path())?;
}
}
let (tx, rx) = launch_app(bundle_path)?; let (tx, rx) = launch_app(bundle_path)?;
tx.send(CliRequest::Open { tx.send(CliRequest::Open {
@ -77,6 +89,13 @@ fn main() -> Result<()> {
Ok(()) Ok(())
} }
fn touch(path: &Path) -> io::Result<()> {
match OpenOptions::new().create(true).write(true).open(path) {
Ok(_) => Ok(()),
Err(e) => Err(e),
}
}
fn locate_bundle() -> Result<PathBuf> { fn locate_bundle() -> Result<PathBuf> {
let cli_path = std::env::current_exe()?.canonicalize()?; let cli_path = std::env::current_exe()?.canonicalize()?;
let mut app_path = cli_path.clone(); let mut app_path = cli_path.clone();

View file

@ -2,6 +2,7 @@
name = "client" name = "client"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/client.rs" path = "src/client.rs"

View file

@ -2,6 +2,7 @@
name = "clock" name = "clock"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/clock.rs" path = "src/clock.rs"

View file

@ -4,6 +4,7 @@ default-run = "collab"
edition = "2021" edition = "2021"
name = "collab" name = "collab"
version = "0.5.3" version = "0.5.3"
publish = false
[[bin]] [[bin]]
name = "collab" name = "collab"

View file

@ -2,6 +2,7 @@
name = "collab_ui" name = "collab_ui"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/collab_ui.rs" path = "src/collab_ui.rs"

View file

@ -2,6 +2,7 @@
name = "collections" name = "collections"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/collections.rs" path = "src/collections.rs"

View file

@ -2,6 +2,7 @@
name = "command_palette" name = "command_palette"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/command_palette.rs" path = "src/command_palette.rs"

View file

@ -2,6 +2,7 @@
name = "context_menu" name = "context_menu"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/context_menu.rs" path = "src/context_menu.rs"

View file

@ -2,6 +2,7 @@
name = "db" name = "db"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/db.rs" path = "src/db.rs"

View file

@ -2,6 +2,7 @@
name = "diagnostics" name = "diagnostics"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/diagnostics.rs" path = "src/diagnostics.rs"

View file

@ -2,6 +2,7 @@
name = "drag_and_drop" name = "drag_and_drop"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/drag_and_drop.rs" path = "src/drag_and_drop.rs"

View file

@ -2,6 +2,7 @@
name = "editor" name = "editor"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/editor.rs" path = "src/editor.rs"

View file

@ -2,6 +2,7 @@
name = "file_finder" name = "file_finder"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/file_finder.rs" path = "src/file_finder.rs"

View file

@ -2,6 +2,7 @@
name = "fs" name = "fs"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/fs.rs" path = "src/fs.rs"

View file

@ -3,6 +3,7 @@ name = "fsevent"
version = "2.0.2" version = "2.0.2"
license = "MIT" license = "MIT"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/fsevent.rs" path = "src/fsevent.rs"

View file

@ -2,6 +2,7 @@
name = "fuzzy" name = "fuzzy"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/fuzzy.rs" path = "src/fuzzy.rs"

View file

@ -2,6 +2,7 @@
name = "git" name = "git"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/git.rs" path = "src/git.rs"

View file

@ -2,6 +2,7 @@
name = "go_to_line" name = "go_to_line"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/go_to_line.rs" path = "src/go_to_line.rs"

View file

@ -4,6 +4,7 @@ edition = "2021"
name = "gpui" name = "gpui"
version = "0.1.0" version = "0.1.0"
description = "A GPU-accelerated UI framework" description = "A GPU-accelerated UI framework"
publish = false
[lib] [lib]
path = "src/gpui.rs" path = "src/gpui.rs"

View file

@ -2,6 +2,7 @@
name = "gpui_macros" name = "gpui_macros"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/gpui_macros.rs" path = "src/gpui_macros.rs"

View file

@ -2,6 +2,7 @@
name = "journal" name = "journal"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/journal.rs" path = "src/journal.rs"

View file

@ -2,6 +2,7 @@
name = "language" name = "language"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/language.rs" path = "src/language.rs"

View file

@ -3,6 +3,7 @@ name = "live_kit_client"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
description = "Bindings to LiveKit Swift client SDK" description = "Bindings to LiveKit Swift client SDK"
publish = false
[lib] [lib]
path = "src/live_kit_client.rs" path = "src/live_kit_client.rs"

View file

@ -3,6 +3,7 @@ name = "live_kit_server"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
description = "SDK for the LiveKit server API" description = "SDK for the LiveKit server API"
publish = false
[lib] [lib]
path = "src/live_kit_server.rs" path = "src/live_kit_server.rs"

View file

@ -2,6 +2,7 @@
name = "lsp" name = "lsp"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/lsp.rs" path = "src/lsp.rs"

View file

@ -2,6 +2,7 @@
name = "media" name = "media"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/media.rs" path = "src/media.rs"

View file

@ -2,6 +2,7 @@
name = "menu" name = "menu"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/menu.rs" path = "src/menu.rs"

View file

@ -2,6 +2,7 @@
name = "outline" name = "outline"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/outline.rs" path = "src/outline.rs"

View file

@ -2,6 +2,7 @@
name = "picker" name = "picker"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/picker.rs" path = "src/picker.rs"

View file

@ -2,6 +2,7 @@
name = "plugin" name = "plugin"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[dependencies] [dependencies]
serde = "1.0" serde = "1.0"

View file

@ -2,6 +2,7 @@
name = "plugin_macros" name = "plugin_macros"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
proc-macro = true proc-macro = true

View file

@ -2,6 +2,7 @@
name = "plugin_runtime" name = "plugin_runtime"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[dependencies] [dependencies]
wasmtime = "0.38" wasmtime = "0.38"

View file

@ -2,6 +2,7 @@
name = "project" name = "project"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/project.rs" path = "src/project.rs"

View file

@ -2,6 +2,7 @@
name = "project_panel" name = "project_panel"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/project_panel.rs" path = "src/project_panel.rs"

View file

@ -2,6 +2,7 @@
name = "project_symbols" name = "project_symbols"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/project_symbols.rs" path = "src/project_symbols.rs"

View file

@ -2,6 +2,7 @@
name = "recent_projects" name = "recent_projects"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/recent_projects.rs" path = "src/recent_projects.rs"

View file

@ -2,6 +2,7 @@
name = "rope" name = "rope"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/rope.rs" path = "src/rope.rs"

View file

@ -3,6 +3,7 @@ description = "Shared logic for communication between the Zed app and the zed.de
edition = "2021" edition = "2021"
name = "rpc" name = "rpc"
version = "0.1.0" version = "0.1.0"
publish = false
[lib] [lib]
path = "src/rpc.rs" path = "src/rpc.rs"

View file

@ -2,6 +2,7 @@
name = "search" name = "search"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/search.rs" path = "src/search.rs"

View file

@ -2,6 +2,7 @@
name = "settings" name = "settings"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/settings.rs" path = "src/settings.rs"

View file

@ -2,6 +2,7 @@
name = "snippet" name = "snippet"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/snippet.rs" path = "src/snippet.rs"

View file

@ -2,6 +2,7 @@
name = "sqlez" name = "sqlez"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -2,6 +2,7 @@
name = "sqlez_macros" name = "sqlez_macros"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/sqlez_macros.rs" path = "src/sqlez_macros.rs"

View file

@ -2,6 +2,7 @@
name = "sum_tree" name = "sum_tree"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/sum_tree.rs" path = "src/sum_tree.rs"

View file

@ -2,6 +2,7 @@
name = "terminal" name = "terminal"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/terminal.rs" path = "src/terminal.rs"

View file

@ -2,6 +2,7 @@
name = "terminal_view" name = "terminal_view"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/terminal_view.rs" path = "src/terminal_view.rs"

View file

@ -2,6 +2,7 @@
name = "text" name = "text"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/text.rs" path = "src/text.rs"

View file

@ -2,6 +2,7 @@
name = "theme" name = "theme"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/theme.rs" path = "src/theme.rs"

View file

@ -2,6 +2,7 @@
name = "theme_selector" name = "theme_selector"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/theme_selector.rs" path = "src/theme_selector.rs"

View file

@ -2,6 +2,7 @@
name = "theme_testbench" name = "theme_testbench"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/theme_testbench.rs" path = "src/theme_testbench.rs"

View file

@ -2,6 +2,7 @@
name = "util" name = "util"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
doctest = false doctest = false

View file

@ -2,6 +2,7 @@
name = "vim" name = "vim"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/vim.rs" path = "src/vim.rs"

View file

@ -2,6 +2,7 @@
name = "workspace" name = "workspace"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false
[lib] [lib]
path = "src/workspace.rs" path = "src/workspace.rs"

View file

@ -1150,7 +1150,7 @@ impl Pane {
row.add_child({ row.add_child({
enum Tab {} enum Tab {}
dragged_item_receiver::<Tab, _>(ix, ix, true, None, cx, { let mut receiver = dragged_item_receiver::<Tab, _>(ix, ix, true, None, cx, {
let item = item.clone(); let item = item.clone();
let pane = pane.clone(); let pane = pane.clone();
let detail = detail.clone(); let detail = detail.clone();
@ -1162,50 +1162,51 @@ impl Pane {
let hovered = mouse_state.hovered(); let hovered = mouse_state.hovered();
Self::render_tab(&item, pane, ix == 0, detail, hovered, tab_style, cx) Self::render_tab(&item, pane, ix == 0, detail, hovered, tab_style, cx)
} }
}) });
.with_cursor_style(if pane_active && tab_active {
CursorStyle::Arrow
} else {
CursorStyle::PointingHand
})
.on_down(MouseButton::Left, move |_, cx| {
cx.dispatch_action(ActivateItem(ix));
cx.propagate_event();
})
.on_click(MouseButton::Middle, {
let item = item.clone();
let pane = pane.clone();
move |_, cx: &mut EventContext| {
cx.dispatch_action(CloseItem {
item_id: item.id(),
pane: pane.clone(),
})
}
})
.as_draggable(
DraggedItem {
item,
pane: pane.clone(),
},
{
let theme = cx.global::<Settings>().theme.clone();
let detail = detail.clone(); if !pane_active || !tab_active {
move |dragged_item, cx: &mut RenderContext<Workspace>| { receiver = receiver.with_cursor_style(CursorStyle::PointingHand);
let tab_style = &theme.workspace.tab_bar.dragged_tab; }
Self::render_tab(
&dragged_item.item, receiver
dragged_item.pane.clone(), .on_down(MouseButton::Left, move |_, cx| {
false, cx.dispatch_action(ActivateItem(ix));
detail, cx.propagate_event();
false, })
&tab_style, .on_click(MouseButton::Middle, {
cx, let item = item.clone();
) let pane = pane.clone();
move |_, cx: &mut EventContext| {
cx.dispatch_action(CloseItem {
item_id: item.id(),
pane: pane.clone(),
})
} }
}, })
) .as_draggable(
.boxed() DraggedItem {
item,
pane: pane.clone(),
},
{
let theme = cx.global::<Settings>().theme.clone();
let detail = detail.clone();
move |dragged_item, cx: &mut RenderContext<Workspace>| {
let tab_style = &theme.workspace.tab_bar.dragged_tab;
Self::render_tab(
&dragged_item.item,
dragged_item.pane.clone(),
false,
detail,
false,
&tab_style,
cx,
)
}
},
)
.boxed()
}) })
} }

View file

@ -234,6 +234,7 @@ pub fn init(app_state: Arc<AppState>, cx: &mut MutableAppContext) {
workspace.toggle_sidebar(SidebarSide::Right, cx); workspace.toggle_sidebar(SidebarSide::Right, cx);
}); });
cx.add_action(Workspace::activate_pane_at_index); cx.add_action(Workspace::activate_pane_at_index);
cx.add_action(Workspace::split_pane_with_item); cx.add_action(Workspace::split_pane_with_item);
cx.add_action(Workspace::split_pane_with_project_entry); cx.add_action(Workspace::split_pane_with_project_entry);

View file

@ -4,6 +4,7 @@ description = "The fast, collaborative code editor."
edition = "2021" edition = "2021"
name = "zed" name = "zed"
version = "0.71.0" version = "0.71.0"
publish = false
[lib] [lib]
name = "zed" name = "zed"

View file

@ -31,7 +31,7 @@ use search::{BufferSearchBar, ProjectSearchBar};
use serde::Deserialize; use serde::Deserialize;
use serde_json::to_string_pretty; use serde_json::to_string_pretty;
use settings::{keymap_file_json_schema, settings_file_json_schema, Settings}; use settings::{keymap_file_json_schema, settings_file_json_schema, Settings};
use std::{env, path::Path, str, sync::Arc}; use std::{borrow::Cow, env, path::Path, str, sync::Arc};
use util::{channel::ReleaseChannel, paths, ResultExt}; use util::{channel::ReleaseChannel, paths, ResultExt};
pub use workspace; pub use workspace;
use workspace::{sidebar::SidebarSide, AppState, Workspace}; use workspace::{sidebar::SidebarSide, AppState, Workspace};
@ -57,6 +57,7 @@ actions!(
DebugElements, DebugElements,
OpenSettings, OpenSettings,
OpenLog, OpenLog,
OpenLicenses,
OpenTelemetryLog, OpenTelemetryLog,
OpenKeymap, OpenKeymap,
OpenDefaultSettings, OpenDefaultSettings,
@ -176,6 +177,19 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut gpui::MutableAppContext) {
open_log_file(workspace, app_state.clone(), cx); open_log_file(workspace, app_state.clone(), cx);
} }
}); });
cx.add_action({
let app_state = app_state.clone();
move |workspace: &mut Workspace, _: &OpenLicenses, cx: &mut ViewContext<Workspace>| {
open_bundled_file(
workspace,
app_state.clone(),
"licenses.md",
"Open Source License Attribution",
"Markdown",
cx,
);
}
});
cx.add_action({ cx.add_action({
let app_state = app_state.clone(); let app_state = app_state.clone();
move |workspace: &mut Workspace, _: &OpenTelemetryLog, cx: &mut ViewContext<Workspace>| { move |workspace: &mut Workspace, _: &OpenTelemetryLog, cx: &mut ViewContext<Workspace>| {
@ -191,11 +205,12 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut gpui::MutableAppContext) {
cx.add_action({ cx.add_action({
let app_state = app_state.clone(); let app_state = app_state.clone();
move |workspace: &mut Workspace, _: &OpenDefaultKeymap, cx: &mut ViewContext<Workspace>| { move |workspace: &mut Workspace, _: &OpenDefaultKeymap, cx: &mut ViewContext<Workspace>| {
open_bundled_config_file( open_bundled_file(
workspace, workspace,
app_state.clone(), app_state.clone(),
"keymaps/default.json", "keymaps/default.json",
"Default Key Bindings", "Default Key Bindings",
"JSON",
cx, cx,
); );
} }
@ -205,11 +220,12 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut gpui::MutableAppContext) {
move |workspace: &mut Workspace, move |workspace: &mut Workspace,
_: &OpenDefaultSettings, _: &OpenDefaultSettings,
cx: &mut ViewContext<Workspace>| { cx: &mut ViewContext<Workspace>| {
open_bundled_config_file( open_bundled_file(
workspace, workspace,
app_state.clone(), app_state.clone(),
"settings/default.json", "settings/default.json",
"Default Settings", "Default Settings",
"JSON",
cx, cx,
); );
} }
@ -613,21 +629,24 @@ fn open_telemetry_log_file(
}).detach(); }).detach();
} }
fn open_bundled_config_file( fn open_bundled_file(
workspace: &mut Workspace, workspace: &mut Workspace,
app_state: Arc<AppState>, app_state: Arc<AppState>,
asset_path: &'static str, asset_path: &'static str,
title: &'static str, title: &'static str,
language: &'static str,
cx: &mut ViewContext<Workspace>, cx: &mut ViewContext<Workspace>,
) { ) {
workspace workspace
.with_local_workspace(&app_state, cx, |workspace, cx| { .with_local_workspace(&app_state, cx, |workspace, cx| {
let project = workspace.project().clone(); let project = workspace.project().clone();
let buffer = project.update(cx, |project, cx| { let buffer = project.update(cx, |project, cx| {
let text = Assets::get(asset_path).unwrap().data; let text = Assets::get(asset_path)
.map(|f| f.data)
.unwrap_or_else(|| Cow::Borrowed(b"File not found"));
let text = str::from_utf8(text.as_ref()).unwrap(); let text = str::from_utf8(text.as_ref()).unwrap();
project project
.create_buffer(text, project.languages().get_language("JSON"), cx) .create_buffer(text, project.languages().get_language(language), cx)
.expect("creating buffers on a local workspace always succeeds") .expect("creating buffers on a local workspace always succeeds")
}); });
let buffer = let buffer =

15
script/generate-licenses Executable file
View file

@ -0,0 +1,15 @@
#!/bin/bash
set -e
[[ "$(cargo about --version)" == "cargo-about 0.5.2" ]] || cargo install cargo-about --locked --git https://github.com/zed-industries/cargo-about --branch error-code-on-warn
cargo about generate --fail-on-missing-license -o assets/licenses.md -c script/licenses/zed-licenses.toml script/licenses/template.hbs.md
# cargo about automatically html-escapes all output, so we need to undo it here:
sed -i '' 's/&quot;/"/g' assets/licenses.md
sed -i '' 's/&#x27;/'\''/g' assets/licenses.md # `'\''` ends the string, appends a single quote, and re-opens the string
sed -i '' 's/&#x3D;/=/g' assets/licenses.md
sed -i '' 's/&#x60;/`/g' assets/licenses.md
sed -i '' 's/&lt;/</g' assets/licenses.md
sed -i '' 's/&gt;/>/g' assets/licenses.md

View file

@ -0,0 +1,27 @@
# Third Party Licenses
This page lists the licenses of the projects used in Zed.
## Overview of licenses:
{{#each overview}}
* {{name}} ({{count}})
{{/each}}
## All license texts:
{{#each licenses}}
### {{name}}
#### Used by:
{{#each used_by}}
* [{{crate.name}} {{crate.version}}]({{#if crate.repository}} {{crate.repository}} {{else}} https://crates.io/crates/{{crate.name}} {{/if}})
{{/each}}
{{text}}
--------------------------------------------------------------------------------
{{/each}}

View file

@ -0,0 +1,37 @@
no-clearly-defined = true
private = { ignore = true }
accepted = [
"Apache-2.0",
"MIT",
"Apache-2.0 WITH LLVM-exception",
"MPL-2.0",
"BSD-3-Clause",
"BSD-2-Clause",
"ISC",
"CC0-1.0",
"Unicode-DFS-2016",
"OpenSSL",
"Zlib",
]
workarounds = [
"ring",
"wasmtime",
]
[procinfo.clarify]
license = "MIT"
[[procinfo.clarify.git]]
path = 'LICENSE.md'
checksum = '37db33bbbd7348969eda397b89a16f252d56c1ca7481b6ccaf56ccdcbab5dcca'
[webpki.clarify]
license = "ISC" # It actually says 'ISC-style' but I don't know the SPDX expression for that.
[[webpki.clarify.files]]
path = 'LICENSE'
checksum = '5b698ca13897be3afdb7174256fa1574f8c6892b8bea1a66dd6469d3fe27885a'
[fuchsia-cprng.clarify]
license = "BSD-3-Clause"
[[fuchsia-cprng.clarify.files]]
path = 'LICENSE'
checksum = '03b114f53e6587a398931762ee11e2395bfdba252a329940e2c8c9e81813845b'

View file

@ -11,15 +11,15 @@ const license = {
export const light = createColorScheme(`${name}`, true, { export const light = createColorScheme(`${name}`, true, {
neutral: chroma.scale([ neutral: chroma.scale([
"#090a0b", "#090a0b",
"#202227", "#202227",
"#383a42", "#383a42",
"#696c77", "#696c77",
"#a0a1a7", "#a0a1a7",
"#e5e5e6", "#e5e5e6",
"#f0f0f1", "#f0f0f1",
"#fafafa", "#fafafa",
]) ])
.domain([0.05, 0.22, 0.25, 0.45, 0.62, 0.8, 0.9, 1]), .domain([0.05, 0.22, 0.25, 0.45, 0.62, 0.8, 0.9, 1]),
red: colorRamp(chroma("#ca1243")), red: colorRamp(chroma("#ca1243")),