Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ members = [
"crates/extension_host",
"crates/extensions_ui",
"crates/feature_flags",
"crates/feature_flags_macros",
"crates/feedback",
"crates/file_finder",
"crates/file_icons",
Expand Down Expand Up @@ -326,6 +327,7 @@ extension = { path = "crates/extension" }
extension_host = { path = "crates/extension_host" }
extensions_ui = { path = "crates/extensions_ui" }
feature_flags = { path = "crates/feature_flags" }
feature_flags_macros = { path = "crates/feature_flags_macros" }
feedback = { path = "crates/feedback" }
file_finder = { path = "crates/file_finder" }
file_icons = { path = "crates/file_icons" }
Expand Down Expand Up @@ -894,6 +896,7 @@ debug = true
# proc-macros start
gpui_macros = { opt-level = 3 }
derive_refineable = { opt-level = 3 }
feature_flags_macros = { opt-level = 3 }
settings_macros = { opt-level = 3 }
sqlez_macros = { opt-level = 3, codegen-units = 1 }
ui_macros = { opt-level = 3 }
Expand Down
13 changes: 9 additions & 4 deletions crates/agent_ui/src/thread_metadata_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ pub fn worktree_info_from_thread_paths<S: std::hash::BuildHasher>(
.unwrap_or_default();
linked_short_names.push((short_name.clone(), project_name));
infos.push(ThreadItemWorktreeInfo {
name: short_name,
worktree_name: Some(short_name),
full_path: SharedString::from(folder_path.display().to_string()),
highlight_positions: Vec::new(),
kind: WorktreeKind::Linked,
Expand All @@ -357,7 +357,7 @@ pub fn worktree_info_from_thread_paths<S: std::hash::BuildHasher>(
continue;
};
infos.push(ThreadItemWorktreeInfo {
name: SharedString::from(name.to_string_lossy().to_string()),
worktree_name: Some(SharedString::from(name.to_string_lossy().to_string())),
full_path: SharedString::from(folder_path.display().to_string()),
highlight_positions: Vec::new(),
kind: WorktreeKind::Main,
Expand All @@ -370,15 +370,20 @@ pub fn worktree_info_from_thread_paths<S: std::hash::BuildHasher>(
// folder paths don't all share the same short name, prefix each
// linked worktree chip with its main project name so the user knows
// which project it belongs to.
let all_same_name = infos.len() > 1 && infos.iter().all(|i| i.name == infos[0].name);
let all_same_name = infos.len() > 1
&& infos
.iter()
.all(|i| i.worktree_name == infos[0].worktree_name);

if unique_main_count.len() > 1 && !all_same_name {
for (info, (_short_name, project_name)) in infos
.iter_mut()
.filter(|i| i.kind == WorktreeKind::Linked)
.zip(linked_short_names.iter())
{
info.name = SharedString::from(format!("{}:{}", project_name, info.name));
if let Some(name) = &info.worktree_name {
info.worktree_name = Some(SharedString::from(format!("{}:{}", project_name, name)));
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion crates/csv_preview/src/csv_preview.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use editor::{Editor, EditorEvent};
use feature_flags::{FeatureFlag, FeatureFlagAppExt as _};
use feature_flags::{FeatureFlag, FeatureFlagAppExt as _, PresenceFlag, register_feature_flag};
use gpui::{
AppContext, Entity, EventEmitter, FocusHandle, Focusable, ListAlignment, Task, actions,
};
Expand Down Expand Up @@ -29,7 +29,9 @@ pub struct TabularDataPreviewFeatureFlag;

impl FeatureFlag for TabularDataPreviewFeatureFlag {
const NAME: &'static str = "tabular-data-preview";
type Value = PresenceFlag;
}
register_feature_flag!(TabularDataPreviewFeatureFlag);

pub struct CsvPreviewView {
pub(crate) engine: TableDataEngine,
Expand Down
4 changes: 3 additions & 1 deletion crates/debugger_ui/src/debugger_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use dap::adapters::DebugAdapterName;
use dap::{DapRegistry, StartDebuggingRequestArguments};
use dap::{client::SessionId, debugger_settings::DebuggerSettings};
use editor::{Editor, MultiBufferOffset, ToPoint};
use feature_flags::{FeatureFlag, FeatureFlagAppExt as _};
use feature_flags::{FeatureFlag, FeatureFlagAppExt as _, PresenceFlag, register_feature_flag};
use gpui::{
Action, App, AsyncWindowContext, ClipboardItem, Context, Corner, DismissEvent, Entity,
EntityId, EventEmitter, FocusHandle, Focusable, MouseButton, MouseDownEvent, Point,
Expand Down Expand Up @@ -50,7 +50,9 @@ pub struct DebuggerHistoryFeatureFlag;

impl FeatureFlag for DebuggerHistoryFeatureFlag {
const NAME: &'static str = "debugger-history";
type Value = PresenceFlag;
}
register_feature_flag!(DebuggerHistoryFeatureFlag);

const DEBUG_PANEL_KEY: &str = "DebugPanel";

Expand Down
4 changes: 3 additions & 1 deletion crates/edit_prediction/src/edit_prediction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use copilot::{Copilot, Reinstall, SignIn, SignOut};
use credentials_provider::CredentialsProvider;
use db::kvp::{Dismissable, KeyValueStore};
use edit_prediction_context::{RelatedExcerptStore, RelatedExcerptStoreEvent, RelatedFile};
use feature_flags::{FeatureFlag, FeatureFlagAppExt as _};
use feature_flags::{FeatureFlag, FeatureFlagAppExt as _, PresenceFlag, register_feature_flag};
use futures::{
AsyncReadExt as _, FutureExt as _, StreamExt as _,
channel::mpsc::{self, UnboundedReceiver},
Expand Down Expand Up @@ -120,7 +120,9 @@ pub struct EditPredictionJumpsFeatureFlag;

impl FeatureFlag for EditPredictionJumpsFeatureFlag {
const NAME: &'static str = "edit_prediction_jumps";
type Value = PresenceFlag;
}
register_feature_flag!(EditPredictionJumpsFeatureFlag);

#[derive(Clone)]
struct EditPredictionStoreGlobal(Entity<EditPredictionStore>);
Expand Down
4 changes: 2 additions & 2 deletions crates/edit_prediction_ui/src/edit_prediction_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ fn feature_gate_predict_edits_actions(cx: &mut App) {
})
.detach();

cx.observe_flag::<PredictEditsRatePredictionsFeatureFlag, _>(move |is_enabled, cx| {
cx.observe_flag::<PredictEditsRatePredictionsFeatureFlag, _>(move |value, cx| {
if !DisableAiSettings::get_global(cx).disable_ai {
if is_enabled {
if *value {
CommandPaletteFilter::update_global(cx, |filter, _cx| {
filter.show_action_types(&rate_completion_action_types);
});
Expand Down
4 changes: 3 additions & 1 deletion crates/edit_prediction_ui/src/rate_prediction_modal.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use buffer_diff::BufferDiff;
use edit_prediction::{EditPrediction, EditPredictionRating, EditPredictionStore};
use editor::{Editor, Inlay, MultiBuffer};
use feature_flags::FeatureFlag;
use feature_flags::{FeatureFlag, PresenceFlag, register_feature_flag};
use gpui::{
App, BorderStyle, DismissEvent, EdgesRefinement, Entity, EventEmitter, FocusHandle, Focusable,
Length, StyleRefinement, TextStyleRefinement, Window, actions, prelude::*,
Expand Down Expand Up @@ -43,7 +43,9 @@ pub struct PredictEditsRatePredictionsFeatureFlag;

impl FeatureFlag for PredictEditsRatePredictionsFeatureFlag {
const NAME: &'static str = "predict-edits-rate-completions";
type Value = PresenceFlag;
}
register_feature_flag!(PredictEditsRatePredictionsFeatureFlag);

pub struct RatePredictionsModal {
ep_store: Entity<EditPredictionStore>,
Expand Down
11 changes: 11 additions & 0 deletions crates/feature_flags/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,15 @@ workspace = true
path = "src/feature_flags.rs"

[dependencies]
collections.workspace = true
feature_flags_macros.workspace = true
fs.workspace = true
gpui.workspace = true
inventory.workspace = true
schemars.workspace = true
serde_json.workspace = true
settings.workspace = true

[dev-dependencies]
gpui = { workspace = true, features = ["test-support"] }
settings = { workspace = true, features = ["test-support"] }
Loading
Loading