mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
WIP
This commit is contained in:
parent
743030fc99
commit
8a566dc339
260 changed files with 6344 additions and 2958 deletions
|
@ -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,
|
||||
|
|
|
@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue