Merge branch 'main' into fix-broken-lsp-installations
This commit is contained in:
commit
48bed2ee03
516 changed files with 12747 additions and 3368 deletions
|
@ -3,7 +3,7 @@ authors = ["Nathan Sobo <nathansobo@gmail.com>"]
|
|||
description = "The fast, collaborative code editor."
|
||||
edition = "2021"
|
||||
name = "zed"
|
||||
version = "0.92.0"
|
||||
version = "0.94.0"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
@ -62,12 +62,11 @@ text = { path = "../text" }
|
|||
terminal_view = { path = "../terminal_view" }
|
||||
theme = { path = "../theme" }
|
||||
theme_selector = { path = "../theme_selector" }
|
||||
theme_testbench = { path = "../theme_testbench" }
|
||||
util = { path = "../util" }
|
||||
vim = { path = "../vim" }
|
||||
workspace = { path = "../workspace" }
|
||||
welcome = { path = "../welcome" }
|
||||
|
||||
zed-actions = {path = "../zed-actions"}
|
||||
anyhow.workspace = true
|
||||
async-compression = { version = "0.3", features = ["gzip", "futures-bufread"] }
|
||||
async-tar = "0.4.2"
|
||||
|
|
|
@ -9,7 +9,5 @@
|
|||
(#set! combined)
|
||||
)
|
||||
|
||||
; expressions live within HTML tags, and do not need to be combined
|
||||
; <link href={ Routes.static_path(..) } />
|
||||
((expression (expression_value) @content)
|
||||
(#set! language "elixir"))
|
||||
|
|
|
@ -48,6 +48,7 @@ use util::{
|
|||
http::{self, HttpClient},
|
||||
paths::PathLikeWithPosition,
|
||||
};
|
||||
use uuid::Uuid;
|
||||
use welcome::{show_welcome_experience, FIRST_OPEN};
|
||||
|
||||
use fs::RealFs;
|
||||
|
@ -68,9 +69,8 @@ fn main() {
|
|||
log::info!("========== starting zed ==========");
|
||||
let mut app = gpui::App::new(Assets).unwrap();
|
||||
|
||||
init_panic_hook(&app);
|
||||
|
||||
app.background();
|
||||
let installation_id = app.background().block(installation_id()).ok();
|
||||
init_panic_hook(&app, installation_id.clone());
|
||||
|
||||
load_embedded_fonts(&app);
|
||||
|
||||
|
@ -154,7 +154,6 @@ fn main() {
|
|||
search::init(cx);
|
||||
vim::init(cx);
|
||||
terminal_view::init(cx);
|
||||
theme_testbench::init(cx);
|
||||
copilot::init(http.clone(), node_runtime, cx);
|
||||
ai::init(cx);
|
||||
|
||||
|
@ -169,7 +168,7 @@ fn main() {
|
|||
})
|
||||
.detach();
|
||||
|
||||
client.telemetry().start();
|
||||
client.telemetry().start(installation_id);
|
||||
|
||||
let app_state = Arc::new(AppState {
|
||||
languages,
|
||||
|
@ -269,6 +268,22 @@ fn main() {
|
|||
});
|
||||
}
|
||||
|
||||
async fn installation_id() -> Result<String> {
|
||||
let legacy_key_name = "device_id";
|
||||
|
||||
if let Ok(Some(installation_id)) = KEY_VALUE_STORE.read_kvp(legacy_key_name) {
|
||||
Ok(installation_id)
|
||||
} else {
|
||||
let installation_id = Uuid::new_v4().to_string();
|
||||
|
||||
KEY_VALUE_STORE
|
||||
.write_kvp(legacy_key_name.to_string(), installation_id.clone())
|
||||
.await?;
|
||||
|
||||
Ok(installation_id)
|
||||
}
|
||||
}
|
||||
|
||||
fn open_urls(
|
||||
urls: Vec<String>,
|
||||
cli_connections_tx: &mpsc::UnboundedSender<(
|
||||
|
@ -372,6 +387,8 @@ struct Panic {
|
|||
os_version: Option<String>,
|
||||
architecture: String,
|
||||
panicked_on: u128,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
installation_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
|
@ -380,7 +397,7 @@ struct PanicRequest {
|
|||
token: String,
|
||||
}
|
||||
|
||||
fn init_panic_hook(app: &App) {
|
||||
fn init_panic_hook(app: &App, installation_id: Option<String>) {
|
||||
let is_pty = stdout_is_a_pty();
|
||||
let platform = app.platform();
|
||||
|
||||
|
@ -433,6 +450,7 @@ fn init_panic_hook(app: &App) {
|
|||
.unwrap()
|
||||
.as_millis(),
|
||||
backtrace,
|
||||
installation_id: installation_id.clone(),
|
||||
};
|
||||
|
||||
if is_pty {
|
||||
|
@ -871,6 +889,6 @@ pub fn background_actions() -> &'static [(&'static str, &'static dyn Action)] {
|
|||
("Go to file", &file_finder::Toggle),
|
||||
("Open command palette", &command_palette::Toggle),
|
||||
("Open recent projects", &recent_projects::OpenRecent),
|
||||
("Change your settings", &zed::OpenSettings),
|
||||
("Change your settings", &zed_actions::OpenSettings),
|
||||
]
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ use feedback::{
|
|||
};
|
||||
use futures::{channel::mpsc, StreamExt};
|
||||
use gpui::{
|
||||
actions,
|
||||
anyhow::{self, Result},
|
||||
geometry::vector::vec2f,
|
||||
impl_actions,
|
||||
|
@ -50,6 +49,7 @@ use workspace::{
|
|||
notifications::simple_message_notification::MessageNotification, open_new, AppState, NewFile,
|
||||
NewWindow, Workspace, WorkspaceSettings,
|
||||
};
|
||||
use zed_actions::*;
|
||||
|
||||
#[derive(Deserialize, Clone, PartialEq)]
|
||||
pub struct OpenBrowser {
|
||||
|
@ -58,33 +58,6 @@ pub struct OpenBrowser {
|
|||
|
||||
impl_actions!(zed, [OpenBrowser]);
|
||||
|
||||
actions!(
|
||||
zed,
|
||||
[
|
||||
About,
|
||||
Hide,
|
||||
HideOthers,
|
||||
ShowAll,
|
||||
Minimize,
|
||||
Zoom,
|
||||
ToggleFullScreen,
|
||||
Quit,
|
||||
DebugElements,
|
||||
OpenLog,
|
||||
OpenLicenses,
|
||||
OpenTelemetryLog,
|
||||
OpenKeymap,
|
||||
OpenSettings,
|
||||
OpenLocalSettings,
|
||||
OpenDefaultSettings,
|
||||
OpenDefaultKeymap,
|
||||
IncreaseBufferFontSize,
|
||||
DecreaseBufferFontSize,
|
||||
ResetBufferFontSize,
|
||||
ResetDatabase,
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(app_state: &Arc<AppState>, cx: &mut gpui::AppContext) {
|
||||
cx.add_action(about);
|
||||
cx.add_global_action(|_: &Hide, cx: &mut gpui::AppContext| {
|
||||
|
@ -361,15 +334,15 @@ pub fn initialize_workspace(
|
|||
|
||||
let project_panel = ProjectPanel::load(workspace_handle.clone(), cx.clone());
|
||||
let terminal_panel = TerminalPanel::load(workspace_handle.clone(), cx.clone());
|
||||
let assistant_panel = if *util::channel::RELEASE_CHANNEL == ReleaseChannel::Stable {
|
||||
None
|
||||
} else {
|
||||
Some(AssistantPanel::load(workspace_handle.clone(), cx.clone()).await?)
|
||||
};
|
||||
let (project_panel, terminal_panel) = futures::try_join!(project_panel, terminal_panel)?;
|
||||
let assistant_panel = AssistantPanel::load(workspace_handle.clone(), cx.clone());
|
||||
let (project_panel, terminal_panel, assistant_panel) =
|
||||
futures::try_join!(project_panel, terminal_panel, assistant_panel)?;
|
||||
workspace_handle.update(&mut cx, |workspace, cx| {
|
||||
let project_panel_position = project_panel.position(cx);
|
||||
workspace.add_panel(project_panel, cx);
|
||||
workspace.add_panel(terminal_panel, cx);
|
||||
workspace.add_panel(assistant_panel, cx);
|
||||
|
||||
if !was_deserialized
|
||||
&& workspace
|
||||
.project()
|
||||
|
@ -383,13 +356,7 @@ pub fn initialize_workspace(
|
|||
{
|
||||
workspace.toggle_dock(project_panel_position, cx);
|
||||
}
|
||||
|
||||
cx.focus_self();
|
||||
|
||||
workspace.add_panel(terminal_panel, cx);
|
||||
if let Some(assistant_panel) = assistant_panel {
|
||||
workspace.add_panel(assistant_panel, cx);
|
||||
}
|
||||
})?;
|
||||
Ok(())
|
||||
})
|
||||
|
@ -741,8 +708,8 @@ mod tests {
|
|||
use editor::{scroll::autoscroll::Autoscroll, DisplayPoint, Editor};
|
||||
use fs::{FakeFs, Fs};
|
||||
use gpui::{
|
||||
elements::Empty, executor::Deterministic, Action, AnyElement, AppContext, AssetSource,
|
||||
Element, Entity, TestAppContext, View, ViewHandle,
|
||||
actions, elements::Empty, executor::Deterministic, Action, AnyElement, AppContext,
|
||||
AssetSource, Element, Entity, TestAppContext, View, ViewHandle,
|
||||
};
|
||||
use language::LanguageRegistry;
|
||||
use node_runtime::NodeRuntime;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue