Git Product home page Git Product logo

atom-elmjutsu's Introduction

Elmjutsu

A bag of tricks for developing with Elm.

https://atom.io/packages/elmjutsu

Feature Overview

Requirements

Feature Details

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

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.

  • It's recommended to uncheck Enable autocomplete of the language-elm package to prevent duplicate suggestions.

autocomplete

  • Check Enable Global Autocomplete if you want include unimported project symbols. This will also enable "Auto import" autocompletion.

auto-import

  • You can also check Enable Autocomplete Snippets if you prefer.

autocomplete-snippet

  • Special completions:

Press tab to go to the next tab stop (similar to how snippets work).

construct-basic

construct-case-of

construct-default-value-for-type

construct-from-type-annotation-1

construct-from-type-annotation-2

Elmjutsu: Go To Definition

go-to-definition

If the hyperclick package is installed, you can also check Enable Hyperclick to jump to definition using Ctrl + click / Cmd + click (Mac).

Elmjutsu: Go To Symbol

go-to-symbol

Elmjutsu: Find Usages

find-usages

Elmjutsu: Go To Next Usage

Moves the cursor to the position of the next usage.

Elmjutsu: Go To Previous Usage

Moves the cursor to the position of the previous usage.

Elmjutsu: Go Back

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.

Elmjutsu: Rename Symbol

Renames the symbol across the whole project. Take note that this is not an undoable operation.

  • Press enter to rename or escape to cancel.
  • Uncheck usages to exclude.
  • Modified modules with open editors will not be saved automatically.
  • Renaming a module will not rename the associated file.
  • Currently, this also modifies the symbol name inside comments.

rename-symbol

Elmjutsu: Hide Usages Panel

Closes the Usages panel (the panel is shown after invoking Find Usages or Rename Symbol).

Elmjutsu: Add Import

Quickly adds an import without scrolling to the top of the file. Also sorts the imports, removes duplicates, and removes defaults automatically.

add-import

Elmjutsu: Toggle Sidekick

Shows the type hints and documentation for the symbol at cursor position. The size and position of the panel can be modified in the package settings.

  • Example #1 (default): Sidekick Position = "bottom", Sidekick Size = 0 (Automatically resizes to fit content.)

sidekick1

  • Example #2: Sidekick Position = "bottom", Sidekick Size = 30 (Just shows the type hints.)

sidekick2

  • Example #3: Sidekick Position = "right", Sidekick Size = 300

sidekick3

Elmjutsu: Install Package

Quickly installs a package.

  • This runs elm-package install --yes <name> <version> (or elm-package install --yes <name> if the selected version is "Auto").
  • Make sure that Elm Package Path is properly configured in the package settings.

Elmjutsu: Uninstall Package

Removes an installed package.

  • This removes the dependency from elm-package.json, then runs elm-package install --yes to clean up.

Keybindings

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'
  'f2': 'elmjutsu:rename-symbol'
  'alt-insert': 'elmjutsu:add-import'

'atom-workspace':
  'f1': 'elmjutsu:toggle-sidekick'
  'ctrl-shift-f12': 'elmjutsu:hide-usages-panel'

'atom-text-editor':
  'alt-enter': 'elmjutsu:eval'
  'ctrl-enter': 'elmjutsu:pipe-selections'

'.elmjutsu-pipe-selections':
  "ctrl-enter": "elmjutsu:apply-pipe-selections"

Add them to your keymap.cson or bind them from Settings > Keybindings.

Notes

  • Be sure to check out the settings for this package to find out about the available options.
  • It's highly recommended to read CHANGELOG.md before upgrading to a newer version to check for breaking changes.
  • The commands only work for top-level values for now.
  • You may encounter weird behaviors if multiple files are using the same module name in your project.
  • Major parts of this will be rewritten when a way to get the AST becomes available. Also, more features :)

Credits

atom-elmjutsu's People

Contributors

halohalospecial avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.