Fix cursor focus and selection in input box, add AWS env var warning box, and remove AWS Bedrock login banner
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
use galaxy_files::FileModel;
|
||||
use lsp::LspManagerModel;
|
||||
use remote_server::proto::TextEdit;
|
||||
use repo_metadata::repositories::DetectedRepositories;
|
||||
use repo_metadata::watcher::DirectoryWatcher;
|
||||
use repo_metadata::RepoMetadataModel;
|
||||
use warp_files::FileModel;
|
||||
use warp_util::content_version::ContentVersion;
|
||||
use warp_util::host_id::HostId;
|
||||
use warp_util::standardized_path::StandardizedPath;
|
||||
|
||||
@@ -21,7 +21,9 @@ const CODE_ACTIONS_MENU_WIDTH: f32 = 380.;
|
||||
const CODE_ACTIONS_MENU_MAX_HEIGHT: f32 = 250.;
|
||||
const MAX_VISIBLE_ACTIONS: usize = 12;
|
||||
|
||||
#[derive(Default)]
|
||||
pub(super) enum CodeActionsState {
|
||||
#[default]
|
||||
Idle,
|
||||
Requesting {
|
||||
abort_handle: AbortHandle,
|
||||
@@ -34,12 +36,6 @@ pub(super) enum CodeActionsState {
|
||||
},
|
||||
}
|
||||
|
||||
impl Default for CodeActionsState {
|
||||
fn default() -> Self {
|
||||
Self::Idle
|
||||
}
|
||||
}
|
||||
|
||||
impl CodeActionsState {
|
||||
pub fn dismiss(&mut self) -> bool {
|
||||
if matches!(self, Self::Idle) {
|
||||
|
||||
@@ -38,7 +38,9 @@ pub(super) struct ResolvedDocumentation {
|
||||
pub scroll_state: ClippedScrollStateHandle,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub(super) enum CompletionState {
|
||||
#[default]
|
||||
Idle,
|
||||
Requesting {
|
||||
abort_handle: AbortHandle,
|
||||
@@ -59,12 +61,6 @@ pub(super) enum CompletionState {
|
||||
},
|
||||
}
|
||||
|
||||
impl Default for CompletionState {
|
||||
fn default() -> Self {
|
||||
Self::Idle
|
||||
}
|
||||
}
|
||||
|
||||
impl CompletionState {
|
||||
pub fn is_showing(&self) -> bool {
|
||||
matches!(self, Self::Showing { .. })
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use std::cell::RefCell;
|
||||
|
||||
use pathfinder_color::ColorU;
|
||||
use pathfinder_geometry::vector::Vector2F;
|
||||
use galaxy_core::ui::appearance::Appearance;
|
||||
use galaxy_core::ui::theme::Fill;
|
||||
use pathfinder_color::ColorU;
|
||||
use pathfinder_geometry::vector::Vector2F;
|
||||
use warp_editor::render::element::VerticalExpansionBehavior;
|
||||
use warpui::elements::{
|
||||
Border, ChildView, Clipped, ConstrainedBox, Container, CornerRadius, CrossAxisAlignment, Flex,
|
||||
@@ -238,12 +238,11 @@ impl CommentEditor {
|
||||
EditorViewEvent::CmdEnter => {
|
||||
self.save_comment(ctx);
|
||||
}
|
||||
EditorViewEvent::EscapePressed => {
|
||||
// Dismiss the comment composer when pressing Escape on an empty draft.
|
||||
if self.editor.as_ref(ctx).model().as_ref(ctx).is_empty(ctx) {
|
||||
self.reset(ctx);
|
||||
ctx.emit(CommentEditorEvent::CloseEditor);
|
||||
}
|
||||
EditorViewEvent::EscapePressed
|
||||
if self.editor.as_ref(ctx).model().as_ref(ctx).is_empty(ctx) =>
|
||||
{
|
||||
self.reset(ctx);
|
||||
ctx.emit(CommentEditorEvent::CloseEditor);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
@@ -7,23 +7,17 @@ use std::rc::Rc;
|
||||
use std::sync::Arc;
|
||||
|
||||
use futures::stream::AbortHandle;
|
||||
use galaxy_core::ui::theme::Fill;
|
||||
use galaxy_editor::{
|
||||
content::{edit::TemporaryBlock, version::BufferVersion},
|
||||
multiline::{AnyMultilineString, MultilineStr, MultilineString, LF},
|
||||
render::model::{Decoration, LineCount, LineDecoration},
|
||||
};
|
||||
use galaxy_core::ui::theme::{AnsiColorIdentifier, Fill};
|
||||
use galaxy_editor::content::edit::TemporaryBlock;
|
||||
use galaxy_editor::content::version::BufferVersion;
|
||||
use galaxy_editor::multiline::{AnyMultilineString, MultilineStr, MultilineString, LF};
|
||||
use galaxy_editor::render::model::{Decoration, LineCount, LineDecoration};
|
||||
use galaxyui::{Entity, ModelContext};
|
||||
use itertools::Itertools;
|
||||
use pathfinder_color::ColorU;
|
||||
use rangemap::RangeMap;
|
||||
use similar::{ChangeTag, DiffOp, TextDiff};
|
||||
use string_offset::CharOffset;
|
||||
use galaxy_core::ui::theme::{AnsiColorIdentifier, Fill};
|
||||
use galaxy_editor::content::edit::TemporaryBlock;
|
||||
use galaxy_editor::content::version::BufferVersion;
|
||||
use galaxy_editor::multiline::{AnyMultilineString, MultilineStr, MultilineString, LF};
|
||||
use galaxy_editor::render::model::{Decoration, LineCount, LineDecoration};
|
||||
|
||||
use super::super::DiffResult;
|
||||
use crate::appearance::Appearance;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use galaxy_editor::multiline::{MultilineStr, MultilineString};
|
||||
use galaxyui::App;
|
||||
use rangemap::RangeMap;
|
||||
use unindent::Unindent as _;
|
||||
|
||||
@@ -9,7 +10,6 @@ use crate::code::editor::diff::ChangeType;
|
||||
|
||||
#[test]
|
||||
fn test_diff_generation() {
|
||||
use galaxyui::App;
|
||||
App::test((), |_| async move {
|
||||
let (change_mapping, deletion_mapping) = DiffModel::compute_diff_internal(
|
||||
MultilineStr::try_new("Hello World\nThis is the second line.\nThis is the third.")
|
||||
|
||||
@@ -3,11 +3,6 @@ use std::ops::Range;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub use gutter_button::{AddAsContextButton, CommentButton, RevertHunkButton};
|
||||
use parking_lot::Mutex;
|
||||
use pathfinder_color::ColorU;
|
||||
use pathfinder_geometry::rect::RectF;
|
||||
use pathfinder_geometry::vector::{vec2f, Vector2F};
|
||||
use galaxy_core::features::FeatureFlag;
|
||||
use galaxy_core::ui::appearance::Appearance;
|
||||
use galaxy_core::ui::theme::color::internal_colors;
|
||||
@@ -32,10 +27,11 @@ use galaxyui::{
|
||||
AfterLayoutContext, AppContext, ClipBounds, Element, Event, EventContext, LayoutContext,
|
||||
ModelHandle, PaintContext, SingletonEntity, SizeConstraint,
|
||||
};
|
||||
use pathfinder_geometry::{
|
||||
rect::RectF,
|
||||
vector::{vec2f, Vector2F},
|
||||
};
|
||||
pub use gutter_button::{AddAsContextButton, CommentButton, RevertHunkButton};
|
||||
use parking_lot::Mutex;
|
||||
use pathfinder_color::ColorU;
|
||||
use pathfinder_geometry::rect::RectF;
|
||||
use pathfinder_geometry::vector::{vec2f, Vector2F};
|
||||
|
||||
use super::diff::{DiffHunkDisplay, DiffStatus};
|
||||
use super::model::DiffNavigationState;
|
||||
@@ -1632,26 +1628,22 @@ impl<V: EditorView> Element for EditorWrapper<V> {
|
||||
ctx.notify();
|
||||
}
|
||||
}
|
||||
Some(Event::LeftMouseDown { position, .. }) => {
|
||||
if !gutter_handled {
|
||||
let in_bound = self
|
||||
.gutter_element_range_containing_position(*position, false)
|
||||
.is_some();
|
||||
self.state_handle
|
||||
.in_click
|
||||
.store(in_bound, Ordering::Relaxed);
|
||||
}
|
||||
Some(Event::LeftMouseDown { position, .. }) if !gutter_handled => {
|
||||
let in_bound = self
|
||||
.gutter_element_range_containing_position(*position, false)
|
||||
.is_some();
|
||||
self.state_handle
|
||||
.in_click
|
||||
.store(in_bound, Ordering::Relaxed);
|
||||
}
|
||||
Some(Event::LeftMouseUp { position, .. }) => {
|
||||
if !gutter_handled {
|
||||
let was_clicking = self.state_handle.in_click.swap(false, Ordering::Relaxed);
|
||||
Some(Event::LeftMouseUp { position, .. }) if !gutter_handled => {
|
||||
let was_clicking = self.state_handle.in_click.swap(false, Ordering::Relaxed);
|
||||
|
||||
if was_clicking {
|
||||
if let Some(gutter_range) =
|
||||
self.gutter_element_range_containing_position(*position, false)
|
||||
{
|
||||
(self.click_handler)(gutter_range, ctx);
|
||||
}
|
||||
if was_clicking {
|
||||
if let Some(gutter_range) =
|
||||
self.gutter_element_range_containing_position(*position, false)
|
||||
{
|
||||
(self.click_handler)(gutter_range, ctx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,6 @@ use galaxy_editor::content::markdown::MarkdownStyle;
|
||||
use galaxy_editor::editor::EmbeddedItemModel;
|
||||
use galaxy_editor::render::element::{RenderContext, RenderableBlock};
|
||||
use galaxy_editor::render::layout::TextLayout;
|
||||
use pathfinder_geometry::vector::{vec2f, Vector2F};
|
||||
use serde_yaml::Mapping;
|
||||
use uuid::Uuid;
|
||||
use galaxy_editor::render::model::viewport::ViewportItem;
|
||||
use galaxy_editor::render::model::{
|
||||
BlockSpacing, EmbeddedItem, EmbeddedItemHTMLRepresentation, EmbeddedItemRichFormat,
|
||||
@@ -18,6 +15,9 @@ use galaxy_editor::render::model::{
|
||||
use galaxyui::event::DispatchedEvent;
|
||||
use galaxyui::units::Pixels;
|
||||
use galaxyui::{AppContext, EntityId, EventContext, LayoutContext, ViewHandle, WindowId};
|
||||
use pathfinder_geometry::vector::{vec2f, Vector2F};
|
||||
use serde_yaml::Mapping;
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::code::editor::comment_editor::CommentEditor;
|
||||
use crate::code_review::comments::CommentId;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
use pathfinder_color::ColorU;
|
||||
use warp_editor::editor::NavigationKey;
|
||||
use warp_editor::search::{SearchEvent, Searcher};
|
||||
pub use warpui::accessibility::{AccessibilityContent, WarpA11yRole};
|
||||
pub use warpui::accessibility::{AccessibilityContent, GalaxyA11yRole};
|
||||
use warpui::elements::{
|
||||
Align, Border, ChildAnchor, Clipped, ConstrainedBox, Container, CornerRadius,
|
||||
CrossAxisAlignment, DropShadow, Element, Flex, Hoverable, MainAxisAlignment, MouseStateHandle,
|
||||
@@ -318,11 +318,8 @@ impl CodeEditorFind {
|
||||
EditorEvent::Escape => {
|
||||
self.close_find_bar(ctx);
|
||||
}
|
||||
EditorEvent::Navigate(NavigationKey::Tab) => {
|
||||
// If replace editor is currently open and the user presses 'tab', focus on the find editor
|
||||
if self.is_replace_open {
|
||||
ctx.focus(&self.replace_editor);
|
||||
}
|
||||
EditorEvent::Navigate(NavigationKey::Tab) if self.is_replace_open => {
|
||||
ctx.focus(&self.replace_editor);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use galaxy_editor::render::model::{LineCount, RenderLineLocation};
|
||||
use std::ops::Range;
|
||||
|
||||
use galaxy_editor::render::model::{LineCount, RenderLineLocation};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum EditorLineLocation {
|
||||
|
||||
@@ -9,24 +9,6 @@ use std::sync::Arc;
|
||||
use std::{cmp, mem};
|
||||
|
||||
use ai::diff_validation::DiffDelta;
|
||||
use itertools::Itertools;
|
||||
use languages::{language_by_filename, language_by_local_filename, language_by_name, Language};
|
||||
use line_ending::LineEnding;
|
||||
use num_traits::SaturatingSub;
|
||||
use rangemap::{RangeMap, RangeSet};
|
||||
use string_offset::CharOffset;
|
||||
use syntax_tree::{ColorMap, DecorationStateEvent, SyntaxTreeState};
|
||||
use vec1::{vec1, Vec1};
|
||||
use vim::vim::{
|
||||
BracketChar, CharacterMotion, Direction, FindCharMotion, FirstNonWhitespaceMotion,
|
||||
InsertPosition, LineMotion, MotionType, TextObjectInclusion, TextObjectType, VimOperator,
|
||||
VimTextObject, WordBound, WordMotion, WordType,
|
||||
};
|
||||
use vim::{
|
||||
find_next_paragraph_end, find_previous_paragraph_start, vim_a_block, vim_a_paragraph,
|
||||
vim_a_quote, vim_a_word, vim_find_char_on_line, vim_find_matching_bracket, vim_inner_block,
|
||||
vim_inner_paragraph, vim_inner_quote, vim_inner_word, vim_word_iterator_from_offset,
|
||||
};
|
||||
use galaxy_core::platform::SessionPlatform;
|
||||
use galaxy_core::semantic_selection::SemanticSelection;
|
||||
use galaxy_core::ui::theme::Fill;
|
||||
@@ -62,6 +44,24 @@ use galaxyui::text::point::Point;
|
||||
use galaxyui::text::TextBuffer;
|
||||
use galaxyui::units::{IntoPixels, Pixels};
|
||||
use galaxyui::{AppContext, Entity, ModelContext, ModelHandle, SingletonEntity};
|
||||
use itertools::Itertools;
|
||||
use languages::{language_by_filename, language_by_local_filename, language_by_name, Language};
|
||||
use line_ending::LineEnding;
|
||||
use num_traits::SaturatingSub;
|
||||
use rangemap::{RangeMap, RangeSet};
|
||||
use string_offset::CharOffset;
|
||||
use syntax_tree::{ColorMap, DecorationStateEvent, SyntaxTreeState};
|
||||
use vec1::{vec1, Vec1};
|
||||
use vim::vim::{
|
||||
BracketChar, CharacterMotion, Direction, FindCharMotion, FirstNonWhitespaceMotion,
|
||||
InsertPosition, LineMotion, MotionType, TextObjectInclusion, TextObjectType, VimOperator,
|
||||
VimTextObject, WordBound, WordMotion, WordType,
|
||||
};
|
||||
use vim::{
|
||||
find_next_paragraph_end, find_previous_paragraph_start, vim_a_block, vim_a_paragraph,
|
||||
vim_a_quote, vim_a_word, vim_find_char_on_line, vim_find_matching_bracket, vim_inner_block,
|
||||
vim_inner_paragraph, vim_inner_quote, vim_inner_word, vim_word_iterator_from_offset,
|
||||
};
|
||||
|
||||
use super::super::DiffResult;
|
||||
use super::comments::{EditorCommentsModel, PendingComment, PendingCommentEvent};
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
use std::path::Path;
|
||||
|
||||
use futures::channel::oneshot;
|
||||
use galaxy_util::content_version::ContentVersion;
|
||||
use galaxyui::App;
|
||||
use vec1::vec1;
|
||||
|
||||
use super::*;
|
||||
|
||||
@@ -7,13 +7,6 @@ use std::path::Path;
|
||||
use std::rc::Rc;
|
||||
|
||||
use ai::diff_validation::DiffDelta;
|
||||
use lazy_static::lazy_static;
|
||||
use num_traits::SaturatingSub;
|
||||
use pathfinder_geometry::vector::vec2f;
|
||||
use settings::Setting as _;
|
||||
use string_offset::CharOffset;
|
||||
use vec1::{vec1, Vec1};
|
||||
use vim::vim::{Direction, InsertPosition, VimMode, VimModel, VimState, VimSubscriber};
|
||||
use galaxy_core::platform::SessionPlatform;
|
||||
use galaxy_editor::content::buffer::{
|
||||
Buffer, BufferEditAction, EditOrigin, InitialBufferState, ToBufferCharOffset as _,
|
||||
@@ -52,6 +45,13 @@ use galaxyui::{
|
||||
AppContext, BlurContext, CursorInfo, Element, Entity, FocusContext, ModelHandle,
|
||||
SingletonEntity, View, ViewContext, ViewHandle, WeakViewHandle, WindowId,
|
||||
};
|
||||
use lazy_static::lazy_static;
|
||||
use num_traits::SaturatingSub;
|
||||
use pathfinder_geometry::vector::vec2f;
|
||||
use settings::Setting as _;
|
||||
use string_offset::CharOffset;
|
||||
use vec1::{vec1, Vec1};
|
||||
use vim::vim::{Direction, InsertPosition, VimMode, VimModel, VimState, VimSubscriber};
|
||||
|
||||
use crate::appearance::Appearance;
|
||||
use crate::code::editor::comment_editor::{CommentEditor, CommentEditorEvent};
|
||||
|
||||
@@ -5,9 +5,6 @@ use std::collections::{HashMap, HashSet};
|
||||
use std::fmt::Debug;
|
||||
use std::ops::Range;
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
use rangemap::RangeSet;
|
||||
use string_offset::CharOffset;
|
||||
use galaxy_editor::content::version::BufferVersion;
|
||||
use galaxy_editor::editor::{EmbeddedItemModel, RunnableCommandModel, TextDecoration};
|
||||
use galaxy_editor::model::{CoreEditorModel, PlainTextEditorModel};
|
||||
@@ -21,6 +18,9 @@ use galaxyui::event::ModifiersState;
|
||||
use galaxyui::keymap::{EditableBinding, FixedBinding, Keystroke, PerPlatformKeystroke};
|
||||
use galaxyui::units::Pixels;
|
||||
use galaxyui::{AppContext, TypedActionView, ViewContext, WeakViewHandle};
|
||||
use lazy_static::lazy_static;
|
||||
use rangemap::RangeSet;
|
||||
use string_offset::CharOffset;
|
||||
|
||||
use crate::cmd_or_ctrl_shift;
|
||||
use crate::code::editor::line::EditorLineLocation;
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
use vim::vim::{
|
||||
BracketChar, CharacterMotion, Direction, FindCharMotion, FirstNonWhitespaceMotion,
|
||||
InsertPosition, LineMotion, ModeTransition, MotionType, TextObjectType, VimHandler, VimMode,
|
||||
VimMotion, VimOperand, VimOperator, VimTextObject, WordMotion,
|
||||
};
|
||||
use galaxy_editor::content::buffer::{
|
||||
AutoScrollBehavior, BufferEditAction, EditOrigin, SelectionOffsets, ToBufferCharOffset as _,
|
||||
VimInsertPoint,
|
||||
@@ -13,6 +8,11 @@ use galaxy_editor::selection::{TextDirection, TextUnit};
|
||||
use galaxyui::text::point::Point;
|
||||
use galaxyui::units::IntoPixels;
|
||||
use galaxyui::{SingletonEntity, ViewContext};
|
||||
use vim::vim::{
|
||||
BracketChar, CharacterMotion, Direction, FindCharMotion, FirstNonWhitespaceMotion,
|
||||
InsertPosition, LineMotion, ModeTransition, MotionType, TextObjectType, VimHandler, VimMode,
|
||||
VimMotion, VimOperand, VimOperator, VimTextObject, WordMotion,
|
||||
};
|
||||
|
||||
use super::{CodeEditorEvent, CodeEditorView};
|
||||
use crate::code::editor::find::view::Event as FindViewEvent;
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use pathfinder_geometry::vector::Vector2F;
|
||||
use unindent::Unindent;
|
||||
use vim::vim::{MotionType, VimMode};
|
||||
use galaxy_core::features::FeatureFlag;
|
||||
use galaxy_core::settings::Setting;
|
||||
use galaxy_core::ui::appearance::Appearance;
|
||||
@@ -16,6 +13,9 @@ use galaxyui::platform::WindowStyle;
|
||||
use galaxyui::text::point::Point;
|
||||
use galaxyui::units::IntoPixels;
|
||||
use galaxyui::{App, SingletonEntity, TypedActionView, UpdateModel, ViewHandle};
|
||||
use pathfinder_geometry::vector::Vector2F;
|
||||
use unindent::Unindent;
|
||||
use vim::vim::{MotionType, VimMode};
|
||||
|
||||
use crate::auth::AuthStateProvider;
|
||||
use crate::cloud_object::model::persistence::CloudModel;
|
||||
|
||||
@@ -4,22 +4,12 @@ use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
|
||||
use editing::sort_entries_for_file_tree;
|
||||
use galaxy_util::path::LineAndColumnArg;
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use itertools::Itertools;
|
||||
use pathfinder_geometry::rect::RectF;
|
||||
use pathfinder_geometry::vector::Vector2F;
|
||||
use render::RenderState;
|
||||
use repo_metadata::file_tree_store::{
|
||||
FileTreeDirectoryEntryState, FileTreeEntryState, FileTreeFileMetadata,
|
||||
};
|
||||
use repo_metadata::local_model::IndexedRepoState;
|
||||
use repo_metadata::repositories::DetectedRepositories;
|
||||
use repo_metadata::{FileTreeEntry, RepoMetadataModel};
|
||||
use galaxy_core::features::FeatureFlag;
|
||||
use galaxy_core::ui::theme::color::internal_colors;
|
||||
use galaxy_core::ui::theme::Fill;
|
||||
use galaxy_core::{send_telemetry_from_ctx, HostId};
|
||||
use galaxy_util::path::LineAndColumnArg;
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use galaxyui::clipboard::ClipboardContent;
|
||||
use galaxyui::elements::{
|
||||
AcceptedByDropTarget, Align, ChildAnchor, ChildView, Clipped, ConstrainedBox, Container,
|
||||
@@ -37,6 +27,16 @@ use galaxyui::{
|
||||
id, AppContext, BlurContext, Element, Entity, EventContext, ModelHandle, SingletonEntity as _,
|
||||
TypedActionView, View, ViewContext, ViewHandle, WeakViewHandle,
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use pathfinder_geometry::rect::RectF;
|
||||
use pathfinder_geometry::vector::Vector2F;
|
||||
use render::RenderState;
|
||||
use repo_metadata::file_tree_store::{
|
||||
FileTreeDirectoryEntryState, FileTreeEntryState, FileTreeFileMetadata,
|
||||
};
|
||||
use repo_metadata::local_model::IndexedRepoState;
|
||||
use repo_metadata::repositories::DetectedRepositories;
|
||||
use repo_metadata::{FileTreeEntry, RepoMetadataModel};
|
||||
|
||||
use crate::appearance::Appearance;
|
||||
use crate::code::active_file::{ActiveFileEvent, ActiveFileModel};
|
||||
@@ -371,8 +371,8 @@ impl FileTreeView {
|
||||
// workspace via `set_remote_root_directories`.
|
||||
let existing_remote_ids: Vec<_> = self
|
||||
.root_directories
|
||||
.iter()
|
||||
.filter_map(|(_, root_dir)| {
|
||||
.values()
|
||||
.filter_map(|root_dir| {
|
||||
let host_id = root_dir.remote_host_id.as_ref()?;
|
||||
Some(repo_metadata::RemoteRepositoryIdentifier::new(
|
||||
host_id.clone(),
|
||||
|
||||
@@ -7,11 +7,11 @@ mod tests;
|
||||
use std::cmp::Ordering;
|
||||
use std::sync::Arc;
|
||||
|
||||
use repo_metadata::file_tree_store::FileTreeEntryState;
|
||||
use repo_metadata::{FileMetadata, FileTreeEntry};
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use galaxyui::elements::MouseStateHandle;
|
||||
use galaxyui::ViewContext;
|
||||
use repo_metadata::file_tree_store::FileTreeEntryState;
|
||||
use repo_metadata::{FileMetadata, FileTreeEntry};
|
||||
|
||||
use super::{FileTreeIdentifier, FileTreeItem, FileTreeView};
|
||||
use crate::code::file_tree::view::{PendingEdit, PendingEditKind};
|
||||
@@ -29,7 +29,6 @@ pub(super) fn sort_entries_for_file_tree(
|
||||
entry_2: &StandardizedPath,
|
||||
entry_map: &FileTreeEntry,
|
||||
) -> Ordering {
|
||||
|
||||
// Entries missing from the map sort before present entries, and compare
|
||||
// equal to each other. Using the same `Ordering` on both sides would
|
||||
// violate antisymmetry and cause `sorted_by` to panic with
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use galaxy_core::ui::appearance::Appearance;
|
||||
use galaxyui::{platform::WindowStyle, App, ModelHandle};
|
||||
use galaxyui::platform::WindowStyle;
|
||||
use galaxyui::{App, ModelHandle, SingletonEntity};
|
||||
use repo_metadata::entry::{DirectoryEntry, Entry, FileMetadata};
|
||||
use repo_metadata::file_tree_store::FileTreeState;
|
||||
use repo_metadata::local_model::IndexedRepoState;
|
||||
@@ -10,8 +11,6 @@ use repo_metadata::watcher::DirectoryWatcher;
|
||||
use repo_metadata::RepoMetadataModel;
|
||||
use settings::Setting;
|
||||
use virtual_fs::{Stub, VirtualFS};
|
||||
use galaxyui::platform::WindowStyle;
|
||||
use galaxyui::{App, ModelHandle, SingletonEntity};
|
||||
|
||||
use super::FileTreeView;
|
||||
use crate::auth::AuthStateProvider;
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
use std::collections::HashMap;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use lsp::ReferenceLocation;
|
||||
use pathfinder_geometry::vector::Vector2F;
|
||||
use string_offset::CharOffset;
|
||||
use galaxy_core::ui::appearance::Appearance;
|
||||
use galaxy_core::ui::icons::Icon as WarpIcon;
|
||||
use galaxy_core::ui::theme::color::internal_colors;
|
||||
@@ -28,6 +25,9 @@ use galaxyui::ui_components::components::UiComponent;
|
||||
use galaxyui::{
|
||||
AppContext, Element, Entity, SingletonEntity, TypedActionView, View, ViewContext, ViewHandle,
|
||||
};
|
||||
use lsp::ReferenceLocation;
|
||||
use pathfinder_geometry::vector::Vector2F;
|
||||
use string_offset::CharOffset;
|
||||
|
||||
use super::editor::view::{CodeEditorRenderOptions, CodeEditorView};
|
||||
use super::global_buffer_model::GlobalBufferModel;
|
||||
@@ -517,7 +517,7 @@ fn render_header(
|
||||
let icon_color = theme.sub_text_color(theme.background());
|
||||
let close_button = Hoverable::new(back_mouse_state, move |state| {
|
||||
let close_icon = ConstrainedBox::new(
|
||||
galaxyui::elements::Icon::new(GalaxyIcon::X.into(), icon_color).finish(),
|
||||
galaxyui::elements::Icon::new(WarpIcon::X.into(), icon_color).finish(),
|
||||
)
|
||||
.with_width(16.)
|
||||
.with_height(16.)
|
||||
|
||||
+10
-10
@@ -2,18 +2,9 @@ use std::collections::HashMap;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use galaxy_core::send_telemetry_from_ctx;
|
||||
use lsp::supported_servers::LSPServerType;
|
||||
use lsp::{
|
||||
LanguageId, LanguageServerId, LspManagerModel, LspManagerModelEvent, LspServerModel,
|
||||
LspState as LspModelState,
|
||||
};
|
||||
use pathfinder_color::ColorU;
|
||||
use pathfinder_geometry::vector::vec2f;
|
||||
#[cfg(feature = "local_fs")]
|
||||
use repo_metadata::repositories::DetectedRepositories;
|
||||
use galaxy_core::ui::appearance::Appearance;
|
||||
use galaxy_core::ui::theme::color::internal_colors;
|
||||
use galaxy_core::ui::theme::{AnsiColorIdentifier, Fill as ThemeFill, WarpTheme};
|
||||
use galaxy_core::ui::theme::{AnsiColorIdentifier, Fill as ThemeFill, GalaxyTheme};
|
||||
use galaxy_core::ui::Icon;
|
||||
#[cfg(feature = "local_fs")]
|
||||
use galaxy_util::local_or_remote_path::LocalOrRemotePath;
|
||||
@@ -29,6 +20,15 @@ use galaxyui::{
|
||||
AppContext, Element, Entity, ModelHandle, SingletonEntity, TypedActionView, View, ViewContext,
|
||||
ViewHandle, WeakModelHandle,
|
||||
};
|
||||
use lsp::supported_servers::LSPServerType;
|
||||
use lsp::{
|
||||
LanguageId, LanguageServerId, LspManagerModel, LspManagerModelEvent, LspServerModel,
|
||||
LspState as LspModelState,
|
||||
};
|
||||
use pathfinder_color::ColorU;
|
||||
use pathfinder_geometry::vector::vec2f;
|
||||
#[cfg(feature = "local_fs")]
|
||||
use repo_metadata::repositories::DetectedRepositories;
|
||||
|
||||
#[cfg(feature = "local_fs")]
|
||||
use crate::ai::persisted_workspace::PersistedWorkspaceEvent;
|
||||
|
||||
@@ -7,24 +7,23 @@ use std::time::Duration;
|
||||
use bimap::BiMap;
|
||||
use futures_util::stream::AbortHandle;
|
||||
use galaxy_core::features::FeatureFlag;
|
||||
use galaxy_editor::content::buffer::Buffer;
|
||||
use galaxy_core::safe_error;
|
||||
use galaxy_editor::content::buffer::{Buffer, BufferEvent, ToBufferCharOffset};
|
||||
use galaxy_editor::content::diff::{text_diff, TextDiff};
|
||||
use galaxy_editor::content::edit::PreciseDelta;
|
||||
use galaxy_editor::content::version::BufferVersion;
|
||||
use galaxy_util::content_version::ContentVersion;
|
||||
use galaxy_util::file::{FileId, FileLoadError, FileSaveError};
|
||||
use galaxy_util::host_id::HostId;
|
||||
use galaxy_util::remote_path::RemotePath;
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use galaxyui::r#async::Timer;
|
||||
use galaxyui::{Entity, ModelContext, ModelHandle, SingletonEntity, WeakModelHandle};
|
||||
use lsp::types::TextDocumentContentChangeEvent;
|
||||
use lsp::{LspManagerModel, LspServerLogLevel, LspServerModel};
|
||||
use remote_server::manager::RemoteServerManager;
|
||||
use string_offset::{ByteOffset, CharOffset};
|
||||
use vec1::vec1;
|
||||
use galaxy_core::safe_error;
|
||||
use galaxy_editor::content::buffer::{Buffer, ToBufferCharOffset};
|
||||
use galaxy_util::host_id::HostId;
|
||||
use galaxy_util::remote_path::RemotePath;
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use galaxyui::r#async::Timer;
|
||||
|
||||
use super::buffer_location::{LocalOrRemotePath, SyncClock};
|
||||
|
||||
@@ -1208,7 +1207,6 @@ impl GlobalBufferModel {
|
||||
|
||||
let path_clone = path.to_path_buf();
|
||||
ctx.subscribe_to_model(&buffer, move |me, _, event, ctx| {
|
||||
|
||||
let Some(state) = me.buffers.get(&file_id) else {
|
||||
me.log_lsp_sync_debug(
|
||||
&path_clone,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use galaxy_files::FileModel;
|
||||
use lsp::LspManagerModel;
|
||||
use remote_server::proto::TextEdit;
|
||||
use repo_metadata::repositories::DetectedRepositories;
|
||||
use repo_metadata::watcher::DirectoryWatcher;
|
||||
use repo_metadata::RepoMetadataModel;
|
||||
use warp_files::FileModel;
|
||||
use warp_util::content_version::ContentVersion;
|
||||
use warp_util::host_id::HostId;
|
||||
use warp_util::standardized_path::StandardizedPath;
|
||||
|
||||
@@ -81,11 +81,9 @@ impl InlineDiffView {
|
||||
CodeEditorEvent::UnifiedDiffComputed(diff) => {
|
||||
ctx.emit(InlineDiffViewEvent::DiffAccepted { diff: diff.clone() });
|
||||
}
|
||||
CodeEditorEvent::ContentChanged { origin } => {
|
||||
if origin.from_user() && !me.was_edited {
|
||||
me.was_edited = true;
|
||||
ctx.emit(InlineDiffViewEvent::UserEdited);
|
||||
}
|
||||
CodeEditorEvent::ContentChanged { origin } if origin.from_user() && !me.was_edited => {
|
||||
me.was_edited = true;
|
||||
ctx.emit(InlineDiffViewEvent::UserEdited);
|
||||
}
|
||||
_ => {}
|
||||
});
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
use lsp::{HoverContents, LspServerLogLevel, MarkupKind};
|
||||
use markdown_parser::{FormattedText, FormattedTextFragment, FormattedTextLine};
|
||||
use num_traits::SaturatingSub;
|
||||
use string_offset::CharOffset;
|
||||
use galaxy_core::send_telemetry_from_ctx;
|
||||
use galaxy_core::ui::appearance::Appearance;
|
||||
use galaxy_core::ui::theme::color::internal_colors;
|
||||
use galaxy_core::ui::theme::WarpTheme;
|
||||
use galaxy_core::ui::theme::GalaxyTheme;
|
||||
use galaxy_editor::content::buffer::InitialBufferState;
|
||||
use galaxy_editor::render::element::VerticalExpansionBehavior;
|
||||
use galaxy_editor::render::model::Decoration;
|
||||
@@ -15,6 +11,10 @@ use galaxyui::elements::{
|
||||
MouseStateHandle, ParentElement, Radius, Rect, ScrollbarWidth,
|
||||
};
|
||||
use galaxyui::{AppContext, Element, SingletonEntity, ViewContext};
|
||||
use lsp::{HoverContents, LspServerLogLevel, MarkupKind};
|
||||
use markdown_parser::{FormattedText, FormattedTextFragment, FormattedTextLine};
|
||||
use num_traits::SaturatingSub;
|
||||
use string_offset::CharOffset;
|
||||
|
||||
use super::editor::view::{CodeEditorRenderOptions, CodeEditorView};
|
||||
use super::lsp_telemetry::LspTelemetryEvent;
|
||||
|
||||
@@ -11,23 +11,6 @@ use std::{
|
||||
|
||||
use ai::diff_validation::DiffType;
|
||||
use futures::stream::AbortHandle;
|
||||
use lsp::types::FileLocation;
|
||||
use lsp::{
|
||||
LanguageId, LanguageServerId, LspEvent, LspManagerModel, LspManagerModelEvent, LspServerModel,
|
||||
ReferenceLocation,
|
||||
};
|
||||
use lsp_types::FormattingOptions;
|
||||
use markdown_parser::FormattedText;
|
||||
use num_traits::SaturatingSub;
|
||||
use pathfinder_color::ColorU;
|
||||
use pathfinder_geometry::rect::RectF;
|
||||
use pathfinder_geometry::vector::Vector2F;
|
||||
use remote_server::manager::RemoteServerManager;
|
||||
#[cfg(feature = "local_fs")]
|
||||
use repo_metadata::repositories::DetectedRepositories;
|
||||
use string_offset::CharOffset;
|
||||
use vec1::Vec1;
|
||||
use vim::vim::{MotionType, VimMode};
|
||||
use galaxy_core::features::FeatureFlag;
|
||||
use galaxy_core::r#async::debounce;
|
||||
use galaxy_core::ui::appearance::Appearance;
|
||||
@@ -57,9 +40,28 @@ use galaxyui::{
|
||||
AppContext, Element, Entity, ModelHandle, SingletonEntity, TypedActionView, View, ViewContext,
|
||||
ViewHandle, WindowId,
|
||||
};
|
||||
use lsp::types::FileLocation;
|
||||
use lsp::{
|
||||
LanguageId, LanguageServerId, LspEvent, LspManagerModel, LspManagerModelEvent, LspServerModel,
|
||||
ReferenceLocation,
|
||||
};
|
||||
use lsp_types::FormattingOptions;
|
||||
use markdown_parser::FormattedText;
|
||||
use num_traits::SaturatingSub;
|
||||
use pathfinder_color::ColorU;
|
||||
use pathfinder_geometry::rect::RectF;
|
||||
use pathfinder_geometry::vector::Vector2F;
|
||||
use remote_server::manager::RemoteServerManager;
|
||||
#[cfg(feature = "local_fs")]
|
||||
use repo_metadata::repositories::DetectedRepositories;
|
||||
use string_offset::CharOffset;
|
||||
use vec1::Vec1;
|
||||
use vim::vim::{MotionType, VimMode};
|
||||
|
||||
use crate::ai::persisted_workspace::{PersistedWorkspace, PersistedWorkspaceEvent};
|
||||
use crate::ai::persisted_workspace::{LspTask, PersistedWorkspace, PersistedWorkspaceEvent};
|
||||
use crate::code::buffer_location::LocalOrRemotePath as BufferFileLocation;
|
||||
use crate::code::code_actions::{CodeActionsState, CODE_ACTIONS_DEBOUNCE_PERIOD};
|
||||
use crate::code::completion::{CompletionState, COMPLETION_DEBOUNCE_PERIOD};
|
||||
use crate::code::editor::model::HoverableLink;
|
||||
use crate::code::editor::EditorReviewComment;
|
||||
use crate::code::footer::{CodeFooterView, CodeFooterViewEvent};
|
||||
@@ -1165,7 +1167,7 @@ impl LocalCodeEditorView {
|
||||
}
|
||||
|
||||
// Sort edits by start position in reverse order to avoid offset shifting issues
|
||||
edits.sort_by(|a, b| b.1.start.cmp(&a.1.start));
|
||||
edits.sort_by_key(|b| std::cmp::Reverse(b.1.start));
|
||||
|
||||
if let Ok(edits) = Vec1::try_from_vec(edits) {
|
||||
editor.apply_edits(edits, ctx);
|
||||
@@ -1472,7 +1474,6 @@ impl LocalCodeEditorView {
|
||||
/// 5. Starting the LSP server via PersistedWorkspace
|
||||
#[cfg(feature = "local_fs")]
|
||||
fn enable_lsp_for_path(path: &Path, ctx: &mut ViewContext<Self>) {
|
||||
|
||||
// Get the language ID from the file path
|
||||
let Some(language_id) = LanguageId::from_path(path) else {
|
||||
log::warn!("Enable lsp for path should only work for supported file paths");
|
||||
@@ -1516,7 +1517,6 @@ impl LocalCodeEditorView {
|
||||
/// and emits events that are handled by handle_persisted_workspace_event.
|
||||
#[cfg(feature = "local_fs")]
|
||||
fn install_and_enable_lsp_for_path(path: &Path, ctx: &mut ViewContext<Self>) {
|
||||
|
||||
let Some(language_id) = LanguageId::from_path(path) else {
|
||||
log::warn!("Install and enable lsp for path should only work for supported file paths");
|
||||
return;
|
||||
|
||||
+1
-1
@@ -2,10 +2,10 @@ use std::any::Any;
|
||||
use std::fmt::Debug;
|
||||
use std::ops::AddAssign;
|
||||
|
||||
use pathfinder_geometry::rect::RectF;
|
||||
use galaxy_util::file::FileSaveError;
|
||||
use galaxyui::elements::DropTargetData;
|
||||
use galaxyui::AppContext;
|
||||
use pathfinder_geometry::rect::RectF;
|
||||
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
pub mod code_actions;
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
use galaxy_util::local_or_remote_path::LocalOrRemotePath;
|
||||
use galaxyui::{Entity, ModelContext, SingletonEntity};
|
||||
use instant::Instant;
|
||||
use galaxy_util::local_or_remote_path::LocalOrRemotePath;
|
||||
|
||||
/// Tracks opened files within a single repository.
|
||||
/// Keys are repo-relative file paths (e.g. `src/main.rs`).
|
||||
|
||||
@@ -6,11 +6,12 @@ use lsp::types::Location;
|
||||
use string_offset::CharOffset;
|
||||
use vec1::Vec1;
|
||||
|
||||
use super::local_code_editor::LocalCodeEditorView;
|
||||
use crate::editor::{EditorView, Event as EditorEvent, SingleLineEditorOptions, TextOptions};
|
||||
|
||||
use super::local_code_editor::LocalCodeEditorView;
|
||||
|
||||
#[derive(Default)]
|
||||
pub(super) enum RenameState {
|
||||
#[default]
|
||||
Idle,
|
||||
Preparing {
|
||||
abort_handle: AbortHandle,
|
||||
@@ -24,12 +25,6 @@ pub(super) enum RenameState {
|
||||
},
|
||||
}
|
||||
|
||||
impl Default for RenameState {
|
||||
fn default() -> Self {
|
||||
Self::Idle
|
||||
}
|
||||
}
|
||||
|
||||
impl RenameState {
|
||||
pub fn dismiss(&mut self) -> bool {
|
||||
match self {
|
||||
@@ -262,7 +257,7 @@ impl LocalCodeEditorView {
|
||||
return;
|
||||
}
|
||||
|
||||
edits_for_current_file.sort_by(|a, b| b.1.start.cmp(&a.1.start));
|
||||
edits_for_current_file.sort_by_key(|b| std::cmp::Reverse(b.1.start));
|
||||
|
||||
if let Ok(edits) = Vec1::try_from_vec(edits_for_current_file) {
|
||||
self.editor.update(ctx, |editor, ctx| {
|
||||
|
||||
@@ -16,7 +16,9 @@ use super::local_code_editor::LocalCodeEditorView;
|
||||
const SIGNATURE_HELP_MAX_WIDTH: f32 = 500.;
|
||||
|
||||
/// State for signature help display.
|
||||
#[derive(Default)]
|
||||
pub(super) enum SignatureHelpState {
|
||||
#[default]
|
||||
None,
|
||||
Loading(Option<AbortHandle>),
|
||||
Showing {
|
||||
@@ -25,12 +27,6 @@ pub(super) enum SignatureHelpState {
|
||||
},
|
||||
}
|
||||
|
||||
impl Default for SignatureHelpState {
|
||||
fn default() -> Self {
|
||||
Self::None
|
||||
}
|
||||
}
|
||||
|
||||
impl SignatureHelpState {
|
||||
pub fn clear(&mut self) -> bool {
|
||||
if matches!(self, Self::None) {
|
||||
@@ -73,10 +69,8 @@ impl LocalCodeEditorView {
|
||||
Some('(') | Some(',') => {
|
||||
self.request_signature_help(cursor_offset, ctx);
|
||||
}
|
||||
Some(')') => {
|
||||
if self.signature_help_state.clear() {
|
||||
ctx.notify();
|
||||
}
|
||||
Some(')') if self.signature_help_state.clear() => {
|
||||
ctx.notify();
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
use std::collections::HashMap;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use lsp::LspManagerModel;
|
||||
use pathfinder_color::ColorU;
|
||||
use pathfinder_geometry::rect::RectF;
|
||||
use pathfinder_geometry::vector::vec2f;
|
||||
use galaxy_core::channel::{Channel, ChannelState};
|
||||
use galaxy_core::features::FeatureFlag;
|
||||
use galaxy_core::ui::appearance::Appearance;
|
||||
@@ -30,6 +26,10 @@ use galaxyui::{
|
||||
id, AppContext, Element, Entity, ModelHandle, SingletonEntity, TypedActionView, View,
|
||||
ViewContext, ViewHandle, WindowId,
|
||||
};
|
||||
use lsp::LspManagerModel;
|
||||
use pathfinder_color::ColorU;
|
||||
use pathfinder_geometry::rect::RectF;
|
||||
use pathfinder_geometry::vector::vec2f;
|
||||
|
||||
use super::buffer_location::LocalOrRemotePath;
|
||||
use super::diff_viewer::DiffViewer;
|
||||
|
||||
Reference in New Issue
Block a user