Elm code visualizations for maximum productivity
- Install
elm-lens
in Atom.- In Atom, go to Atom → Preferences...
- Click "Install".
- Search for "elm-lens".
- Find "elm-lens" in the list and click the "install" button.
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.
- 0.8 Editor Dependency Abstraction
- 0.7 Exposed/Local Upgrades
- Clicking on "exposed/local" toggles the function between being exposed and local.
- Add a menu option "Auto-Adjust Exports..." which updates all exposings to correspond to whether or not the function is used externally.
- 0.6 Differentiate Test References
- 0.5 Support Type Constructors
- 0.4 Handle Zero-Reference Exposed Functions in
exposed-modules
- Functions that are exposed and unreferenced in modules listed in
exposed-modules
should be handled differently.
- Functions that are exposed and unreferenced in modules listed in
0.3 Configurability UpgradeWill be able to toggle off parts of the metadata or entire metadata via command keys and plugin options.Will be able to configure markup text opacity.
0.2 Visualization of References0.1 Initial Release