Elm code visualizations for maximum productivity
elm-lens
in Atom.
Elm Lens add contextual markup to all functions, types, and and type aliases in all Elm files in your project.
Exposed expressions are marked up as exposed, while non-exposed expressions are marked up as local. Reference counts are also displayed.
Elm Lens runs parallel background processes in order to gather its data, so you aren't blocked from working on your project while Elm Lens does its work.
Clicking on the "n internal references" or "n external references" markup for a function will display a detailed list of all associated references in the reference panel. You can then click on a reference in the reference panel to navigate to the document and location of that reference.
Clicking the same markup element a second time will close the reference panel. (Of course, the reference panel can also be closed with the standard Atom interface elements.)
If a local function does not have any references in its file, Elm Lens highlights the internal references field bright red and displays a warning icon. You can clear the warning by using the function, or by simply deleting it.
If an exposed function has no references in any Elm file in the current active project, Elm Lens turns the
external references field red and displays a warning icon. You can clear the warning by removing the function from the
module's exposing
declaration, by referencing it in another module, or by deleting it.
Elm applications following 'The Elm Architecture' will, by definition, contain one exposed function that is not referenced
by another module in the system. That function is usually called main
and its signature will be Program flags model message
.
Any function whose signature begins with Program
will be marked by Elm Lens as an "Elm Application Entry Point" and no
reference data will be shown.
Tests written for use with Elm Test will also be exposed and
unreferenced in other modules. Such functions are typically executed by a command line utility like
Node Test Runner, or in Atom with
Elm Test Runner. Elm Lens will hide reference information and show a special
tag for any function with a type signature of Test
.
You can toggle each of the three pieces of data in Elm Lens's markup on and off. These are: access control, internal references, and external references. If you want to quickly toggle all markup on and off, use Ctrl-L, or select "Toggle Markup Display" from the "Packages → Elm Lens" menu.
If you prefer the markup text to be a lower opacity than the rest of your code, you can configure the opacity field with a different number. One hundred, the default, is full opacity, while zero is completely invisible. Any integer in between those two values is acceptable.
exposed-modules
exposed-modules
should be handled differently.