aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src
diff options
context:
space:
mode:
authorJeremy A. Kolb <[email protected]>2018-11-05 21:37:27 +0000
committerAleksey Kladov <[email protected]>2018-11-07 15:24:55 +0000
commit8ccd26adf396b49c7ba9e3abe0a92869b1a4c728 (patch)
tree2c234f6095e8299f5b4606fe7c4a92d4373f7a5c /crates/ra_analysis/src
parent6df71da81f9260890ac42ed992946543d697e57c (diff)
Show documentation for hover requests
Diffstat (limited to 'crates/ra_analysis/src')
-rw-r--r--crates/ra_analysis/src/imp.rs10
-rw-r--r--crates/ra_analysis/src/lib.rs7
2 files changed, 17 insertions, 0 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs
index 819827b95..166f1484f 100644
--- a/crates/ra_analysis/src/imp.rs
+++ b/crates/ra_analysis/src/imp.rs
@@ -364,6 +364,16 @@ impl AnalysisImpl {
364 ret 364 ret
365 } 365 }
366 366
367 pub fn doc_comment_for(
368 &self,
369 file_id: FileId,
370 symbol: FileSymbol,
371 ) -> Cancelable<Option<String>> {
372 let file = self.db.file_syntax(file_id);
373
374 Ok(symbol.docs(&file))
375 }
376
367 pub fn diagnostics(&self, file_id: FileId) -> Cancelable<Vec<Diagnostic>> { 377 pub fn diagnostics(&self, file_id: FileId) -> Cancelable<Vec<Diagnostic>> {
368 let module_tree = self.module_tree(file_id)?; 378 let module_tree = self.module_tree(file_id)?;
369 let syntax = self.db.file_syntax(file_id); 379 let syntax = self.db.file_syntax(file_id);
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs
index 0ea9ebee7..db4e1ba86 100644
--- a/crates/ra_analysis/src/lib.rs
+++ b/crates/ra_analysis/src/lib.rs
@@ -258,6 +258,13 @@ impl Analysis {
258 pub fn find_all_refs(&self, position: FilePosition) -> Cancelable<Vec<(FileId, TextRange)>> { 258 pub fn find_all_refs(&self, position: FilePosition) -> Cancelable<Vec<(FileId, TextRange)>> {
259 Ok(self.imp.find_all_refs(position)) 259 Ok(self.imp.find_all_refs(position))
260 } 260 }
261 pub fn doc_comment_for(
262 &self,
263 file_id: FileId,
264 symbol: FileSymbol
265 ) -> Cancelable<Option<String>> {
266 self.imp.doc_comment_for(file_id, symbol)
267 }
261 pub fn parent_module(&self, position: FilePosition) -> Cancelable<Vec<(FileId, FileSymbol)>> { 268 pub fn parent_module(&self, position: FilePosition) -> Cancelable<Vec<(FileId, FileSymbol)>> {
262 self.imp.parent_module(position) 269 self.imp.parent_module(position)
263 } 270 }