mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-31 09:07:21 +00:00
Remove references to Task and CalledVia::BangSuffix
This commit is contained in:
parent
406cc6c5e9
commit
bbe2d7c46f
3 changed files with 13 additions and 14 deletions
|
@ -566,13 +566,13 @@ main =
|
|||
let before = HEADER.to_string()
|
||||
+ indoc! {r#"
|
||||
main =
|
||||
Task.ok {}"#};
|
||||
"Hello, World!""#};
|
||||
|
||||
let after = HEADER.to_string()
|
||||
+ indoc! {r#"
|
||||
main : Task {} *
|
||||
main : Str
|
||||
main =
|
||||
Task.ok {}
|
||||
"Hello, World!"
|
||||
"#};
|
||||
|
||||
let annotated = annotate_string(before);
|
||||
|
@ -593,16 +593,16 @@ main =
|
|||
fn test_annotate_destructure() {
|
||||
let before = HEADER.to_string()
|
||||
+ indoc! {r#"
|
||||
{a, b} = {a: Task.ok {}, b: (1, 2)}
|
||||
{a, b} = {a: "zero", b: (1, 2)}
|
||||
|
||||
main = a"#};
|
||||
|
||||
let after = HEADER.to_string()
|
||||
+ indoc! {r#"
|
||||
{a, b} : { a : Task {} *, b : ( Num *, Num * )* }
|
||||
{a, b} = {a: Task.ok {}, b: (1, 2)}
|
||||
{a, b} : { a : Str, b : ( Num *, Num * )* }
|
||||
{a, b} = {a: "zero", b: (1, 2)}
|
||||
|
||||
main : Task {} *
|
||||
main : Str
|
||||
main = a
|
||||
"#};
|
||||
|
||||
|
|
|
@ -92,8 +92,7 @@ pub fn find_declaration_at(
|
|||
|
||||
fn visit_expr(&mut self, expr: &Expr, region: Region, var: Variable) {
|
||||
if self.should_visit(region) {
|
||||
if let Expr::Call(_, args, CalledVia::BangSuffix | CalledVia::QuestionSuffix) = expr
|
||||
{
|
||||
if let Expr::Call(_, args, CalledVia::QuestionSuffix) = expr {
|
||||
let Expr::Closure(ClosureData { arguments, .. }) = &args[1].1.value else {
|
||||
internal_error!("Suffixed expression did not contain a closure")
|
||||
};
|
||||
|
|
|
@ -687,7 +687,7 @@ mod tests {
|
|||
#[tokio::test]
|
||||
async fn test_annotate_single() {
|
||||
let edit = code_action_edits(
|
||||
DOC_LIT.to_string() + "main = Task.ok {}",
|
||||
DOC_LIT.to_string() + r#"main = "Hello, world!""#,
|
||||
Position::new(3, 2),
|
||||
"Add signature",
|
||||
)
|
||||
|
@ -706,7 +706,7 @@ mod tests {
|
|||
character: 0,
|
||||
},
|
||||
},
|
||||
new_text: "main : Task {} *\n",
|
||||
new_text: "main : Str\n",
|
||||
},
|
||||
]
|
||||
"#]]
|
||||
|
@ -719,7 +719,7 @@ mod tests {
|
|||
DOC_LIT.to_string()
|
||||
+ indoc! {r#"
|
||||
other = \_ ->
|
||||
Task.ok {}
|
||||
"Something else?"
|
||||
|
||||
main =
|
||||
other {}
|
||||
|
@ -742,7 +742,7 @@ mod tests {
|
|||
character: 0,
|
||||
},
|
||||
},
|
||||
new_text: "other : * -> Task {} *\n",
|
||||
new_text: "other : * -> Str\n",
|
||||
},
|
||||
TextEdit {
|
||||
range: Range {
|
||||
|
@ -755,7 +755,7 @@ mod tests {
|
|||
character: 0,
|
||||
},
|
||||
},
|
||||
new_text: "main : Task {} *\n",
|
||||
new_text: "main : Str\n",
|
||||
},
|
||||
]
|
||||
"#]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue