halohalospecial / atom-elmjutsu

A bag of tricks for developing with Elm. (Atom package)
https://atom.io/packages/elmjutsu
MIT License
192 stars 24 forks source link

Feature Idea: Keep sorting of type definition in sync with case statements #103

Open brasilikum opened 6 years ago

brasilikum commented 6 years ago

Often I find myself sorting bigger type definitions (Msg or Page) in order to group them by similarity. It would be cool if the case statements could default to the same sorting. I am aware that case statements can have a different structure because of "sub matches".

Meta: Is GitHub the right place to propose these ideas? @halohalospecial I did not find you in the elm-slack.

halohalospecial commented 6 years ago

Hi! I'm assuming you're talking about autocomplete for case expressions? It will follow the order the type cases were defined.

For example,

type Msg =
  | NoOp
  | Msg1 String
  | Msg2 Int

will result to

case msg of
    NoOp ->
        ...
    Msg1 string ->
        ...
    Msg2 int ->
        ...

So you can sort at the type definition point instead.

Meta: Yep, just submit ideas to this repo so I can keep track of them (and for discussions). You can also leave messages in the Elm Slack (same username).

brasilikum commented 6 years ago

Hi,

yes I am, but there is currently no way to keep them synced if you add something, or did I miss that? Not a killer feature, which might show that this package is already pretty awesome :)

I have seen there is some elm in this package, but it does not seem like much. Are most features implemented in JS? What would be good ways to contribute?

halohalospecial commented 6 years ago

Hi, the core is in Elm (https://github.com/halohalospecial/atom-elmjutsu/blob/master/elm/Indexer.elm) and JS is for integration with the Atom API.