diff --git a/crates/anthropic/src/anthropic.rs b/crates/anthropic/src/anthropic.rs index 1dd447a1c9..8100cbe5c8 100644 --- a/crates/anthropic/src/anthropic.rs +++ b/crates/anthropic/src/anthropic.rs @@ -250,7 +250,7 @@ pub async fn stream_completion( .map(|output| output.0) } -/// https://docs.anthropic.com/en/api/rate-limits#response-headers +/// #[derive(Debug)] pub struct RateLimitInfo { pub requests_limit: usize, @@ -626,7 +626,7 @@ pub struct ApiError { } /// An Anthropic API error code. -/// https://docs.anthropic.com/en/api/errors#http-errors +/// #[derive(Debug, PartialEq, Eq, Clone, Copy, EnumString)] #[strum(serialize_all = "snake_case")] pub enum ApiErrorCode { diff --git a/crates/anthropic/src/supported_countries.rs b/crates/anthropic/src/supported_countries.rs index 0b674cac51..052dce3f4b 100644 --- a/crates/anthropic/src/supported_countries.rs +++ b/crates/anthropic/src/supported_countries.rs @@ -3,7 +3,7 @@ use std::sync::LazyLock; /// Returns whether the given country code is supported by Anthropic. /// -/// https://www.anthropic.com/supported-countries +/// pub fn is_supported_country(country_code: &str) -> bool { SUPPORTED_COUNTRIES.contains(&country_code) } diff --git a/crates/assistant_context_editor/src/slash_command.rs b/crates/assistant_context_editor/src/slash_command.rs index 6cecc9470c..a58b57dc48 100644 --- a/crates/assistant_context_editor/src/slash_command.rs +++ b/crates/assistant_context_editor/src/slash_command.rs @@ -5,7 +5,7 @@ use assistant_slash_command::{AfterCompletion, SlashCommandLine, SlashCommandWor use editor::{CompletionProvider, Editor}; use fuzzy::{match_strings, StringMatchCandidate}; use gpui::{App, Context, Entity, Task, WeakEntity, Window}; -use language::{Anchor, Buffer, Documentation, LanguageServerId, ToPoint}; +use language::{Anchor, Buffer, CompletionDocumentation, LanguageServerId, ToPoint}; use parking_lot::Mutex; use project::CompletionIntent; use rope::Point; @@ -120,7 +120,9 @@ impl SlashCommandCompletionProvider { }); Some(project::Completion { old_range: name_range.clone(), - documentation: Some(Documentation::SingleLine(command.description())), + documentation: Some(CompletionDocumentation::SingleLine( + command.description(), + )), new_text, label: command.label(cx), server_id: LanguageServerId(0), diff --git a/crates/assistant_settings/src/assistant_settings.rs b/crates/assistant_settings/src/assistant_settings.rs index 3193e09ae5..56e801fad3 100644 --- a/crates/assistant_settings/src/assistant_settings.rs +++ b/crates/assistant_settings/src/assistant_settings.rs @@ -434,7 +434,7 @@ pub struct LegacyAssistantSettingsContent { pub default_open_ai_model: Option, /// OpenAI API base URL to use when creating new chats. /// - /// Default: https://api.openai.com/v1 + /// Default: pub openai_api_url: Option, } diff --git a/crates/editor/src/code_context_menus.rs b/crates/editor/src/code_context_menus.rs index c8cc4872d8..401ca95e6d 100644 --- a/crates/editor/src/code_context_menus.rs +++ b/crates/editor/src/code_context_menus.rs @@ -5,7 +5,7 @@ use gpui::{ Size, StrikethroughStyle, StyledText, UniformListScrollHandle, WeakEntity, }; use language::Buffer; -use language::{CodeLabel, Documentation}; +use language::{CodeLabel, CompletionDocumentation}; use lsp::LanguageServerId; use multi_buffer::{Anchor, ExcerptId}; use ordered_float::OrderedFloat; @@ -474,7 +474,7 @@ impl CompletionsMenu { let documentation = &completion.documentation; let mut len = completion.label.text.chars().count(); - if let Some(Documentation::SingleLine(text)) = documentation { + if let Some(CompletionDocumentation::SingleLine(text)) = documentation { if show_completion_documentation { len += text.chars().count(); } @@ -558,7 +558,9 @@ impl CompletionsMenu { StyledText::new(completion.label.text.clone()) .with_highlights(&style.text, highlights); let documentation_label = - if let Some(Documentation::SingleLine(text)) = documentation { + if let Some(CompletionDocumentation::SingleLine(text)) = + documentation + { if text.trim().is_empty() { None } else { @@ -710,20 +712,23 @@ impl CompletionsMenu { .documentation .as_ref()? { - Documentation::MultiLinePlainText(text) => { + CompletionDocumentation::MultiLinePlainText(text) => { div().child(SharedString::from(text.clone())) } - Documentation::MultiLineMarkdown(parsed) if !parsed.text.is_empty() => div() - .child(render_parsed_markdown( + CompletionDocumentation::MultiLineMarkdown(parsed) + if !parsed.text.is_empty() => + { + div().child(render_parsed_markdown( "completions_markdown", parsed, &style, workspace, cx, - )), - Documentation::MultiLineMarkdown(_) => return None, - Documentation::SingleLine(_) => return None, - Documentation::Undocumented => return None, + )) + } + CompletionDocumentation::MultiLineMarkdown(_) => return None, + CompletionDocumentation::SingleLine(_) => return None, + CompletionDocumentation::Undocumented => return None, } } CompletionEntry::InlineCompletionHint(InlineCompletionMenuHint::Loaded { text }) => { diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 86fbdefbd5..c3a7b20ec9 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -96,9 +96,9 @@ use itertools::Itertools; use language::{ language_settings::{self, all_language_settings, language_settings, InlayHintSettings}, markdown, point_from_lsp, AutoindentMode, BracketPair, Buffer, Capability, CharKind, CodeLabel, - CursorShape, Diagnostic, Documentation, EditPreview, HighlightedText, IndentKind, IndentSize, - Language, OffsetRangeExt, Point, Selection, SelectionGoal, TextObject, TransactionId, - TreeSitterOptions, + CompletionDocumentation, CursorShape, Diagnostic, EditPreview, HighlightedText, IndentKind, + IndentSize, Language, OffsetRangeExt, Point, Selection, SelectionGoal, TextObject, + TransactionId, TreeSitterOptions, }; use language::{point_to_lsp, BufferRow, CharClassifier, Runnable, RunnableRange}; use linked_editing_ranges::refresh_linked_ranges; @@ -14723,7 +14723,10 @@ fn snippet_completions( filter_range: 0..matching_prefix.len(), }, server_id: LanguageServerId(usize::MAX), - documentation: snippet.description.clone().map(Documentation::SingleLine), + documentation: snippet + .description + .clone() + .map(CompletionDocumentation::SingleLine), lsp_completion: lsp::CompletionItem { label: snippet.prefix.first().unwrap().clone(), kind: Some(CompletionItemKind::SNIPPET), diff --git a/crates/google_ai/src/supported_countries.rs b/crates/google_ai/src/supported_countries.rs index 231b99d82a..d9d40ef563 100644 --- a/crates/google_ai/src/supported_countries.rs +++ b/crates/google_ai/src/supported_countries.rs @@ -3,7 +3,7 @@ use std::sync::LazyLock; /// Returns whether the given country code is supported by Google Gemini. /// -/// https://ai.google.dev/gemini-api/docs/available-regions +/// pub fn is_supported_country(country_code: &str) -> bool { SUPPORTED_COUNTRIES.contains(&country_code) } diff --git a/crates/gpui/src/app.rs b/crates/gpui/src/app.rs index ee673e578c..828836efad 100644 --- a/crates/gpui/src/app.rs +++ b/crates/gpui/src/app.rs @@ -1418,7 +1418,7 @@ impl App { } /// Dispatch an action to the currently active window or global action handler - /// See [action::Action] for more information on how actions work + /// See [`crate::Action`] for more information on how actions work pub fn dispatch_action(&mut self, action: &dyn Action) { if let Some(active_window) = self.active_window() { active_window diff --git a/crates/gpui/src/color.rs b/crates/gpui/src/color.rs index 230eca3e6b..089caf1585 100644 --- a/crates/gpui/src/color.rs +++ b/crates/gpui/src/color.rs @@ -559,8 +559,8 @@ pub(crate) enum BackgroundTag { /// A color space for color interpolation. /// /// References: -/// - https://developer.mozilla.org/en-US/docs/Web/CSS/color-interpolation-method -/// - https://www.w3.org/TR/css-color-4/#typedef-color-space +/// - +/// - #[derive(Debug, Clone, Copy, PartialEq, Default)] #[repr(C)] pub enum ColorSpace { @@ -622,7 +622,7 @@ pub fn pattern_slash(color: Hsla) -> Background { /// /// The `angle` is in degrees value in the range 0.0 to 360.0. /// -/// https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient +/// pub fn linear_gradient( angle: f32, from: impl Into, @@ -638,7 +638,7 @@ pub fn linear_gradient( /// A color stop in a linear gradient. /// -/// https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient#linear-color-stop +/// #[derive(Debug, Clone, Copy, Default, PartialEq)] #[repr(C)] pub struct LinearColorStop { @@ -671,7 +671,7 @@ impl LinearColorStop { impl Background { /// Use specified color space for color interpolation. /// - /// https://developer.mozilla.org/en-US/docs/Web/CSS/color-interpolation-method + /// pub fn color_space(mut self, color_space: ColorSpace) -> Self { self.color_space = color_space; self diff --git a/crates/gpui/src/gpui.rs b/crates/gpui/src/gpui.rs index a6d96633be..d57fa9c146 100644 --- a/crates/gpui/src/gpui.rs +++ b/crates/gpui/src/gpui.rs @@ -48,10 +48,10 @@ //! complex applications: //! //! - Actions are user-defined structs that are used for converting keystrokes into logical operations in your UI. -//! Use this for implementing keyboard shortcuts, such as cmd-q. See the [`action`] module for more information. +//! Use this for implementing keyboard shortcuts, such as cmd-q (See `action` module for more information). //! - Platform services, such as `quit the app` or `open a URL` are available as methods on the [`app::App`]. //! - An async executor that is integrated with the platform's event loop. See the [`executor`] module for more information., -//! - The [gpui::test] macro provides a convenient way to write tests for your GPUI applications. Tests also have their +//! - The [`gpui::test`](test) macro provides a convenient way to write tests for your GPUI applications. Tests also have their //! own kind of context, a [`TestAppContext`] which provides ways of simulating common platform input. See [`app::test_context`] //! and [`test`] modules for more details. //! diff --git a/crates/gpui/src/platform/linux/platform.rs b/crates/gpui/src/platform/linux/platform.rs index f675ae2069..2b79c3946a 100644 --- a/crates/gpui/src/platform/linux/platform.rs +++ b/crates/gpui/src/platform/linux/platform.rs @@ -773,7 +773,7 @@ impl crate::Keystroke { /** * Returns which symbol the dead key represents - * https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values#dead_keycodes_for_linux + * */ pub fn underlying_dead_key(keysym: Keysym) -> Option { match keysym { diff --git a/crates/gpui/src/shared_string.rs b/crates/gpui/src/shared_string.rs index 1d55d13ad0..cae375ff57 100644 --- a/crates/gpui/src/shared_string.rs +++ b/crates/gpui/src/shared_string.rs @@ -16,7 +16,7 @@ impl SharedString { Self(ArcCow::Borrowed(str)) } - /// Creates a [`SharedString`] from anything that can become an Arc + /// Creates a [`SharedString`] from anything that can become an `Arc` pub fn new(str: impl Into>) -> Self { SharedString(ArcCow::Owned(str.into())) } diff --git a/crates/gpui_macros/src/gpui_macros.rs b/crates/gpui_macros/src/gpui_macros.rs index a0af5253ff..b74ac3cd63 100644 --- a/crates/gpui_macros/src/gpui_macros.rs +++ b/crates/gpui_macros/src/gpui_macros.rs @@ -143,7 +143,7 @@ pub fn box_shadow_style_methods(input: TokenStream) -> TokenStream { styles::box_shadow_style_methods(input) } -/// #[gpui::test] can be used to annotate test functions that run with GPUI support. +/// `#[gpui::test]` can be used to annotate test functions that run with GPUI support. /// it supports both synchronous and asynchronous tests, and can provide you with /// as many `TestAppContext` instances as you need. /// The output contains a `#[test]` annotation so this can be used with any existing @@ -160,7 +160,7 @@ pub fn box_shadow_style_methods(input: TokenStream) -> TokenStream { /// Using the same `StdRng` for behavior in your test will allow you to exercise a wide /// variety of scenarios and interleavings just by changing the seed. /// -/// #[gpui::test] also takes three different arguments: +/// `#[gpui::test]` also takes three different arguments: /// - `#[gpui::test(iterations=10)]` will run the test ten times with a different initial SEED. /// - `#[gpui::test(retries=3)]` will run the test up to four times if it fails to try and make it pass. /// - `#[gpui::test(on_failure="crate::test::report_failure")]` will call the specified function after the diff --git a/crates/http_client/src/async_body.rs b/crates/http_client/src/async_body.rs index 6e3bfe4d3c..caf8089d0f 100644 --- a/crates/http_client/src/async_body.rs +++ b/crates/http_client/src/async_body.rs @@ -8,7 +8,7 @@ use bytes::Bytes; use futures::AsyncRead; /// Based on the implementation of AsyncBody in -/// https://github.com/sagebind/isahc/blob/5c533f1ef4d6bdf1fd291b5103c22110f41d0bf0/src/body/mod.rs +/// . pub struct AsyncBody(pub Inner); pub enum Inner { diff --git a/crates/language/src/buffer.rs b/crates/language/src/buffer.rs index ccdc9ece46..9620e30d36 100644 --- a/crates/language/src/buffer.rs +++ b/crates/language/src/buffer.rs @@ -236,36 +236,35 @@ pub async fn prepare_completion_documentation( documentation: &lsp::Documentation, language_registry: &Arc, language: Option>, -) -> Documentation { +) -> CompletionDocumentation { match documentation { lsp::Documentation::String(text) => { if text.lines().count() <= 1 { - Documentation::SingleLine(text.clone()) + CompletionDocumentation::SingleLine(text.clone()) } else { - Documentation::MultiLinePlainText(text.clone()) + CompletionDocumentation::MultiLinePlainText(text.clone()) } } lsp::Documentation::MarkupContent(lsp::MarkupContent { kind, value }) => match kind { lsp::MarkupKind::PlainText => { if value.lines().count() <= 1 { - Documentation::SingleLine(value.clone()) + CompletionDocumentation::SingleLine(value.clone()) } else { - Documentation::MultiLinePlainText(value.clone()) + CompletionDocumentation::MultiLinePlainText(value.clone()) } } lsp::MarkupKind::Markdown => { let parsed = parse_markdown(value, Some(language_registry), language).await; - Documentation::MultiLineMarkdown(parsed) + CompletionDocumentation::MultiLineMarkdown(parsed) } }, } } -/// Documentation associated with a [`Completion`]. #[derive(Clone, Debug)] -pub enum Documentation { +pub enum CompletionDocumentation { /// There is no documentation for this completion. Undocumented, /// A single line of documentation. diff --git a/crates/multi_buffer/src/multi_buffer.rs b/crates/multi_buffer/src/multi_buffer.rs index 50aaf9ef7c..d218d28404 100644 --- a/crates/multi_buffer/src/multi_buffer.rs +++ b/crates/multi_buffer/src/multi_buffer.rs @@ -266,7 +266,7 @@ impl std::fmt::Debug for ExcerptInfo { } } -/// A boundary between [`Excerpt`]s in a [`MultiBuffer`] +/// A boundary between `Excerpt`s in a [`MultiBuffer`] #[derive(Debug)] pub struct ExcerptBoundary { pub prev: Option, @@ -312,7 +312,7 @@ struct Excerpt { has_trailing_newline: bool, } -/// A public view into an [`Excerpt`] in a [`MultiBuffer`]. +/// A public view into an `Excerpt` in a [`MultiBuffer`]. /// /// Contains methods for getting the [`Buffer`] of the excerpt, /// as well as mapping offsets to/from buffer and multibuffer coordinates. @@ -332,7 +332,7 @@ struct ExcerptIdMapping { locator: Locator, } -/// A range of text from a single [`Buffer`], to be shown as an [`Excerpt`]. +/// A range of text from a single [`Buffer`], to be shown as an `Excerpt`. /// These ranges are relative to the buffer itself #[derive(Clone, Debug, Eq, PartialEq, Hash)] pub struct ExcerptRange { diff --git a/crates/open_ai/src/supported_countries.rs b/crates/open_ai/src/supported_countries.rs index 4bea1b01a2..b8aed6970e 100644 --- a/crates/open_ai/src/supported_countries.rs +++ b/crates/open_ai/src/supported_countries.rs @@ -3,7 +3,7 @@ use std::sync::LazyLock; /// Returns whether the given country code is supported by OpenAI. /// -/// https://platform.openai.com/docs/supported-countries +/// pub fn is_supported_country(country_code: &str) -> bool { SUPPORTED_COUNTRIES.contains(&country_code) } diff --git a/crates/project/src/lsp_store.rs b/crates/project/src/lsp_store.rs index d0fd5a9f99..8b1f1c8efc 100644 --- a/crates/project/src/lsp_store.rs +++ b/crates/project/src/lsp_store.rs @@ -36,7 +36,7 @@ use language::{ markdown, point_to_lsp, prepare_completion_documentation, proto::{deserialize_anchor, deserialize_version, serialize_anchor, serialize_version}, range_from_lsp, range_to_lsp, Bias, Buffer, BufferSnapshot, CachedLspAdapter, CodeLabel, - Diagnostic, DiagnosticEntry, DiagnosticSet, Diff, Documentation, File as _, Language, + CompletionDocumentation, Diagnostic, DiagnosticEntry, DiagnosticSet, Diff, File as _, Language, LanguageName, LanguageRegistry, LanguageServerBinaryStatus, LanguageToolchainStore, LocalFile, LspAdapter, LspAdapterDelegate, Patch, PointUtf16, TextBufferSnapshot, ToOffset, ToPointUtf16, Transaction, Unclipped, @@ -4359,7 +4359,7 @@ impl LspStore { } else { let mut completions = completions.borrow_mut(); let completion = &mut completions[completion_index]; - completion.documentation = Some(Documentation::Undocumented); + completion.documentation = Some(CompletionDocumentation::Undocumented); } // NB: Zed does not have `details` inside the completion resolve capabilities, but certain language servers violate the spec and do not return `details` immediately, e.g. https://github.com/yioneko/vtsls/issues/213 @@ -4434,16 +4434,16 @@ impl LspStore { let lsp_completion = serde_json::from_slice(&response.lsp_completion)?; let documentation = if response.documentation.is_empty() { - Documentation::Undocumented + CompletionDocumentation::Undocumented } else if response.documentation_is_markdown { - Documentation::MultiLineMarkdown( + CompletionDocumentation::MultiLineMarkdown( markdown::parse_markdown(&response.documentation, Some(&language_registry), None) .await, ) } else if response.documentation.lines().count() <= 1 { - Documentation::SingleLine(response.documentation) + CompletionDocumentation::SingleLine(response.documentation) } else { - Documentation::MultiLinePlainText(response.documentation) + CompletionDocumentation::MultiLinePlainText(response.documentation) }; let mut completions = completions.borrow_mut(); diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index 2b4fa95bd2..23c22df90a 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -56,9 +56,9 @@ use gpui::{ use itertools::Itertools; use language::{ language_settings::InlayHintKind, proto::split_operations, Buffer, BufferEvent, - CachedLspAdapter, Capability, CodeLabel, Documentation, File as _, Language, LanguageName, - LanguageRegistry, PointUtf16, ToOffset, ToPointUtf16, Toolchain, ToolchainList, Transaction, - Unclipped, + CachedLspAdapter, Capability, CodeLabel, CompletionDocumentation, File as _, Language, + LanguageName, LanguageRegistry, PointUtf16, ToOffset, ToPointUtf16, Toolchain, ToolchainList, + Transaction, Unclipped, }; use lsp::{ CodeActionKind, CompletionContext, CompletionItemKind, DocumentHighlightKind, LanguageServer, @@ -368,7 +368,7 @@ pub struct Completion { /// The id of the language server that produced this completion. pub server_id: LanguageServerId, /// The documentation for this completion. - pub documentation: Option, + pub documentation: Option, /// The raw completion provided by the language server. pub lsp_completion: lsp::CompletionItem, /// Whether this completion has been resolved, to ensure it happens once per completion. diff --git a/crates/release_channel/src/lib.rs b/crates/release_channel/src/lib.rs index 1756237b58..21c015fd94 100644 --- a/crates/release_channel/src/lib.rs +++ b/crates/release_channel/src/lib.rs @@ -53,11 +53,6 @@ pub struct AppVersion; impl AppVersion { /// Initializes the global [`AppVersion`]. - /// - /// Attempts to read the version number from the following locations, in order: - /// 1. the `ZED_APP_VERSION` environment variable, - /// 2. the [`AppContext::app_metadata`], - /// 3. the passed in `pkg_version`. pub fn init(pkg_version: &str) -> SemanticVersion { if let Ok(from_env) = env::var("ZED_APP_VERSION") { from_env.parse().expect("invalid ZED_APP_VERSION") diff --git a/crates/reqwest_client/src/reqwest_client.rs b/crates/reqwest_client/src/reqwest_client.rs index 624dcd3360..7d3844d5b7 100644 --- a/crates/reqwest_client/src/reqwest_client.rs +++ b/crates/reqwest_client/src/reqwest_client.rs @@ -139,7 +139,7 @@ impl futures::Stream for StreamReader { } } -/// Implementation from https://docs.rs/tokio-util/0.7.12/src/tokio_util/util/poll_buf.rs.html +/// Implementation from /// Specialized for this use case pub fn poll_read_buf( io: &mut Pin>, diff --git a/crates/settings/src/settings_store.rs b/crates/settings/src/settings_store.rs index 2f18d7c07c..fa86f0d50e 100644 --- a/crates/settings/src/settings_store.rs +++ b/crates/settings/src/settings_store.rs @@ -32,12 +32,13 @@ pub trait Settings: 'static + Send + Sync { /// from the root object. const KEY: Option<&'static str>; - /// The name of the keys in the [`FileContent`] that should always be written to - /// a settings file, even if their value matches the default value. + /// The name of the keys in the [`FileContent`](Self::FileContent) that should + /// always be written to a settings file, even if their value matches the default + /// value. /// - /// This is useful for tagged [`FileContent`]s where the tag is a "version" field - /// that should always be persisted, even if the current user settings match the - /// current version of the settings. + /// This is useful for tagged [`FileContent`](Self::FileContent)s where the tag + /// is a "version" field that should always be persisted, even if the current + /// user settings match the current version of the settings. const PRESERVED_KEYS: Option<&'static [&'static str]> = None; /// The type that is stored in an individual JSON file. diff --git a/crates/sum_tree/src/sum_tree.rs b/crates/sum_tree/src/sum_tree.rs index 15cb0bb813..5c89daa8ff 100644 --- a/crates/sum_tree/src/sum_tree.rs +++ b/crates/sum_tree/src/sum_tree.rs @@ -32,7 +32,7 @@ pub trait KeyedItem: Item { /// A type that describes the Sum of all [`Item`]s in a subtree of the [`SumTree`] /// -/// Each Summary type can have multiple [`Dimensions`] that it measures, +/// Each Summary type can have multiple [`Dimension`]s that it measures, /// which can be used to navigate the tree pub trait Summary: Clone { type Context; diff --git a/crates/terminal/src/terminal.rs b/crates/terminal/src/terminal.rs index 9f4a201b81..df9fcb229d 100644 --- a/crates/terminal/src/terminal.rs +++ b/crates/terminal/src/terminal.rs @@ -122,7 +122,7 @@ pub struct PathLikeTarget { /// A string inside terminal, potentially useful as a URI that can be opened. #[derive(Clone, Debug)] pub enum MaybeNavigationTarget { - /// HTTP, git, etc. string determined by the [`URL_REGEX`] regex. + /// HTTP, git, etc. string determined by the `URL_REGEX` regex. Url(String), /// File system path, absolute or relative, existing or not. /// Might have line and column number(s) attached as `file.rs:1:23` @@ -1910,7 +1910,7 @@ fn content_index_for_mouse(pos: Point, size: &TerminalSize) -> usize { /// Converts an 8 bit ANSI color to its GPUI equivalent. /// Accepts `usize` for compatibility with the `alacritty::Colors` interface, -/// Other than that use case, should only be called with values in the [0,255] range +/// Other than that use case, should only be called with values in the `[0,255]` range pub fn get_color_at_index(index: usize, theme: &Theme) -> Hsla { let colors = theme.colors(); diff --git a/crates/theme/src/settings.rs b/crates/theme/src/settings.rs index 9eefc6882d..2032b98983 100644 --- a/crates/theme/src/settings.rs +++ b/crates/theme/src/settings.rs @@ -425,7 +425,7 @@ impl BufferLineHeight { } impl ThemeSettings { - /// Returns the [AdjustedBufferFontSize]. + /// Returns the buffer font size. pub fn buffer_font_size(&self) -> Pixels { Self::clamp_font_size(self.buffer_font_size) } diff --git a/crates/ui/src/components/button/button.rs b/crates/ui/src/components/button/button.rs index 64897fcc20..46f181f385 100644 --- a/crates/ui/src/components/button/button.rs +++ b/crates/ui/src/components/button/button.rs @@ -349,8 +349,8 @@ impl ButtonCommon for Button { /// Sets a tooltip for the button. /// /// This method allows a tooltip to be set for the button. The tooltip is a function that - /// takes a mutable reference to a [`WindowContext`] and returns an [`AnyView`]. The tooltip - /// is displayed when the user hovers over the button. + /// takes a mutable references to [`Window`] and [`App`], and returns an [`AnyView`]. The + /// tooltip is displayed when the user hovers over the button. /// /// # Examples /// diff --git a/crates/ui/src/components/content_group.rs b/crates/ui/src/components/content_group.rs index 274051d449..b1ffae1490 100644 --- a/crates/ui/src/components/content_group.rs +++ b/crates/ui/src/components/content_group.rs @@ -31,7 +31,7 @@ pub struct ContentGroup { } impl ContentGroup { - /// Creates a new [ContentBox]. + /// Creates a new [`ContentGroup`]. pub fn new() -> Self { Self { base: div(), @@ -41,13 +41,13 @@ impl ContentGroup { } } - /// Removes the border from the [ContentBox]. + /// Removes the border from the [`ContentGroup`]. pub fn borderless(mut self) -> Self { self.border = false; self } - /// Removes the background fill from the [ContentBox]. + /// Removes the background fill from the [`ContentGroup`]. pub fn unfilled(mut self) -> Self { self.fill = false; self diff --git a/crates/ui/src/components/image.rs b/crates/ui/src/components/image.rs index 11430d6a0a..cb90b9a1e3 100644 --- a/crates/ui/src/components/image.rs +++ b/crates/ui/src/components/image.rs @@ -28,7 +28,7 @@ pub enum VectorName { /// A vector image, such as an SVG. /// -/// A [`Vector`] is different from an [`Icon`] in that it is intended +/// A [`Vector`] is different from an [`crate::Icon`] in that it is intended /// to be displayed at a specific size, or series of sizes, rather /// than conforming to the standard size of an icon. #[derive(IntoElement)] diff --git a/crates/ui/src/components/navigable.rs b/crates/ui/src/components/navigable.rs index cb07be4a8a..a9b7fa9c5d 100644 --- a/crates/ui/src/components/navigable.rs +++ b/crates/ui/src/components/navigable.rs @@ -42,8 +42,9 @@ impl Navigable { } /// Add a new entry that can be navigated to via keyboard. - /// The order of calls to [Navigable::entry] determines the order of traversal of elements via successive - /// uses of [menu:::SelectNext]/[menu::SelectPrev] + /// + /// The order of calls to [Navigable::entry] determines the order of traversal of + /// elements via successive uses of `menu:::SelectNext/SelectPrev` pub fn entry(mut self, child: NavigableEntry) -> Self { self.selectable_children.push(child); self @@ -59,6 +60,7 @@ impl Navigable { .position(|entry| entry.focus_handle.contains_focused(window, cx)) } } + impl RenderOnce for Navigable { fn render(self, _window: &mut Window, _: &mut App) -> impl crate::IntoElement { div() diff --git a/crates/ui/src/components/radio.rs b/crates/ui/src/components/radio.rs index 53f898eb21..6e98a10e0b 100644 --- a/crates/ui/src/components/radio.rs +++ b/crates/ui/src/components/radio.rs @@ -5,6 +5,8 @@ use std::sync::Arc; use crate::prelude::*; /// A [`Checkbox`] that has a [`Label`]. +/// +/// [`Checkbox`]: crate::components::Checkbox #[derive(IntoElement)] pub struct RadioWithLabel { id: ElementId, diff --git a/crates/ui/src/styles/elevation.rs b/crates/ui/src/styles/elevation.rs index e78759b046..f12a16e91d 100644 --- a/crates/ui/src/styles/elevation.rs +++ b/crates/ui/src/styles/elevation.rs @@ -22,7 +22,7 @@ pub enum ElevationIndex { EditorSurface, /// A surface that is elevated above the primary surface. but below washes, models, and dragged elements. ElevatedSurface, - /// A surface above the [ElevationIndex::Wash] that is used for dialogs, alerts, modals, etc. + /// A surface above the [ElevationIndex::ElevatedSurface] that is used for dialogs, alerts, modals, etc. ModalSurface, } diff --git a/crates/ui/src/styles/typography.rs b/crates/ui/src/styles/typography.rs index 9d9380e4cd..1f6c2e9112 100644 --- a/crates/ui/src/styles/typography.rs +++ b/crates/ui/src/styles/typography.rs @@ -24,7 +24,7 @@ pub trait StyledTypography: Styled + Sized { self.font_family(ui_font_family) } - /// Sets the text size using a [`UiTextSize`]. + /// Sets the text size using a [`TextSize`]. fn text_ui_size(self, size: TextSize, cx: &App) -> Self { self.text_size(size.rems(cx)) } diff --git a/crates/ui/src/traits/styled_ext.rs b/crates/ui/src/traits/styled_ext.rs index 7b2e56f78d..d2aee0770b 100644 --- a/crates/ui/src/traits/styled_ext.rs +++ b/crates/ui/src/traits/styled_ext.rs @@ -42,9 +42,9 @@ pub trait StyledExt: Styled + Sized { elevated(self, cx, ElevationIndex::Surface) } - /// See [`elevation_1`]. + /// See [`elevation_1`](Self::elevation_1). /// - /// Renders a borderless version [`elevation_1`]. + /// Renders a borderless version [`elevation_1`](Self::elevation_1). fn elevation_1_borderless(self, cx: &mut App) -> Self { elevated_borderless(self, cx, ElevationIndex::Surface) } @@ -58,9 +58,9 @@ pub trait StyledExt: Styled + Sized { elevated(self, cx, ElevationIndex::ElevatedSurface) } - /// See [`elevation_2`]. + /// See [`elevation_2`](Self::elevation_2). /// - /// Renders a borderless version [`elevation_2`]. + /// Renders a borderless version [`elevation_2`](Self::elevation_2). fn elevation_2_borderless(self, cx: &mut App) -> Self { elevated_borderless(self, cx, ElevationIndex::ElevatedSurface) } @@ -78,9 +78,9 @@ pub trait StyledExt: Styled + Sized { elevated(self, cx, ElevationIndex::ModalSurface) } - /// See [`elevation_3`]. + /// See [`elevation_3`](Self::elevation_3). /// - /// Renders a borderless version [`elevation_3`]. + /// Renders a borderless version [`elevation_3`](Self::elevation_3). fn elevation_3_borderless(self, cx: &mut App) -> Self { elevated_borderless(self, cx, ElevationIndex::ModalSurface) } diff --git a/crates/ui/src/ui.rs b/crates/ui/src/ui.rs index 101de4f3ef..8c10642115 100644 --- a/crates/ui/src/ui.rs +++ b/crates/ui/src/ui.rs @@ -7,8 +7,7 @@ //! ## Related Crates: //! //! - [`ui_macros`] - proc_macros support for this crate -//! - [`ui_input`] - the single line input component -//! +//! - `ui_input` - the single line input component mod components; pub mod prelude; diff --git a/crates/ui/src/utils/with_rem_size.rs b/crates/ui/src/utils/with_rem_size.rs index 00bd2a4f8c..1c98747c08 100644 --- a/crates/ui/src/utils/with_rem_size.rs +++ b/crates/ui/src/utils/with_rem_size.rs @@ -22,6 +22,8 @@ impl WithRemSize { /// Block the mouse from interacting with this element or any of its children /// The fluent API equivalent to [`Interactivity::occlude_mouse`] + /// + /// [`Interactivity::occlude_mouse`]: gpui::Interactivity::occlude_mouse pub fn occlude(mut self) -> Self { self.div = self.div.occlude(); self