mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
Add doc strings
This commit is contained in:
parent
c47a34fddc
commit
3fbb48907e
2 changed files with 9 additions and 4 deletions
|
@ -35,10 +35,10 @@ use crate::{
|
||||||
#[derive(Default, Debug, Clone, PartialEq, Eq)]
|
#[derive(Default, Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct DocumentationLinks {
|
pub struct DocumentationLinks {
|
||||||
/// The URL to the documentation on docs.rs.
|
/// The URL to the documentation on docs.rs.
|
||||||
/// Could be invalid.
|
/// May not lead anywhere.
|
||||||
pub web_url: Option<String>,
|
pub web_url: Option<String>,
|
||||||
/// The URL to the documentation in the local file system.
|
/// The URL to the documentation in the local file system.
|
||||||
/// Could be invalid.
|
/// May not lead anywhere.
|
||||||
pub local_url: Option<String>,
|
pub local_url: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ pub(crate) fn remove_links(markdown: &str) -> String {
|
||||||
|
|
||||||
// Feature: Open Docs
|
// Feature: Open Docs
|
||||||
//
|
//
|
||||||
// Retrieve a link to documentation for the given symbol.
|
// Retrieve a links to documentation for the given symbol.
|
||||||
//
|
//
|
||||||
// The simplest way to use this feature is via the context menu. Right-click on
|
// The simplest way to use this feature is via the context menu. Right-click on
|
||||||
// the selected item. The context menu opens. Select **Open Docs**.
|
// the selected item. The context menu opens. Select **Open Docs**.
|
||||||
|
@ -459,6 +459,8 @@ fn map_links<'e>(
|
||||||
/// ```ignore
|
/// ```ignore
|
||||||
/// https://doc.rust-lang.org/std/iter/trait.Iterator.html#tymethod.next
|
/// https://doc.rust-lang.org/std/iter/trait.Iterator.html#tymethod.next
|
||||||
/// ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
/// ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
/// file:///project/root/target/doc/std/iter/trait.Iterator.html#tymethod.next
|
||||||
|
/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
/// ```
|
/// ```
|
||||||
fn get_doc_base_urls(
|
fn get_doc_base_urls(
|
||||||
db: &RootDatabase,
|
db: &RootDatabase,
|
||||||
|
|
|
@ -467,7 +467,10 @@ impl Analysis {
|
||||||
self.with_db(|db| moniker::moniker(db, position))
|
self.with_db(|db| moniker::moniker(db, position))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return URL(s) for the documentation of the symbol under the cursor.
|
/// Returns URL(s) for the documentation of the symbol under the cursor.
|
||||||
|
/// # Arguments
|
||||||
|
/// * `position` - Position in the file.
|
||||||
|
/// * `target_dir` - Directory where the build output is storeda.
|
||||||
pub fn external_docs(
|
pub fn external_docs(
|
||||||
&self,
|
&self,
|
||||||
position: FilePosition,
|
position: FilePosition,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue