Fix off by one in onEnter
This commit is contained in:
parent
4e288c64ff
commit
5cd311d64e
@ -42,7 +42,7 @@ pub(crate) fn on_enter(db: &RootDatabase, position: FilePosition) -> Option<Sour
|
||||
|
||||
let prefix = comment.prefix();
|
||||
let comment_range = comment.syntax().text_range();
|
||||
if position.offset < comment_range.start() + TextUnit::of_str(prefix) + TextUnit::from(1) {
|
||||
if position.offset < comment_range.start() + TextUnit::of_str(prefix) {
|
||||
return None;
|
||||
}
|
||||
|
||||
@ -265,6 +265,19 @@ fn main() {
|
||||
// <|> me
|
||||
let x = 1 + 1;
|
||||
}
|
||||
",
|
||||
);
|
||||
do_check(
|
||||
r"
|
||||
///<|> Some docs
|
||||
fn foo() {
|
||||
}
|
||||
",
|
||||
r"
|
||||
///
|
||||
/// <|> Some docs
|
||||
fn foo() {
|
||||
}
|
||||
",
|
||||
);
|
||||
do_check_noop(
|
||||
|
Loading…
x
Reference in New Issue
Block a user