Skip to content

Commit 591f2e0

Browse files
committed
Add doc strings
1 parent 90aea3b commit 591f2e0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

crates/ide/src/doc_links.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ use crate::{
3535
#[derive(Default, Debug, Clone, PartialEq, Eq)]
3636
pub struct DocumentationLinks {
3737
/// The URL to the documentation on docs.rs.
38-
/// Could be invalid.
38+
/// May not lead anywhere.
3939
pub web_url: Option<String>,
4040
/// The URL to the documentation in the local file system.
41-
/// Could be invalid.
41+
/// May not lead anywhere.
4242
pub local_url: Option<String>,
4343
}
4444

@@ -119,7 +119,7 @@ pub(crate) fn remove_links(markdown: &str) -> String {
119119

120120
// Feature: Open Docs
121121
//
122-
// Retrieve a link to documentation for the given symbol.
122+
// Retrieve a links to documentation for the given symbol.
123123
//
124124
// The simplest way to use this feature is via the context menu. Right-click on
125125
// the selected item. The context menu opens. Select **Open Docs**.
@@ -459,6 +459,8 @@ fn map_links<'e>(
459459
/// ```ignore
460460
/// https://doc.rust-lang.org/std/iter/trait.Iterator.html#tymethod.next
461461
/// ^^^^^^^^^^^^^^^^^^^^^^^^^^
462+
/// file:///project/root/target/doc/std/iter/trait.Iterator.html#tymethod.next
463+
/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
462464
/// ```
463465
fn get_doc_base_urls(
464466
db: &RootDatabase,

crates/ide/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,10 @@ impl Analysis {
456456
self.with_db(|db| moniker::moniker(db, position))
457457
}
458458

459-
/// Return URL(s) for the documentation of the symbol under the cursor.
459+
/// Returns URL(s) for the documentation of the symbol under the cursor.
460+
/// # Arguments
461+
/// * `position` - Position in the file.
462+
/// * `target_dir` - Directory where the build output is storeda.
460463
pub fn external_docs(
461464
&self,
462465
position: FilePosition,

0 commit comments

Comments
 (0)