Clean up references in doc comments in language crate (#6729)

This PR cleans up a handful of references in doc comments in the
`language` crate so that `rustdoc` will link and display them correctly.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-01-25 16:04:58 -05:00 committed by GitHub
parent 039ef1ad5a
commit 20c90f07e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 19 additions and 21 deletions

View file

@ -197,7 +197,7 @@ pub struct Diagnostic {
/// Whether this diagnostic is considered to originate from an analysis of /// Whether this diagnostic is considered to originate from an analysis of
/// files on disk, as opposed to any unsaved buffer contents. This is a /// files on disk, as opposed to any unsaved buffer contents. This is a
/// property of a given diagnostic source, and is configured for a given /// property of a given diagnostic source, and is configured for a given
/// language server via the [LspAdapter::disk_based_diagnostic_sources] method /// language server via the [`LspAdapter::disk_based_diagnostic_sources`](crate::LspAdapter::disk_based_diagnostic_sources) method
/// for the language server. /// for the language server.
pub is_disk_based: bool, pub is_disk_based: bool,
/// Whether this diagnostic marks unnecessary code. /// Whether this diagnostic marks unnecessary code.
@ -236,7 +236,7 @@ pub async fn prepare_completion_documentation(
} }
} }
/// Documentation associated with a [Completion]. /// Documentation associated with a [`Completion`].
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub enum Documentation { pub enum Documentation {
/// There is no documentation for this completion. /// There is no documentation for this completion.
@ -301,7 +301,7 @@ pub enum Operation {
lamport_timestamp: clock::Lamport, lamport_timestamp: clock::Lamport,
/// Whether the selections are in 'line mode'. /// Whether the selections are in 'line mode'.
line_mode: bool, line_mode: bool,
/// The [CursorShape] associated with these selections. /// The [`CursorShape`] associated with these selections.
cursor_shape: CursorShape, cursor_shape: CursorShape,
}, },
@ -347,7 +347,7 @@ pub enum Event {
/// The file associated with a buffer. /// The file associated with a buffer.
pub trait File: Send + Sync { pub trait File: Send + Sync {
/// Returns the [LocalFile] associated with this file, if the /// Returns the [`LocalFile`] associated with this file, if the
/// file is local. /// file is local.
fn as_local(&self) -> Option<&dyn LocalFile>; fn as_local(&self) -> Option<&dyn LocalFile>;
@ -378,7 +378,7 @@ pub trait File: Send + Sync {
/// Returns whether the file has been deleted. /// Returns whether the file has been deleted.
fn is_deleted(&self) -> bool; fn is_deleted(&self) -> bool;
/// Converts this file into an [Any] trait object. /// Converts this file into an [`Any`] trait object.
fn as_any(&self) -> &dyn Any; fn as_any(&self) -> &dyn Any;
/// Converts this file into a protobuf message. /// Converts this file into a protobuf message.
@ -1538,8 +1538,6 @@ impl Buffer {
/// Starts a transaction, providing the current time. Subsequent transactions /// Starts a transaction, providing the current time. Subsequent transactions
/// that occur within a short period of time will be grouped together. This /// that occur within a short period of time will be grouped together. This
/// is controlled by the buffer's undo grouping duration. /// is controlled by the buffer's undo grouping duration.
///
/// See [`Buffer::set_group_interval`].
pub fn start_transaction_at(&mut self, now: Instant) -> Option<TransactionId> { pub fn start_transaction_at(&mut self, now: Instant) -> Option<TransactionId> {
self.transaction_depth += 1; self.transaction_depth += 1;
if self.was_dirty_before_starting_transaction.is_none() { if self.was_dirty_before_starting_transaction.is_none() {
@ -1556,8 +1554,6 @@ impl Buffer {
/// Terminates the current transaction, providing the current time. Subsequent transactions /// Terminates the current transaction, providing the current time. Subsequent transactions
/// that occur within a short period of time will be grouped together. This /// that occur within a short period of time will be grouped together. This
/// is controlled by the buffer's undo grouping duration. /// is controlled by the buffer's undo grouping duration.
///
/// See [`Buffer::set_group_interval`].
pub fn end_transaction_at( pub fn end_transaction_at(
&mut self, &mut self,
now: Instant, now: Instant,
@ -2420,7 +2416,7 @@ impl BufferSnapshot {
} }
/// Iterates over chunks of text in the given range of the buffer. Text is chunked /// Iterates over chunks of text in the given range of the buffer. Text is chunked
/// in an arbitrary way due to being stored in a [`rope::Rope`]. The text is also /// in an arbitrary way due to being stored in a [`Rope`](text::Rope). The text is also
/// returned in chunks where each chunk has a single syntax highlighting style and /// returned in chunks where each chunk has a single syntax highlighting style and
/// diagnostic status. /// diagnostic status.
pub fn chunks<T: ToOffset>(&self, range: Range<T>, language_aware: bool) -> BufferChunks { pub fn chunks<T: ToOffset>(&self, range: Range<T>, language_aware: bool) -> BufferChunks {

View file

@ -12,7 +12,7 @@ use text::{Anchor, FromAnchor, PointUtf16, ToOffset};
/// A set of diagnostics associated with a given buffer, provided /// A set of diagnostics associated with a given buffer, provided
/// by a single language server. /// by a single language server.
/// ///
/// The diagnostics are stored in a [SumTree], which allows this struct /// The diagnostics are stored in a [`SumTree`], which allows this struct
/// to be cheaply copied, and allows for efficient retrieval of the /// to be cheaply copied, and allows for efficient retrieval of the
/// diagnostics that intersect a given range of the buffer. /// diagnostics that intersect a given range of the buffer.
#[derive(Clone, Debug, Default)] #[derive(Clone, Debug, Default)]
@ -21,9 +21,9 @@ pub struct DiagnosticSet {
} }
/// A single diagnostic in a set. Generic over its range type, because /// A single diagnostic in a set. Generic over its range type, because
/// the diagnostics are stored internally as [Anchor]s, but can be /// the diagnostics are stored internally as [`Anchor`]s, but can be
/// resolved to different coordinates types like [usize] byte offsets or /// resolved to different coordinates types like [`usize`] byte offsets or
/// [Point]s. /// [`Point`](gpui::Point)s.
#[derive(Clone, Debug, PartialEq, Eq)] #[derive(Clone, Debug, PartialEq, Eq)]
pub struct DiagnosticEntry<T> { pub struct DiagnosticEntry<T> {
/// The range of the buffer where the diagnostic applies. /// The range of the buffer where the diagnostic applies.
@ -52,7 +52,7 @@ pub struct Summary {
} }
impl<T> DiagnosticEntry<T> { impl<T> DiagnosticEntry<T> {
/// Returns a raw LSP diagnostic ssed to provide diagnostic context to lsp /// Returns a raw LSP diagnostic ssed to provide diagnostic context to LSP
/// codeAction request /// codeAction request
pub fn to_lsp_diagnostic_stub(&self) -> lsp::Diagnostic { pub fn to_lsp_diagnostic_stub(&self) -> lsp::Diagnostic {
let code = self let code = self

View file

@ -298,10 +298,12 @@ pub trait LspAdapter: 'static + Send + Sync {
delegate: &dyn LspAdapterDelegate, delegate: &dyn LspAdapterDelegate,
) -> Option<LanguageServerBinary>; ) -> Option<LanguageServerBinary>;
/// Returns true if a language server can be reinstalled. /// Returns `true` if a language server can be reinstalled.
/// If language server initialization fails, a reinstallation will be attempted unless the value returned from this method is false. ///
/// If language server initialization fails, a reinstallation will be attempted unless the value returned from this method is `false`.
///
/// Implementations that rely on software already installed on user's system /// Implementations that rely on software already installed on user's system
/// should have [`can_be_reinstalled`] return false. /// should have [`can_be_reinstalled`](Self::can_be_reinstalled) return `false`.
fn can_be_reinstalled(&self) -> bool { fn can_be_reinstalled(&self) -> bool {
true true
} }
@ -313,7 +315,7 @@ pub trait LspAdapter: 'static + Send + Sync {
fn process_diagnostics(&self, _: &mut lsp::PublishDiagnosticsParams) {} fn process_diagnostics(&self, _: &mut lsp::PublishDiagnosticsParams) {}
/// A callback called for each [`lsp_types::CompletionItem`] obtained from LSP server. /// A callback called for each [`lsp::CompletionItem`] obtained from LSP server.
/// Some LspAdapter implementations might want to modify the obtained item to /// Some LspAdapter implementations might want to modify the obtained item to
/// change how it's displayed. /// change how it's displayed.
async fn process_completion(&self, _: &mut lsp::CompletionItem) {} async fn process_completion(&self, _: &mut lsp::CompletionItem) {}
@ -335,7 +337,7 @@ pub trait LspAdapter: 'static + Send + Sync {
None None
} }
/// Returns initialization options that are going to be sent to a LSP server as a part of [`lsp_types::InitializeParams`] /// Returns initialization options that are going to be sent to a LSP server as a part of [`lsp::InitializeParams`]
fn initialization_options(&self) -> Option<Value> { fn initialization_options(&self) -> Option<Value> {
None None
} }

View file

@ -103,7 +103,7 @@ pub fn serialize_operation(operation: &crate::Operation) -> proto::Operation {
} }
} }
/// Serializes an [`operation::EditOperation`] to be sent over RPC. /// Serializes an [`EditOperation`] to be sent over RPC.
pub fn serialize_edit_operation(operation: &EditOperation) -> proto::operation::Edit { pub fn serialize_edit_operation(operation: &EditOperation) -> proto::operation::Edit {
proto::operation::Edit { proto::operation::Edit {
replica_id: operation.timestamp.replica_id as u32, replica_id: operation.timestamp.replica_id as u32,