chore: Bump Rust edition to 2024 (#27800)
Follow-up to https://github.com/zed-industries/zed/pull/27791 Release Notes: - N/A
This commit is contained in:
parent
d50905e000
commit
dc64ec9cc8
802 changed files with 3775 additions and 3662 deletions
|
@ -2,8 +2,8 @@ use std::cmp;
|
|||
|
||||
use crate::InlineCompletion;
|
||||
use gpui::{
|
||||
point, prelude::*, quad, size, AnyElement, App, BorderStyle, Bounds, Corners, Edges,
|
||||
HighlightStyle, Hsla, StyledText, TextLayout, TextStyle,
|
||||
AnyElement, App, BorderStyle, Bounds, Corners, Edges, HighlightStyle, Hsla, StyledText,
|
||||
TextLayout, TextStyle, point, prelude::*, quad, size,
|
||||
};
|
||||
use language::OffsetRangeExt;
|
||||
use settings::Settings;
|
||||
|
|
|
@ -8,7 +8,7 @@ use settings::update_settings_file;
|
|||
use ui::App;
|
||||
use workspace::Workspace;
|
||||
|
||||
use crate::{onboarding_modal::ZedPredictModal, RateCompletionModal};
|
||||
use crate::{RateCompletionModal, onboarding_modal::ZedPredictModal};
|
||||
|
||||
actions!(edit_prediction, [ResetOnboarding, RateCompletions]);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::{
|
||||
tokens_for_bytes, CURSOR_MARKER, EDITABLE_REGION_END_MARKER, EDITABLE_REGION_START_MARKER,
|
||||
START_OF_FILE_MARKER,
|
||||
CURSOR_MARKER, EDITABLE_REGION_END_MARKER, EDITABLE_REGION_START_MARKER, START_OF_FILE_MARKER,
|
||||
tokens_for_bytes,
|
||||
};
|
||||
use language::{BufferSnapshot, Point};
|
||||
use std::{fmt::Write, ops::Range};
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
use std::{sync::Arc, time::Duration};
|
||||
|
||||
use crate::{onboarding_event, ZED_PREDICT_DATA_COLLECTION_CHOICE};
|
||||
use crate::{ZED_PREDICT_DATA_COLLECTION_CHOICE, onboarding_event};
|
||||
use anyhow::Context as _;
|
||||
use client::{Client, UserStore};
|
||||
use db::kvp::KEY_VALUE_STORE;
|
||||
use fs::Fs;
|
||||
use gpui::{
|
||||
ease_in_out, svg, Animation, AnimationExt as _, ClickEvent, DismissEvent, Entity, EventEmitter,
|
||||
FocusHandle, Focusable, MouseDownEvent, Render,
|
||||
Animation, AnimationExt as _, ClickEvent, DismissEvent, Entity, EventEmitter, FocusHandle,
|
||||
Focusable, MouseDownEvent, Render, ease_in_out, svg,
|
||||
};
|
||||
use language::language_settings::{AllLanguageSettings, EditPredictionProvider};
|
||||
use settings::{update_settings_file, Settings};
|
||||
use ui::{prelude::*, Checkbox, TintColor};
|
||||
use settings::{Settings, update_settings_file};
|
||||
use ui::{Checkbox, TintColor, prelude::*};
|
||||
use util::ResultExt;
|
||||
use workspace::{notifications::NotifyTaskExt, ModalView, Workspace};
|
||||
use workspace::{ModalView, Workspace, notifications::NotifyTaskExt};
|
||||
|
||||
/// Introduces user to Zed's Edit Prediction feature and terms of service
|
||||
pub struct ZedPredictModal {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
use crate::{CompletionDiffElement, InlineCompletion, InlineCompletionRating, Zeta};
|
||||
use editor::Editor;
|
||||
use gpui::{actions, prelude::*, App, DismissEvent, Entity, EventEmitter, FocusHandle, Focusable};
|
||||
use gpui::{App, DismissEvent, Entity, EventEmitter, FocusHandle, Focusable, actions, prelude::*};
|
||||
use language::language_settings;
|
||||
use std::time::Duration;
|
||||
use ui::{prelude::*, KeyBinding, List, ListItem, ListItemSpacing, Tooltip};
|
||||
use ui::{KeyBinding, List, ListItem, ListItemSpacing, Tooltip, prelude::*};
|
||||
use workspace::{ModalView, Workspace};
|
||||
|
||||
actions!(
|
||||
|
|
|
@ -10,23 +10,23 @@ pub(crate) use completion_diff_element::*;
|
|||
use db::kvp::KEY_VALUE_STORE;
|
||||
pub use init::*;
|
||||
use inline_completion::DataCollectionState;
|
||||
pub use license_detection::is_license_eligible_for_data_collection;
|
||||
use license_detection::LICENSE_FILES_TO_CHECK;
|
||||
pub use license_detection::is_license_eligible_for_data_collection;
|
||||
pub use rate_completion_modal::*;
|
||||
|
||||
use anyhow::{anyhow, Context as _, Result};
|
||||
use anyhow::{Context as _, Result, anyhow};
|
||||
use arrayvec::ArrayVec;
|
||||
use client::{Client, UserStore};
|
||||
use collections::{HashMap, HashSet, VecDeque};
|
||||
use futures::AsyncReadExt;
|
||||
use gpui::{
|
||||
actions, App, AppContext as _, AsyncApp, Context, Entity, EntityId, Global, SemanticVersion,
|
||||
Subscription, Task, WeakEntity,
|
||||
App, AppContext as _, AsyncApp, Context, Entity, EntityId, Global, SemanticVersion,
|
||||
Subscription, Task, WeakEntity, actions,
|
||||
};
|
||||
use http_client::{HttpClient, Method};
|
||||
use input_excerpt::excerpt_for_cursor_position;
|
||||
use language::{
|
||||
text_diff, Anchor, Buffer, BufferSnapshot, EditPreview, OffsetRangeExt, ToOffset, ToPoint,
|
||||
Anchor, Buffer, BufferSnapshot, EditPreview, OffsetRangeExt, ToOffset, ToPoint, text_diff,
|
||||
};
|
||||
use language_model::{LlmApiToken, RefreshLlmTokenListener};
|
||||
use postage::watch;
|
||||
|
@ -50,12 +50,12 @@ use telemetry_events::InlineCompletionRating;
|
|||
use thiserror::Error;
|
||||
use util::ResultExt;
|
||||
use uuid::Uuid;
|
||||
use workspace::notifications::{ErrorMessagePrompt, NotificationId};
|
||||
use workspace::Workspace;
|
||||
use workspace::notifications::{ErrorMessagePrompt, NotificationId};
|
||||
use worktree::Worktree;
|
||||
use zed_llm_client::{
|
||||
PredictEditsBody, PredictEditsResponse, EXPIRED_LLM_TOKEN_HEADER_NAME,
|
||||
MINIMUM_REQUIRED_VERSION_HEADER_NAME,
|
||||
EXPIRED_LLM_TOKEN_HEADER_NAME, MINIMUM_REQUIRED_VERSION_HEADER_NAME, PredictEditsBody,
|
||||
PredictEditsResponse,
|
||||
};
|
||||
|
||||
const CURSOR_MARKER: &'static str = "<|user_cursor_is_here|>";
|
||||
|
@ -165,11 +165,7 @@ fn interpolate(
|
|||
|
||||
edits.extend(model_edits.cloned());
|
||||
|
||||
if edits.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(edits)
|
||||
}
|
||||
if edits.is_empty() { None } else { Some(edits) }
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for InlineCompletion {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue