aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/typing.rs
diff options
context:
space:
mode:
authoreaglgenes101 <[email protected]>2020-02-20 17:46:50 +0000
committereaglgenes101 <[email protected]>2020-02-20 17:46:50 +0000
commitbf99a6eb084ea6a2ad105bc7328334a769db788c (patch)
tree64a96469e25bd000204b1857eec90729113e102a /crates/ra_ide/src/typing.rs
parent358b9d685fc289e0ad2bff5cb0508e8ad383b7ff (diff)
parenta8beff9cf69f81653c8f633fc663550ce0a76383 (diff)
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer
Diffstat (limited to 'crates/ra_ide/src/typing.rs')
-rw-r--r--crates/ra_ide/src/typing.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/crates/ra_ide/src/typing.rs b/crates/ra_ide/src/typing.rs
index e5d1779fd..7f1b9150f 100644
--- a/crates/ra_ide/src/typing.rs
+++ b/crates/ra_ide/src/typing.rs
@@ -42,7 +42,7 @@ pub(crate) fn on_enter(db: &RootDatabase, position: FilePosition) -> Option<Sour
42 42
43 let prefix = comment.prefix(); 43 let prefix = comment.prefix();
44 let comment_range = comment.syntax().text_range(); 44 let comment_range = comment.syntax().text_range();
45 if position.offset < comment_range.start() + TextUnit::of_str(prefix) + TextUnit::from(1) { 45 if position.offset < comment_range.start() + TextUnit::of_str(prefix) {
46 return None; 46 return None;
47 } 47 }
48 48
@@ -267,6 +267,19 @@ fn main() {
267} 267}
268", 268",
269 ); 269 );
270 do_check(
271 r"
272///<|> Some docs
273fn foo() {
274}
275",
276 r"
277///
278/// <|> Some docs
279fn foo() {
280}
281",
282 );
270 do_check_noop( 283 do_check_noop(
271 r" 284 r"
272fn main() { 285fn main() {