This commit is contained in:
Luke Boswell 2024-11-11 10:22:58 +11:00
parent 743030fc99
commit 8a566dc339
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
260 changed files with 6344 additions and 2958 deletions

View file

@ -239,7 +239,7 @@ fn make_completion_item(
let typ = match subs.get(var).content {
roc_types::subs::Content::Structure(var) => match var {
roc_types::subs::FlatType::Apply(_, _) => CompletionItemKind::FUNCTION,
roc_types::subs::FlatType::Func(_, _, _) => CompletionItemKind::FUNCTION,
roc_types::subs::FlatType::Func(_, _, _, _) => CompletionItemKind::FUNCTION,
roc_types::subs::FlatType::EmptyTagUnion
| roc_types::subs::FlatType::TagUnion(_, _) => CompletionItemKind::ENUM,
_ => CompletionItemKind::VARIABLE,

View file

@ -386,9 +386,11 @@ impl IterTokens for PlatformRequires<'_> {
impl IterTokens for Loc<TypeAnnotation<'_>> {
fn iter_tokens<'a>(&self, arena: &'a Bump) -> BumpVec<'a, Loc<Token>> {
match self.value {
TypeAnnotation::Function(params, ret) => (params.iter_tokens(arena).into_iter())
.chain(ret.iter_tokens(arena))
.collect_in(arena),
TypeAnnotation::Function(params, _arrow, ret) => {
(params.iter_tokens(arena).into_iter())
.chain(ret.iter_tokens(arena))
.collect_in(arena)
}
TypeAnnotation::Apply(_mod, _type, args) => args.iter_tokens(arena),
TypeAnnotation::BoundVariable(_) => onetoken(Token::Type, self.region, arena),
TypeAnnotation::As(ty, _, as_ty) => (ty.iter_tokens(arena).into_iter())
@ -641,6 +643,7 @@ impl IterTokens for ValueDef<'_> {
onetoken(Token::Import, import.name.item.region, arena)
}
ValueDef::Stmt(loc_expr) => loc_expr.iter_tokens(arena),
ValueDef::StmtAfterExpr => BumpVec::new_in(arena),
}
}
}