diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-09-20 09:02:51 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-09-20 09:02:51 +0100 |
commit | 4101c15ddbae860b86cd2ed17b09b7526ef17de8 (patch) | |
tree | 2a5096fd6c61fbf9e7561ba59ac732d93c442fcf /crates/ra_ide_api | |
parent | 58dc3b16496cbcce14101605aa1214e263b91c87 (diff) | |
parent | e26c41d611738d70a26001141841283c9463a80d (diff) |
Merge #1879
1879: A few doc comments r=matklad a=kjeremy
Co-authored-by: kjeremy <[email protected]>
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r-- | crates/ra_ide_api/src/lib.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs index e90fbd428..412dc4d71 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide_api/src/lib.rs | |||
@@ -223,6 +223,7 @@ impl Query { | |||
223 | } | 223 | } |
224 | } | 224 | } |
225 | 225 | ||
226 | /// Info associated with a text range. | ||
226 | #[derive(Debug)] | 227 | #[derive(Debug)] |
227 | pub struct RangeInfo<T> { | 228 | pub struct RangeInfo<T> { |
228 | pub range: TextRange, | 229 | pub range: TextRange, |
@@ -235,6 +236,8 @@ impl<T> RangeInfo<T> { | |||
235 | } | 236 | } |
236 | } | 237 | } |
237 | 238 | ||
239 | /// Contains information about a call site. Specifically the | ||
240 | /// `FunctionSignature`and current parameter. | ||
238 | #[derive(Debug)] | 241 | #[derive(Debug)] |
239 | pub struct CallInfo { | 242 | pub struct CallInfo { |
240 | pub signature: FunctionSignature, | 243 | pub signature: FunctionSignature, |
@@ -325,11 +328,12 @@ impl Analysis { | |||
325 | (host.analysis(), file_id) | 328 | (host.analysis(), file_id) |
326 | } | 329 | } |
327 | 330 | ||
331 | /// Features for Analysis. | ||
328 | pub fn feature_flags(&self) -> &FeatureFlags { | 332 | pub fn feature_flags(&self) -> &FeatureFlags { |
329 | &self.db.feature_flags | 333 | &self.db.feature_flags |
330 | } | 334 | } |
331 | 335 | ||
332 | /// Debug info about the current state of the analysis | 336 | /// Debug info about the current state of the analysis. |
333 | pub fn status(&self) -> Cancelable<String> { | 337 | pub fn status(&self) -> Cancelable<String> { |
334 | self.with_db(|db| status::status(&*db)) | 338 | self.with_db(|db| status::status(&*db)) |
335 | } | 339 | } |
@@ -440,6 +444,7 @@ impl Analysis { | |||
440 | }) | 444 | }) |
441 | } | 445 | } |
442 | 446 | ||
447 | /// Returns the definitions from the symbol at `position`. | ||
443 | pub fn goto_definition( | 448 | pub fn goto_definition( |
444 | &self, | 449 | &self, |
445 | position: FilePosition, | 450 | position: FilePosition, |
@@ -447,6 +452,7 @@ impl Analysis { | |||
447 | self.with_db(|db| goto_definition::goto_definition(db, position)) | 452 | self.with_db(|db| goto_definition::goto_definition(db, position)) |
448 | } | 453 | } |
449 | 454 | ||
455 | /// Returns the impls from the symbol at `position`. | ||
450 | pub fn goto_implementation( | 456 | pub fn goto_implementation( |
451 | &self, | 457 | &self, |
452 | position: FilePosition, | 458 | position: FilePosition, |
@@ -454,6 +460,7 @@ impl Analysis { | |||
454 | self.with_db(|db| impls::goto_implementation(db, position)) | 460 | self.with_db(|db| impls::goto_implementation(db, position)) |
455 | } | 461 | } |
456 | 462 | ||
463 | /// Returns the type definitions for the symbol at `position`. | ||
457 | pub fn goto_type_definition( | 464 | pub fn goto_type_definition( |
458 | &self, | 465 | &self, |
459 | position: FilePosition, | 466 | position: FilePosition, |
@@ -540,6 +547,7 @@ impl Analysis { | |||
540 | self.with_db(|db| references::rename(db, position, new_name)) | 547 | self.with_db(|db| references::rename(db, position, new_name)) |
541 | } | 548 | } |
542 | 549 | ||
550 | /// Performs an operation on that may be Canceled. | ||
543 | fn with_db<F: FnOnce(&db::RootDatabase) -> T + std::panic::UnwindSafe, T>( | 551 | fn with_db<F: FnOnce(&db::RootDatabase) -> T + std::panic::UnwindSafe, T>( |
544 | &self, | 552 | &self, |
545 | f: F, | 553 | f: F, |