A bag of tricks for developing with Elm.
Go to Definition:
Related Atom packages:
By default, the only thing this package does is parse your project's source files to extract information, and download documentation of 3rd-party Elm packages. You have to manually enable the features that you need. The downloaded documentation files will be saved to the path set in
Cache Directory in the settings view. If
Cache Directory is blank, a temporary directory will be used. Take note that most operating systems delete temporary directories at bootup or at regular intervals.
Autocomplete is turned off by default. To turn it on, check
Enable Autocomplete in the package settings.
This provides suggestions for imports, project symbols, and 3rd-party package symbols.
Enable autocompleteof the language-elm package to prevent duplicate suggestions.
Enable Global Autocompleteif you want to include unimported project symbols.
Auto importcompletion (which works like Add Import).
You can check
Enable Autocomplete Fuzzy Filtering to filter suggestions using fuzz-aldrin-plus.
If the typed text starts with a slash (
/), the rest of the characters will be used as a regular expression to filter the suggestions by name.
If the typed text starts with a colon (
:), the rest of the characters will be used as a regular expression to filter the suggestions by type signature.
If you want to filter by name and type signature, put two underscores (
__) in between. For example,
:cons__String will suggest
Char -> String -> String) and
String -> Maybe.Maybe ( Char, String )).
Use underscores in lieu of spaces (e.g. to match
List a, type
Remember to escape dots, vertical bars, braces (for records), parentheses (for tuples), etc.
Enable Autocomplete Snippetsif you prefer.
Press tab to go to the next tab stop (similar to how snippets work). Special completions can be disabled individually in the package settings.
Insert default arguments
Replace type with default
Define from type annotation
See Global Autocomplete.
Replace with inferred type
See Type-Aware Autocomplete for a screenshot.
Enable Type-Aware Autocompleteif you want to prioritize suggestions matching the expected type at cursor position.
Infer Typecommand, but it's recommended to check
Infer Expected Type At Cursor On The Flyin the package settings instead.
Enable Global Autocompleteis also checked.
It's recommended to uncheck
Enable autocomplete of the language-elm. No need to install
If you are experiencing lag while typing, you can set the value of
Max Number of Autocomplete Suggestions to a small number such as
50 so that Atom will have less items to render.
If the hyperclick package is installed, you can also check
Enable Hyperclick to jump to definition using
Ctrl + click /
Cmd + click (Mac).
Moves the cursor to the position of the next usage.
Moves the cursor to the position of the previous usage.
The current cursor position is added to a navigation stack before jumping via:
Go To Definition
Go To Symbol
Go To Next Usage
Go To Previous Usage
Invoke this command to jump back to the previous position.
Usages panel (the panel is shown after invoking
Find Usages or
This is disabled by default. To turn it on, check
Show Types in Tooltip in the package settings. You can also change the placement of the tooltip (
Types Tooltip Position).
Shows the type hints and documentation for the symbol at cursor position. The size, position of the panel, and amount of information to show can be modified in the package settings.
Sidekick Position= "bottom",
Sidekick Size= 0 (Automatically resizes to fit content.)
Sidekick Position= "right",
Sidekick Size= 300
Sidekick Position= "bottom",
Show Types in Sidekickis checked,
Show Doc Comments in Sidekickand
Show Source Paths in Sidekickare unchecked.
Elm Make Pathis properly configured in the package settings. The default works for most cases.
Show Types in Tooltipchecked in the package settings (or the Sidekick panel visible) to be able to see the inferred types.
Infer Expected Type At Cursor On The Flyand
Infer Type Of Selection On The Flyoptions in the package settings.
Infer Type Of Selection On The Flycurrently has bad interactions with some packages that decorate the markers (e.g.
Find And Replace) This will be fixed in the future.
Quickly adds an import without scrolling to the top of the file. Also sorts the imports, removes duplicates, and removes defaults automatically.
Add Importand choosing an already imported symbol (like
+, for example).
Quickly installs a package.
elm-package install --yes <name> <version>(or
elm-package install --yes <name>if the selected version is "Auto").
Elm Package Pathis properly configured in the package settings. The default works for most cases.
Removes an installed package.
elm-package.json, then runs
elm-package install --yesto clean up.
Renames the symbol across the whole project. Take note that this is not an undoable operation.
Here is an example:
'atom-text-editor:not([mini])[data-grammar^="source elm"]': 'f12': 'elmjutsu:go-to-definition' 'ctrl-r': 'elmjutsu:go-to-symbol' 'shift-f12': 'elmjutsu:find-usages' 'f8': 'elmjutsu:go-to-next-usage' 'shift-f8': 'elmjutsu:go-to-previous-usage' 'ctrl-f12': 'elmjutsu:go-back' 'alt-insert': 'elmjutsu:add-import' 'f2': 'elmjutsu:rename-symbol' 'alt-shift-l': 'elmjutsu:surround-with-let' 'alt-l': 'elmjutsu:lift-to-let' 'alt-t': 'elmjutsu:lift-to-top-level' 'alt-i': 'elmjutsu:infer-type' 'atom-workspace': 'f1': 'elmjutsu:toggle-sidekick' 'ctrl-shift-f12': 'elmjutsu:hide-usages-panel'
Add them to your
keymap.cson or bind them from
CHANGELOG.mdbefore upgrading to a newer version to check for breaking changes.
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.