Don't export platform::* from gpui

I'd like to avoid cluttering the top-level namespace with all the platform-
specific types.
This commit is contained in:
Nathan Sobo 2023-04-07 11:41:39 -06:00
parent f450692e77
commit 2615a11f7c
73 changed files with 284 additions and 210 deletions

View file

@ -39,11 +39,10 @@ use gpui::{
geometry::vector::Vector2F,
impl_actions, impl_internal_actions,
keymap_matcher::KeymapContext,
platform::CursorStyle,
platform::{CursorStyle, MouseButton},
serde_json::{self, json},
AnyViewHandle, AppContext, AsyncAppContext, ClipboardItem, Element, ElementBox, Entity,
ModelHandle, MouseButton, RenderContext, Subscription, Task, View, ViewContext, ViewHandle,
WeakViewHandle,
ModelHandle, RenderContext, Subscription, Task, View, ViewContext, ViewHandle, WeakViewHandle,
};
use highlight_matching_bracket::refresh_matching_bracket_highlights;
use hover_popover::{hide_hover, HideHover, HoverState};
@ -6866,7 +6865,7 @@ impl View for Editor {
fn modifiers_changed(
&mut self,
event: &gpui::ModifiersChangedEvent,
event: &gpui::platform::ModifiersChangedEvent,
cx: &mut ViewContext<Self>,
) -> bool {
let pending_selection = self.has_pending_selection();

View file

@ -29,11 +29,10 @@ use gpui::{
PathBuilder,
},
json::{self, ToJson},
platform::CursorStyle,
platform::{CursorStyle, Modifiers, MouseButton, MouseButtonEvent, MouseMovedEvent},
text_layout::{self, Line, RunStyle, TextLayoutCache},
AppContext, Axis, Border, CursorRegion, Element, ElementBox, EventContext, LayoutContext,
Modifiers, MouseButton, MouseButtonEvent, MouseMovedEvent, MouseRegion, PaintContext, Quad,
SceneBuilder, SizeConstraint, ViewContext, WeakViewHandle,
MouseRegion, PaintContext, Quad, SceneBuilder, SizeConstraint, ViewContext, WeakViewHandle,
};
use itertools::Itertools;
use json::json;

View file

@ -3,9 +3,8 @@ use gpui::{
actions,
elements::{Flex, MouseEventHandler, Padding, Text},
impl_internal_actions,
platform::CursorStyle,
AppContext, Axis, Element, ElementBox, ModelHandle, MouseButton, RenderContext, Task,
ViewContext,
platform::{CursorStyle, MouseButton},
AppContext, Axis, Element, ElementBox, ModelHandle, RenderContext, Task, ViewContext,
};
use language::{Bias, DiagnosticEntry, DiagnosticSeverity};
use project::{HoverBlock, Project};

View file

@ -358,7 +358,10 @@ fn go_to_fetched_definition_of_kind(
#[cfg(test)]
mod tests {
use futures::StreamExt;
use gpui::{Modifiers, ModifiersChangedEvent, View};
use gpui::{
platform::{self, Modifiers, ModifiersChangedEvent},
View,
};
use indoc::indoc;
use lsp::request::{GotoDefinition, GotoTypeDefinition};
@ -430,7 +433,7 @@ mod tests {
// Unpress shift causes highlight to go away (normal goto-definition is not valid here)
cx.update_editor(|editor, cx| {
editor.modifiers_changed(
&gpui::ModifiersChangedEvent {
&platform::ModifiersChangedEvent {
modifiers: Modifiers {
cmd: true,
..Default::default()