roc-lang / roc

A fast, friendly, functional language.
https://roc-lang.org
Universal Permissive License v1.0
4.46k stars 313 forks source link

Automatic annotation of top-level type signatures #7042

Open smores56 opened 2 months ago

smores56 commented 2 months ago

We want to let users have Roc give their functions an inferred type signature. There are a few ways we want to provide this:

Our LSP should provide two new code actions: 1) "Add signature" to this value, either at top level or within a function/block 2) At the top of the file, "Add signatures to all top-level defs" with missing signatures

We also want our formatter to have a new subcommand annotate that will add signatures to all top-level defs in a file with missing signatures. e.g. roc format annotate <file.roc>