diff options
Diffstat (limited to 'crates/ra_ide/src/typing.rs')
-rw-r--r-- | crates/ra_ide/src/typing.rs | 15 |
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 | ||
273 | fn foo() { | ||
274 | } | ||
275 | ", | ||
276 | r" | ||
277 | /// | ||
278 | /// <|> Some docs | ||
279 | fn foo() { | ||
280 | } | ||
281 | ", | ||
282 | ); | ||
270 | do_check_noop( | 283 | do_check_noop( |
271 | r" | 284 | r" |
272 | fn main() { | 285 | fn main() { |