History

Solve 50+ `cargo doc` warnings (#24071)

Release Notes: - N/A

João Marcos committed 1 year ago

Commit 5bd7eaa1 parent 39d45bc35 files · +99 −89Browse files

Unified · Split

35 files
  1. crates/anthropic/src/anthropic.rs +2 −2
  2. crates/anthropic/src/supported_countries.rs +1 −1
  3. crates/assistant_context_editor/src/slash_command.rs +4 −2
  4. crates/assistant_settings/src/assistant_settings.rs +1 −1
  5. crates/editor/src/code_context_menus.rs +15 −10
  6. crates/editor/src/editor.rs +7 −4
  7. crates/google_ai/src/supported_countries.rs +1 −1
  8. crates/gpui/src/app.rs +1 −1
  9. crates/gpui/src/color.rs +5 −5
  10. crates/gpui/src/gpui.rs +2 −2
  11. crates/gpui/src/platform/linux/platform.rs +1 −1
  12. crates/gpui/src/shared_string.rs +1 −1
  13. crates/gpui_macros/src/gpui_macros.rs +2 −2
  14. crates/http_client/src/async_body.rs +1 −1
  15. crates/language/src/buffer.rs +7 −8
  16. crates/multi_buffer/src/multi_buffer.rs +3 −3
  17. crates/open_ai/src/supported_countries.rs +1 −1
  18. crates/project/src/lsp_store.rs +6 −6
  19. crates/project/src/project.rs +4 −4
  20. crates/release_channel/src/lib.rs +0 −5
  21. crates/reqwest_client/src/reqwest_client.rs +1 −1
  22. crates/settings/src/settings_store.rs +6 −5
  23. crates/sum_tree/src/sum_tree.rs +1 −1
  24. crates/terminal/src/terminal.rs +2 −2
  25. crates/theme/src/settings.rs +1 −1
  26. crates/ui/src/components/button/button.rs +2 −2
  27. crates/ui/src/components/content_group.rs +3 −3
  28. crates/ui/src/components/image.rs +1 −1
  29. crates/ui/src/components/navigable.rs +4 −2
  30. crates/ui/src/components/radio.rs +2 −0
  31. crates/ui/src/styles/elevation.rs +1 −1
  32. crates/ui/src/styles/typography.rs +1 −1
  33. crates/ui/src/traits/styled_ext.rs +6 −6
  34. crates/ui/src/ui.rs +1 −2
  35. crates/ui/src/utils/with_rem_size.rs +2 −0
crates/anthropic/src/anthropic.rs+2−2
@@ -250,7 +250,7 @@ pub async fn stream_completion( · 249 unmodified lines
250250 .map(|output| output.0)
251251 }
252252
253−/// https://docs.anthropic.com/en/api/rate-limits#response-headers
253+/// <https://docs.anthropic.com/en/api/rate-limits#response-headers>
254254 #[derive(Debug)]
255255 pub struct RateLimitInfo {
256256 pub requests_limit: usize,
@@ -626,7 +626,7 @@ pub struct ApiError { · 369 unmodified lines
626626 }
627627
628628 /// An Anthropic API error code.
629−/// https://docs.anthropic.com/en/api/errors#http-errors
629+/// <https://docs.anthropic.com/en/api/errors#http-errors>
630630 #[derive(Debug, PartialEq, Eq, Clone, Copy, EnumString)]
631631 #[strum(serialize_all = "snake_case")]
632632 pub enum ApiErrorCode {
crates/anthropic/src/supported_countries.rs+1−1
@@ -3,7 +3,7 @@ use std::sync::LazyLock; · 2 unmodified lines
33
44 /// Returns whether the given country code is supported by Anthropic.
55 ///
6−/// https://www.anthropic.com/supported-countries
6+/// <https://www.anthropic.com/supported-countries>
77 pub fn is_supported_country(country_code: &str) -> bool {
88 SUPPORTED_COUNTRIES.contains(&country_code)
99 }
crates/assistant_context_editor/src/slash_command.rs+4−2
@@ -5,7 +5,7 @@ use assistant_slash_command::{AfterCompletion, SlashCommandLine, SlashCommandWor · 4 unmodified lines
55 use editor::{CompletionProvider, Editor};
66 use fuzzy::{match_strings, StringMatchCandidate};
77 use gpui::{App, Context, Entity, Task, WeakEntity, Window};
8−use language::{Anchor, Buffer, Documentation, LanguageServerId, ToPoint};
8+use language::{Anchor, Buffer, CompletionDocumentation, LanguageServerId, ToPoint};
99 use parking_lot::Mutex;
1010 use project::CompletionIntent;
1111 use rope::Point;
@@ -120,7 +120,9 @@ impl SlashCommandCompletionProvider { · 108 unmodified lines
120120 });
121121 Some(project::Completion {
122122 old_range: name_range.clone(),
123− documentation: Some(Documentation::SingleLine(command.description())),
123+ documentation: Some(CompletionDocumentation::SingleLine(
124+ command.description(),
125+ )),
124126 new_text,
125127 label: command.label(cx),
126128 server_id: LanguageServerId(0),
crates/assistant_settings/src/assistant_settings.rs+1−1
@@ -434,7 +434,7 @@ pub struct LegacyAssistantSettingsContent { · 433 unmodified lines
434434 pub default_open_ai_model: Option<OpenAiModel>,
435435 /// OpenAI API base URL to use when creating new chats.
436436 ///
437− /// Default: https://api.openai.com/v1
437+ /// Default: <https://api.openai.com/v1>
438438 pub openai_api_url: Option<String>,
439439 }
440440
crates/editor/src/code_context_menus.rs+15−10
@@ -5,7 +5,7 @@ use gpui::{ · 4 unmodified lines
55 Size, StrikethroughStyle, StyledText, UniformListScrollHandle, WeakEntity,
66 };
77 use language::Buffer;
8−use language::{CodeLabel, Documentation};
8+use language::{CodeLabel, CompletionDocumentation};
99 use lsp::LanguageServerId;
1010 use multi_buffer::{Anchor, ExcerptId};
1111 use ordered_float::OrderedFloat;
@@ -474,7 +474,7 @@ impl CompletionsMenu { · 462 unmodified lines
474474 let documentation = &completion.documentation;
475475
476476 let mut len = completion.label.text.chars().count();
477− if let Some(Documentation::SingleLine(text)) = documentation {
477+ if let Some(CompletionDocumentation::SingleLine(text)) = documentation {
478478 if show_completion_documentation {
479479 len += text.chars().count();
480480 }
@@ -558,7 +558,9 @@ impl CompletionsMenu { · 77 unmodified lines
558558 StyledText::new(completion.label.text.clone())
559559 .with_highlights(&style.text, highlights);
560560 let documentation_label =
561− if let Some(Documentation::SingleLine(text)) = documentation {
561+ if let Some(CompletionDocumentation::SingleLine(text)) =
562+ documentation
563+ {
562564 if text.trim().is_empty() {
563565 None
564566 } else {
@@ -710,20 +712,23 @@ impl CompletionsMenu { · 145 unmodified lines
710712 .documentation
711713 .as_ref()?
712714 {
713− Documentation::MultiLinePlainText(text) => {
715+ CompletionDocumentation::MultiLinePlainText(text) => {
714716 div().child(SharedString::from(text.clone()))
715717 }
716− Documentation::MultiLineMarkdown(parsed) if !parsed.text.is_empty() => div()
717− .child(render_parsed_markdown(
718+ CompletionDocumentation::MultiLineMarkdown(parsed)
719+ if !parsed.text.is_empty() =>
720+ {
721+ div().child(render_parsed_markdown(
718722 "completions_markdown",
719723 parsed,
720724 &style,
721725 workspace,
722726 cx,
723− )),
724− Documentation::MultiLineMarkdown(_) => return None,
725− Documentation::SingleLine(_) => return None,
726− Documentation::Undocumented => return None,
727+ ))
728+ }
729+ CompletionDocumentation::MultiLineMarkdown(_) => return None,
730+ CompletionDocumentation::SingleLine(_) => return None,
731+ CompletionDocumentation::Undocumented => return None,
727732 }
728733 }
729734 CompletionEntry::InlineCompletionHint(InlineCompletionMenuHint::Loaded { text }) => {
crates/editor/src/editor.rs+7−4
@@ -96,9 +96,9 @@ use itertools::Itertools; · 95 unmodified lines
9696 use language::{
9797 language_settings::{self, all_language_settings, language_settings, InlayHintSettings},
9898 markdown, point_from_lsp, AutoindentMode, BracketPair, Buffer, Capability, CharKind, CodeLabel,
99− CursorShape, Diagnostic, Documentation, EditPreview, HighlightedText, IndentKind, IndentSize,
100− Language, OffsetRangeExt, Point, Selection, SelectionGoal, TextObject, TransactionId,
101− TreeSitterOptions,
99+ CompletionDocumentation, CursorShape, Diagnostic, EditPreview, HighlightedText, IndentKind,
100+ IndentSize, Language, OffsetRangeExt, Point, Selection, SelectionGoal, TextObject,
101+ TransactionId, TreeSitterOptions,
102102 };
103103 use language::{point_to_lsp, BufferRow, CharClassifier, Runnable, RunnableRange};
104104 use linked_editing_ranges::refresh_linked_ranges;
@@ -14723,7 +14723,10 @@ fn snippet_completions( · 14618 unmodified lines
1472314723 filter_range: 0..matching_prefix.len(),
1472414724 },
1472514725 server_id: LanguageServerId(usize::MAX),
14726− documentation: snippet.description.clone().map(Documentation::SingleLine),
14726+ documentation: snippet
14727+ .description
14728+ .clone()
14729+ .map(CompletionDocumentation::SingleLine),
1472714730 lsp_completion: lsp::CompletionItem {
1472814731 label: snippet.prefix.first().unwrap().clone(),
1472914732 kind: Some(CompletionItemKind::SNIPPET),
crates/google_ai/src/supported_countries.rs+1−1
@@ -3,7 +3,7 @@ use std::sync::LazyLock; · 2 unmodified lines
33
44 /// Returns whether the given country code is supported by Google Gemini.
55 ///
6−/// https://ai.google.dev/gemini-api/docs/available-regions
6+/// <https://ai.google.dev/gemini-api/docs/available-regions>
77 pub fn is_supported_country(country_code: &str) -> bool {
88 SUPPORTED_COUNTRIES.contains(&country_code)
99 }
crates/gpui/src/app.rs+1−1
@@ -1418,7 +1418,7 @@ impl App { · 1417 unmodified lines
14181418 }
14191419
14201420 /// Dispatch an action to the currently active window or global action handler
1421− /// See [action::Action] for more information on how actions work
1421+ /// See [`crate::Action`] for more information on how actions work
14221422 pub fn dispatch_action(&mut self, action: &dyn Action) {
14231423 if let Some(active_window) = self.active_window() {
14241424 active_window
crates/gpui/src/color.rs+5−5
@@ -559,8 +559,8 @@ pub(crate) enum BackgroundTag { · 558 unmodified lines
559559 /// A color space for color interpolation.
560560 ///
561561 /// References:
562−/// - https://developer.mozilla.org/en-US/docs/Web/CSS/color-interpolation-method
563−/// - https://www.w3.org/TR/css-color-4/#typedef-color-space
562+/// - <https://developer.mozilla.org/en-US/docs/Web/CSS/color-interpolation-method>
563+/// - <https://www.w3.org/TR/css-color-4/#typedef-color-space>
564564 #[derive(Debug, Clone, Copy, PartialEq, Default)]
565565 #[repr(C)]
566566 pub enum ColorSpace {
@@ -622,7 +622,7 @@ pub fn pattern_slash(color: Hsla) -> Background { · 55 unmodified lines
622622 ///
623623 /// The `angle` is in degrees value in the range 0.0 to 360.0.
624624 ///
625−/// https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient
625+/// <https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient>
626626 pub fn linear_gradient(
627627 angle: f32,
628628 from: impl Into<LinearColorStop>,
@@ -638,7 +638,7 @@ pub fn linear_gradient( · 9 unmodified lines
638638
639639 /// A color stop in a linear gradient.
640640 ///
641−/// https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient#linear-color-stop
641+/// <https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient#linear-color-stop>
642642 #[derive(Debug, Clone, Copy, Default, PartialEq)]
643643 #[repr(C)]
644644 pub struct LinearColorStop {
@@ -671,7 +671,7 @@ impl LinearColorStop { · 26 unmodified lines
671671 impl Background {
672672 /// Use specified color space for color interpolation.
673673 ///
674− /// https://developer.mozilla.org/en-US/docs/Web/CSS/color-interpolation-method
674+ /// <https://developer.mozilla.org/en-US/docs/Web/CSS/color-interpolation-method>
675675 pub fn color_space(mut self, color_space: ColorSpace) -> Self {
676676 self.color_space = color_space;
677677 self
crates/gpui/src/gpui.rs+2−2
@@ -48,10 +48,10 @@ · 47 unmodified lines
4848 //! complex applications:
4949 //!
5050 //! - Actions are user-defined structs that are used for converting keystrokes into logical operations in your UI.
51−//! Use this for implementing keyboard shortcuts, such as cmd-q. See the [`action`] module for more information.
51+//! Use this for implementing keyboard shortcuts, such as cmd-q (See `action` module for more information).
5252 //! - Platform services, such as `quit the app` or `open a URL` are available as methods on the [`app::App`].
5353 //! - An async executor that is integrated with the platform's event loop. See the [`executor`] module for more information.,
54−//! - The [gpui::test] macro provides a convenient way to write tests for your GPUI applications. Tests also have their
54+//! - The [`gpui::test`](test) macro provides a convenient way to write tests for your GPUI applications. Tests also have their
5555 //! own kind of context, a [`TestAppContext`] which provides ways of simulating common platform input. See [`app::test_context`]
5656 //! and [`test`] modules for more details.
5757 //!
crates/gpui/src/platform/linux/platform.rs+1−1
@@ -773,7 +773,7 @@ impl crate::Keystroke { · 772 unmodified lines
773773
774774 /**
775775 * Returns which symbol the dead key represents
776− * https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values#dead_keycodes_for_linux
776+ * <https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values#dead_keycodes_for_linux>
777777 */
778778 pub fn underlying_dead_key(keysym: Keysym) -> Option<String> {
779779 match keysym {
crates/gpui/src/shared_string.rs+1−1
@@ -16,7 +16,7 @@ impl SharedString { · 15 unmodified lines
1616 Self(ArcCow::Borrowed(str))
1717 }
1818
19− /// Creates a [`SharedString`] from anything that can become an Arc<str>
19+ /// Creates a [`SharedString`] from anything that can become an `Arc<str>`
2020 pub fn new(str: impl Into<Arc<str>>) -> Self {
2121 SharedString(ArcCow::Owned(str.into()))
2222 }
crates/gpui_macros/src/gpui_macros.rs+2−2
@@ -143,7 +143,7 @@ pub fn box_shadow_style_methods(input: TokenStream) -> TokenStream { · 142 unmodified lines
143143 styles::box_shadow_style_methods(input)
144144 }
145145
146−/// #[gpui::test] can be used to annotate test functions that run with GPUI support.
146+/// `#[gpui::test]` can be used to annotate test functions that run with GPUI support.
147147 /// it supports both synchronous and asynchronous tests, and can provide you with
148148 /// as many `TestAppContext` instances as you need.
149149 /// 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 { · 10 unmodified lines
160160 /// Using the same `StdRng` for behavior in your test will allow you to exercise a wide
161161 /// variety of scenarios and interleavings just by changing the seed.
162162 ///
163−/// #[gpui::test] also takes three different arguments:
163+/// `#[gpui::test]` also takes three different arguments:
164164 /// - `#[gpui::test(iterations=10)]` will run the test ten times with a different initial SEED.
165165 /// - `#[gpui::test(retries=3)]` will run the test up to four times if it fails to try and make it pass.
166166 /// - `#[gpui::test(on_failure="crate::test::report_failure")]` will call the specified function after the
crates/http_client/src/async_body.rs+1−1
@@ -8,7 +8,7 @@ use bytes::Bytes; · 7 unmodified lines
88 use futures::AsyncRead;
99
1010 /// Based on the implementation of AsyncBody in
11−/// https://github.com/sagebind/isahc/blob/5c533f1ef4d6bdf1fd291b5103c22110f41d0bf0/src/body/mod.rs
11+/// <https://github.com/sagebind/isahc/blob/5c533f1ef4d6bdf1fd291b5103c22110f41d0bf0/src/body/mod.rs>.
1212 pub struct AsyncBody(pub Inner);
1313
1414 pub enum Inner {
crates/language/src/buffer.rs+7−8
@@ -236,36 +236,35 @@ pub async fn prepare_completion_documentation( · 235 unmodified lines
236236 documentation: &lsp::Documentation,
237237 language_registry: &Arc<LanguageRegistry>,
238238 language: Option<Arc<Language>>,
239−) -> Documentation {
239+) -> CompletionDocumentation {
240240 match documentation {
241241 lsp::Documentation::String(text) => {
242242 if text.lines().count() <= 1 {
243− Documentation::SingleLine(text.clone())
243+ CompletionDocumentation::SingleLine(text.clone())
244244 } else {
245− Documentation::MultiLinePlainText(text.clone())
245+ CompletionDocumentation::MultiLinePlainText(text.clone())
246246 }
247247 }
248248
249249 lsp::Documentation::MarkupContent(lsp::MarkupContent { kind, value }) => match kind {
250250 lsp::MarkupKind::PlainText => {
251251 if value.lines().count() <= 1 {
252− Documentation::SingleLine(value.clone())
252+ CompletionDocumentation::SingleLine(value.clone())
253253 } else {
254− Documentation::MultiLinePlainText(value.clone())
254+ CompletionDocumentation::MultiLinePlainText(value.clone())
255255 }
256256 }
257257
258258 lsp::MarkupKind::Markdown => {
259259 let parsed = parse_markdown(value, Some(language_registry), language).await;
260− Documentation::MultiLineMarkdown(parsed)
260+ CompletionDocumentation::MultiLineMarkdown(parsed)
261261 }
262262 },
263263 }
264264 }
265265
266−/// Documentation associated with a [`Completion`].
267266 #[derive(Clone, Debug)]
268−pub enum Documentation {
267+pub enum CompletionDocumentation {
269268 /// There is no documentation for this completion.
270269 Undocumented,
271270 /// A single line of documentation.
crates/multi_buffer/src/multi_buffer.rs+3−3
@@ -266,7 +266,7 @@ impl std::fmt::Debug for ExcerptInfo { · 265 unmodified lines
266266 }
267267 }
268268
269−/// A boundary between [`Excerpt`]s in a [`MultiBuffer`]
269+/// A boundary between `Excerpt`s in a [`MultiBuffer`]
270270 #[derive(Debug)]
271271 pub struct ExcerptBoundary {
272272 pub prev: Option<ExcerptInfo>,
@@ -312,7 +312,7 @@ struct Excerpt { · 39 unmodified lines
312312 has_trailing_newline: bool,
313313 }
314314
315−/// A public view into an [`Excerpt`] in a [`MultiBuffer`].
315+/// A public view into an `Excerpt` in a [`MultiBuffer`].
316316 ///
317317 /// Contains methods for getting the [`Buffer`] of the excerpt,
318318 /// as well as mapping offsets to/from buffer and multibuffer coordinates.
@@ -332,7 +332,7 @@ struct ExcerptIdMapping { · 13 unmodified lines
332332 locator: Locator,
333333 }
334334
335−/// A range of text from a single [`Buffer`], to be shown as an [`Excerpt`].
335+/// A range of text from a single [`Buffer`], to be shown as an `Excerpt`.
336336 /// These ranges are relative to the buffer itself
337337 #[derive(Clone, Debug, Eq, PartialEq, Hash)]
338338 pub struct ExcerptRange<T> {
crates/open_ai/src/supported_countries.rs+1−1
@@ -3,7 +3,7 @@ use std::sync::LazyLock; · 2 unmodified lines
33
44 /// Returns whether the given country code is supported by OpenAI.
55 ///
6−/// https://platform.openai.com/docs/supported-countries
6+/// <https://platform.openai.com/docs/supported-countries>
77 pub fn is_supported_country(country_code: &str) -> bool {
88 SUPPORTED_COUNTRIES.contains(&country_code)
99 }
crates/project/src/lsp_store.rs+6−6
@@ -36,7 +36,7 @@ use language::{ · 35 unmodified lines
3636 markdown, point_to_lsp, prepare_completion_documentation,
3737 proto::{deserialize_anchor, deserialize_version, serialize_anchor, serialize_version},
3838 range_from_lsp, range_to_lsp, Bias, Buffer, BufferSnapshot, CachedLspAdapter, CodeLabel,
39− Diagnostic, DiagnosticEntry, DiagnosticSet, Diff, Documentation, File as _, Language,
39+ CompletionDocumentation, Diagnostic, DiagnosticEntry, DiagnosticSet, Diff, File as _, Language,
4040 LanguageName, LanguageRegistry, LanguageServerBinaryStatus, LanguageToolchainStore, LocalFile,
4141 LspAdapter, LspAdapterDelegate, Patch, PointUtf16, TextBufferSnapshot, ToOffset, ToPointUtf16,
4242 Transaction, Unclipped,
@@ -4359,7 +4359,7 @@ impl LspStore { · 4316 unmodified lines
43594359 } else {
43604360 let mut completions = completions.borrow_mut();
43614361 let completion = &mut completions[completion_index];
4362− completion.documentation = Some(Documentation::Undocumented);
4362+ completion.documentation = Some(CompletionDocumentation::Undocumented);
43634363 }
43644364
43654365 // 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 { · 68 unmodified lines
44344434 let lsp_completion = serde_json::from_slice(&response.lsp_completion)?;
44354435
44364436 let documentation = if response.documentation.is_empty() {
4437− Documentation::Undocumented
4437+ CompletionDocumentation::Undocumented
44384438 } else if response.documentation_is_markdown {
4439− Documentation::MultiLineMarkdown(
4439+ CompletionDocumentation::MultiLineMarkdown(
44404440 markdown::parse_markdown(&response.documentation, Some(&language_registry), None)
44414441 .await,
44424442 )
44434443 } else if response.documentation.lines().count() <= 1 {
4444− Documentation::SingleLine(response.documentation)
4444+ CompletionDocumentation::SingleLine(response.documentation)
44454445 } else {
4446− Documentation::MultiLinePlainText(response.documentation)
4446+ CompletionDocumentation::MultiLinePlainText(response.documentation)
44474447 };
44484448
44494449 let mut completions = completions.borrow_mut();
crates/project/src/project.rs+4−4
@@ -56,9 +56,9 @@ use gpui::{ · 55 unmodified lines
5656 use itertools::Itertools;
5757 use language::{
5858 language_settings::InlayHintKind, proto::split_operations, Buffer, BufferEvent,
59− CachedLspAdapter, Capability, CodeLabel, Documentation, File as _, Language, LanguageName,
60− LanguageRegistry, PointUtf16, ToOffset, ToPointUtf16, Toolchain, ToolchainList, Transaction,
61− Unclipped,
59+ CachedLspAdapter, Capability, CodeLabel, CompletionDocumentation, File as _, Language,
60+ LanguageName, LanguageRegistry, PointUtf16, ToOffset, ToPointUtf16, Toolchain, ToolchainList,
61+ Transaction, Unclipped,
6262 };
6363 use lsp::{
6464 CodeActionKind, CompletionContext, CompletionItemKind, DocumentHighlightKind, LanguageServer,
@@ -368,7 +368,7 @@ pub struct Completion { · 303 unmodified lines
368368 /// The id of the language server that produced this completion.
369369 pub server_id: LanguageServerId,
370370 /// The documentation for this completion.
371− pub documentation: Option<Documentation>,
371+ pub documentation: Option<CompletionDocumentation>,
372372 /// The raw completion provided by the language server.
373373 pub lsp_completion: lsp::CompletionItem,
374374 /// Whether this completion has been resolved, to ensure it happens once per completion.
crates/release_channel/src/lib.rs+0−5
@@ -53,11 +53,6 @@ pub struct AppVersion; · 52 unmodified lines
5353
5454 impl AppVersion {
5555 /// Initializes the global [`AppVersion`].
56− ///
57− /// Attempts to read the version number from the following locations, in order:
58− /// 1. the `ZED_APP_VERSION` environment variable,
59− /// 2. the [`AppContext::app_metadata`],
60− /// 3. the passed in `pkg_version`.
6156 pub fn init(pkg_version: &str) -> SemanticVersion {
6257 if let Ok(from_env) = env::var("ZED_APP_VERSION") {
6358 from_env.parse().expect("invalid ZED_APP_VERSION")
crates/reqwest_client/src/reqwest_client.rs+1−1
@@ -139,7 +139,7 @@ impl futures::Stream for StreamReader { · 138 unmodified lines
139139 }
140140 }
141141
142−/// Implementation from https://docs.rs/tokio-util/0.7.12/src/tokio_util/util/poll_buf.rs.html
142+/// Implementation from <https://docs.rs/tokio-util/0.7.12/src/tokio_util/util/poll_buf.rs.html>
143143 /// Specialized for this use case
144144 pub fn poll_read_buf(
145145 io: &mut Pin<Box<dyn futures::AsyncRead + Send + Sync>>,
crates/settings/src/settings_store.rs+6−5
@@ -32,12 +32,13 @@ pub trait Settings: 'static + Send + Sync { · 31 unmodified lines
3232 /// from the root object.
3333 const KEY: Option<&'static str>;
3434
35− /// The name of the keys in the [`FileContent`] that should always be written to
36− /// a settings file, even if their value matches the default value.
35+ /// The name of the keys in the [`FileContent`](Self::FileContent) that should
36+ /// always be written to a settings file, even if their value matches the default
37+ /// value.
3738 ///
38− /// This is useful for tagged [`FileContent`]s where the tag is a "version" field
39− /// that should always be persisted, even if the current user settings match the
40− /// current version of the settings.
39+ /// This is useful for tagged [`FileContent`](Self::FileContent)s where the tag
40+ /// is a "version" field that should always be persisted, even if the current
41+ /// user settings match the current version of the settings.
4142 const PRESERVED_KEYS: Option<&'static [&'static str]> = None;
4243
4344 /// The type that is stored in an individual JSON file.
crates/sum_tree/src/sum_tree.rs+1−1
@@ -32,7 +32,7 @@ pub trait KeyedItem: Item { · 31 unmodified lines
3232
3333 /// A type that describes the Sum of all [`Item`]s in a subtree of the [`SumTree`]
3434 ///
35−/// Each Summary type can have multiple [`Dimensions`] that it measures,
35+/// Each Summary type can have multiple [`Dimension`]s that it measures,
3636 /// which can be used to navigate the tree
3737 pub trait Summary: Clone {
3838 type Context;
crates/terminal/src/terminal.rs+2−2
@@ -122,7 +122,7 @@ pub struct PathLikeTarget { · 121 unmodified lines
122122 /// A string inside terminal, potentially useful as a URI that can be opened.
123123 #[derive(Clone, Debug)]
124124 pub enum MaybeNavigationTarget {
125− /// HTTP, git, etc. string determined by the [`URL_REGEX`] regex.
125+ /// HTTP, git, etc. string determined by the `URL_REGEX` regex.
126126 Url(String),
127127 /// File system path, absolute or relative, existing or not.
128128 /// Might have line and column number(s) attached as `file.rs:1:23`
@@ -1910,7 +1910,7 @@ fn content_index_for_mouse(pos: Point<Pixels>, size: &TerminalSize) -> usize { · 1781 unmodified lines
19101910
19111911 /// Converts an 8 bit ANSI color to its GPUI equivalent.
19121912 /// Accepts `usize` for compatibility with the `alacritty::Colors` interface,
1913−/// Other than that use case, should only be called with values in the [0,255] range
1913+/// Other than that use case, should only be called with values in the `[0,255]` range
19141914 pub fn get_color_at_index(index: usize, theme: &Theme) -> Hsla {
19151915 let colors = theme.colors();
19161916
crates/theme/src/settings.rs+1−1
@@ -425,7 +425,7 @@ impl BufferLineHeight { · 424 unmodified lines
425425 }
426426
427427 impl ThemeSettings {
428− /// Returns the [AdjustedBufferFontSize].
428+ /// Returns the buffer font size.
429429 pub fn buffer_font_size(&self) -> Pixels {
430430 Self::clamp_font_size(self.buffer_font_size)
431431 }
crates/ui/src/components/button/button.rs+2−2
@@ -349,8 +349,8 @@ impl ButtonCommon for Button { · 348 unmodified lines
349349 /// Sets a tooltip for the button.
350350 ///
351351 /// This method allows a tooltip to be set for the button. The tooltip is a function that
352− /// takes a mutable reference to a [`WindowContext`] and returns an [`AnyView`]. The tooltip
353− /// is displayed when the user hovers over the button.
352+ /// takes a mutable references to [`Window`] and [`App`], and returns an [`AnyView`]. The
353+ /// tooltip is displayed when the user hovers over the button.
354354 ///
355355 /// # Examples
356356 ///
crates/ui/src/components/content_group.rs+3−3
@@ -31,7 +31,7 @@ pub struct ContentGroup { · 30 unmodified lines
3131 }
3232
3333 impl ContentGroup {
34− /// Creates a new [ContentBox].
34+ /// Creates a new [`ContentGroup`].
3535 pub fn new() -> Self {
3636 Self {
3737 base: div(),
@@ -41,13 +41,13 @@ impl ContentGroup { · 3 unmodified lines
4141 }
4242 }
4343
44− /// Removes the border from the [ContentBox].
44+ /// Removes the border from the [`ContentGroup`].
4545 pub fn borderless(mut self) -> Self {
4646 self.border = false;
4747 self
4848 }
4949
50− /// Removes the background fill from the [ContentBox].
50+ /// Removes the background fill from the [`ContentGroup`].
5151 pub fn unfilled(mut self) -> Self {
5252 self.fill = false;
5353 self
crates/ui/src/components/image.rs+1−1
@@ -28,7 +28,7 @@ pub enum VectorName { · 27 unmodified lines
2828
2929 /// A vector image, such as an SVG.
3030 ///
31−/// A [`Vector`] is different from an [`Icon`] in that it is intended
31+/// A [`Vector`] is different from an [`crate::Icon`] in that it is intended
3232 /// to be displayed at a specific size, or series of sizes, rather
3333 /// than conforming to the standard size of an icon.
3434 #[derive(IntoElement)]
crates/ui/src/components/navigable.rs+4−2
@@ -42,8 +42,9 @@ impl Navigable { · 41 unmodified lines
4242 }
4343
4444 /// Add a new entry that can be navigated to via keyboard.
45− /// The order of calls to [Navigable::entry] determines the order of traversal of elements via successive
46− /// uses of [menu:::SelectNext]/[menu::SelectPrev]
45+ ///
46+ /// The order of calls to [Navigable::entry] determines the order of traversal of
47+ /// elements via successive uses of `menu:::SelectNext/SelectPrev`
4748 pub fn entry(mut self, child: NavigableEntry) -> Self {
4849 self.selectable_children.push(child);
4950 self
@@ -59,6 +60,7 @@ impl Navigable { · 9 unmodified lines
5960 .position(|entry| entry.focus_handle.contains_focused(window, cx))
6061 }
6162 }
63+
6264 impl RenderOnce for Navigable {
6365 fn render(self, _window: &mut Window, _: &mut App) -> impl crate::IntoElement {
6466 div()
crates/ui/src/components/radio.rs+2−0
@@ -5,6 +5,8 @@ use std::sync::Arc; · 4 unmodified lines
55 use crate::prelude::*;
66
77 /// A [`Checkbox`] that has a [`Label`].
8+///
9+/// [`Checkbox`]: crate::components::Checkbox
810 #[derive(IntoElement)]
911 pub struct RadioWithLabel {
1012 id: ElementId,
crates/ui/src/styles/elevation.rs+1−1
@@ -22,7 +22,7 @@ pub enum ElevationIndex { · 21 unmodified lines
2222 EditorSurface,
2323 /// A surface that is elevated above the primary surface. but below washes, models, and dragged elements.
2424 ElevatedSurface,
25− /// A surface above the [ElevationIndex::Wash] that is used for dialogs, alerts, modals, etc.
25+ /// A surface above the [ElevationIndex::ElevatedSurface] that is used for dialogs, alerts, modals, etc.
2626 ModalSurface,
2727 }
2828
crates/ui/src/styles/typography.rs+1−1
@@ -24,7 +24,7 @@ pub trait StyledTypography: Styled + Sized { · 23 unmodified lines
2424 self.font_family(ui_font_family)
2525 }
2626
27− /// Sets the text size using a [`UiTextSize`].
27+ /// Sets the text size using a [`TextSize`].
2828 fn text_ui_size(self, size: TextSize, cx: &App) -> Self {
2929 self.text_size(size.rems(cx))
3030 }
crates/ui/src/traits/styled_ext.rs+6−6
@@ -42,9 +42,9 @@ pub trait StyledExt: Styled + Sized { · 41 unmodified lines
4242 elevated(self, cx, ElevationIndex::Surface)
4343 }
4444
45− /// See [`elevation_1`].
45+ /// See [`elevation_1`](Self::elevation_1).
4646 ///
47− /// Renders a borderless version [`elevation_1`].
47+ /// Renders a borderless version [`elevation_1`](Self::elevation_1).
4848 fn elevation_1_borderless(self, cx: &mut App) -> Self {
4949 elevated_borderless(self, cx, ElevationIndex::Surface)
5050 }
@@ -58,9 +58,9 @@ pub trait StyledExt: Styled + Sized { · 7 unmodified lines
5858 elevated(self, cx, ElevationIndex::ElevatedSurface)
5959 }
6060
61− /// See [`elevation_2`].
61+ /// See [`elevation_2`](Self::elevation_2).
6262 ///
63− /// Renders a borderless version [`elevation_2`].
63+ /// Renders a borderless version [`elevation_2`](Self::elevation_2).
6464 fn elevation_2_borderless(self, cx: &mut App) -> Self {
6565 elevated_borderless(self, cx, ElevationIndex::ElevatedSurface)
6666 }
@@ -78,9 +78,9 @@ pub trait StyledExt: Styled + Sized { · 11 unmodified lines
7878 elevated(self, cx, ElevationIndex::ModalSurface)
7979 }
8080
81− /// See [`elevation_3`].
81+ /// See [`elevation_3`](Self::elevation_3).
8282 ///
83− /// Renders a borderless version [`elevation_3`].
83+ /// Renders a borderless version [`elevation_3`](Self::elevation_3).
8484 fn elevation_3_borderless(self, cx: &mut App) -> Self {
8585 elevated_borderless(self, cx, ElevationIndex::ModalSurface)
8686 }
crates/ui/src/ui.rs+1−2
@@ -7,8 +7,7 @@ · 6 unmodified lines
77 //! ## Related Crates:
88 //!
99 //! - [`ui_macros`] - proc_macros support for this crate
10−//! - [`ui_input`] - the single line input component
11−//!
10+//! - `ui_input` - the single line input component
1211
1312 mod components;
1413 pub mod prelude;
crates/ui/src/utils/with_rem_size.rs+2−0
@@ -22,6 +22,8 @@ impl WithRemSize { · 21 unmodified lines
2222
2323 /// Block the mouse from interacting with this element or any of its children
2424 /// The fluent API equivalent to [`Interactivity::occlude_mouse`]
25+ ///
26+ /// [`Interactivity::occlude_mouse`]: gpui::Interactivity::occlude_mouse
2527 pub fn occlude(mut self) -> Self {
2628 self.div = self.div.occlude();
2729 self