mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
Temporarily disable format string completions
This commit is contained in:
parent
e6e72809e3
commit
c504518775
1 changed files with 49 additions and 46 deletions
|
@ -8,6 +8,9 @@ use crate::{context::CompletionContext, CompletionItem, CompletionItemKind, Comp
|
||||||
|
|
||||||
/// Complete identifiers in format strings.
|
/// Complete identifiers in format strings.
|
||||||
pub(crate) fn format_string(acc: &mut Completions, ctx: &CompletionContext) {
|
pub(crate) fn format_string(acc: &mut Completions, ctx: &CompletionContext) {
|
||||||
|
if true {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let string = match ast::String::cast(ctx.token.clone()) {
|
let string = match ast::String::cast(ctx.token.clone()) {
|
||||||
Some(it) if is_format_string(&it) => it,
|
Some(it) if is_format_string(&it) => it,
|
||||||
_ => return,
|
_ => return,
|
||||||
|
@ -36,7 +39,7 @@ pub(crate) fn format_string(acc: &mut Completions, ctx: &CompletionContext) {
|
||||||
mod tests {
|
mod tests {
|
||||||
use expect_test::{expect, Expect};
|
use expect_test::{expect, Expect};
|
||||||
|
|
||||||
use crate::tests::{check_edit, completion_list_no_kw};
|
use crate::tests::completion_list_no_kw;
|
||||||
|
|
||||||
fn check(ra_fixture: &str, expect: Expect) {
|
fn check(ra_fixture: &str, expect: Expect) {
|
||||||
let actual = completion_list_no_kw(ra_fixture);
|
let actual = completion_list_no_kw(ra_fixture);
|
||||||
|
@ -59,49 +62,49 @@ format_args!("f$0");
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
// #[test]
|
||||||
fn completes_locals() {
|
// fn completes_locals() {
|
||||||
check_edit(
|
// check_edit(
|
||||||
"foobar",
|
// "foobar",
|
||||||
r#"
|
// r#"
|
||||||
macro_rules! format_args {
|
// macro_rules! format_args {
|
||||||
($lit:literal $(tt:tt)*) => { 0 },
|
// ($lit:literal $(tt:tt)*) => { 0 },
|
||||||
}
|
// }
|
||||||
fn main() {
|
// fn main() {
|
||||||
let foobar = 1;
|
// let foobar = 1;
|
||||||
format_args!("{f$0");
|
// format_args!("{f$0");
|
||||||
}
|
// }
|
||||||
"#,
|
// "#,
|
||||||
r#"
|
// r#"
|
||||||
macro_rules! format_args {
|
// macro_rules! format_args {
|
||||||
($lit:literal $(tt:tt)*) => { 0 },
|
// ($lit:literal $(tt:tt)*) => { 0 },
|
||||||
}
|
// }
|
||||||
fn main() {
|
// fn main() {
|
||||||
let foobar = 1;
|
// let foobar = 1;
|
||||||
format_args!("{foobar");
|
// format_args!("{foobar");
|
||||||
}
|
// }
|
||||||
"#,
|
// "#,
|
||||||
);
|
// );
|
||||||
check_edit(
|
// check_edit(
|
||||||
"foobar",
|
// "foobar",
|
||||||
r#"
|
// r#"
|
||||||
macro_rules! format_args {
|
// macro_rules! format_args {
|
||||||
($lit:literal $(tt:tt)*) => { 0 },
|
// ($lit:literal $(tt:tt)*) => { 0 },
|
||||||
}
|
// }
|
||||||
fn main() {
|
// fn main() {
|
||||||
let foobar = 1;
|
// let foobar = 1;
|
||||||
format_args!("{$0");
|
// format_args!("{$0");
|
||||||
}
|
// }
|
||||||
"#,
|
// "#,
|
||||||
r#"
|
// r#"
|
||||||
macro_rules! format_args {
|
// macro_rules! format_args {
|
||||||
($lit:literal $(tt:tt)*) => { 0 },
|
// ($lit:literal $(tt:tt)*) => { 0 },
|
||||||
}
|
// }
|
||||||
fn main() {
|
// fn main() {
|
||||||
let foobar = 1;
|
// let foobar = 1;
|
||||||
format_args!("{foobar");
|
// format_args!("{foobar");
|
||||||
}
|
// }
|
||||||
"#,
|
// "#,
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue