All Projects → s-kostyaev → Ivy Erlang Complete

s-kostyaev / Ivy Erlang Complete

ivy-erlang-complete is context sensitive completion for erlang without connecting to erlang nodes.

Programming Languages

erlang
1774 projects

Labels

Projects that are alternatives of or similar to Ivy Erlang Complete

.emacs.d
bdd's Emacs configuration, split from bdd/.dotfiles/emacs directory.
Stars: ✭ 8 (-75%)
Mutual labels:  emacs
Darkmine Theme
Yet another emacs dark color theme
Stars: ✭ 10 (-68.75%)
Mutual labels:  emacs
Yard Mode.el
Emacs minor mode for editing YARD tags
Stars: ✭ 29 (-9.37%)
Mutual labels:  emacs
Dakrone Light Theme
Dakrone's custom light Emacs theme
Stars: ✭ 9 (-71.87%)
Mutual labels:  emacs
Shader Mode
Unity shader editing mode for GNU Emacs
Stars: ✭ 10 (-68.75%)
Mutual labels:  emacs
Magit Cheatsheet
Stars: ✭ 13 (-59.37%)
Mutual labels:  emacs
Kaleidoscope.el
Control Kaleidoscope-powered devices from the comfort of your Emacs.
Stars: ✭ 8 (-75%)
Mutual labels:  emacs
Geekbook
G33KB00K3 - fun to read & fun to write -- 🤓 eXtreme eXtendable note taking system for nerds/geeks (including scientists!) docs: http://geekbook.rtfd.io = beautiful html generator of your markdown-based notes
Stars: ✭ 31 (-3.12%)
Mutual labels:  emacs
Doxymacs
Doxymacs is Doxygen + {X}Emacs.
Stars: ✭ 10 (-68.75%)
Mutual labels:  emacs
Hlinum Mode
This library extends linum-mode to highlight current line number.
Stars: ✭ 29 (-9.37%)
Mutual labels:  emacs
Suscolors Emacs
Colorful theme for Emacs, Inspired by Gruvbox.
Stars: ✭ 9 (-71.87%)
Mutual labels:  emacs
Bonjourmadame
Say "Hello ma'am!"
Stars: ✭ 9 (-71.87%)
Mutual labels:  emacs
Cfgs
My personal configs
Stars: ✭ 14 (-56.25%)
Mutual labels:  emacs
Metamorph
Transform your code in turing-complete ways
Stars: ✭ 9 (-71.87%)
Mutual labels:  emacs
Emacs Smart Hungry Delete
An emacs package to delete whitespace between words, parenthesis and other delimiters in a (not very) smart way.
Stars: ✭ 30 (-6.25%)
Mutual labels:  emacs
Emacs Datetime
Stars: ✭ 8 (-75%)
Mutual labels:  emacs
Nano Emacs
GNU Emacs / N Λ N O - Emacs made simple
Stars: ✭ 872 (+2625%)
Mutual labels:  emacs
Wordnut
Emacs major mode interface to WordNet lexical database
Stars: ✭ 31 (-3.12%)
Mutual labels:  emacs
Vhdl Mode
A package for Sublime Text that aids coding in the VHDL language.
Stars: ✭ 31 (-3.12%)
Mutual labels:  emacs
Emacs.dz
Awesome emacs config files
Stars: ✭ 886 (+2668.75%)
Mutual labels:  emacs

ivy-erlang-complete

License GPL 3 MELPA MELPA Stable

ivy-erlang-complete gives context sensitive completion for Erlang without connecting to Erlang nodes. It also can go to definition/references/specs and find files in the current Erlang project. Projects will be setup automatically based on rebar or rebar3 configs, and some heuristics. For now this package also support eldoc.

asciicast

Installation

You can now install the package ivy-erlang-complete from MELPA. Just M-x package-installEnter ivy-erlang-complete Enter.

System packages

  • findutils
  • coreutils
  • sed
  • grep
  • the_silver_searcher ag (for finding definition, references and specs) or
  • ripgrep rg (preferred). Ripgrep is faster on this cases so if you install it ivy-erlang-complete will use rg for finding definition, references and specs. Just install ripgrep.

Basic setup

To start using ivy-erlang-complete you need add the following to init.el:

(require 'ivy-erlang-complete)
(add-hook 'erlang-mode-hook #'ivy-erlang-complete-init)
;; automatic update completion data after save
(add-hook 'after-save-hook #'ivy-erlang-complete-reparse)

Advanced setup

For a better Erlang development experience you also can add these packages:

  • rebar for building & testing
  • flycheck for on the fly error checking (will setup automatically)
  • wrangler for smart refactoring

This is my emacs config for erlang developement:

;;;; Erlang
(defun my-erlang-hook ()
  "Setup for erlang."
  (require 'wrangler)
  (ivy-erlang-complete-init)
  (defvar erlang-extended-mode-map)
  (define-key erlang-extended-mode-map (kbd "M-.") nil)
  (define-key erlang-extended-mode-map (kbd "M-,") nil)
  (define-key erlang-extended-mode-map (kbd "M-?") nil)
  (define-key erlang-extended-mode-map (kbd "(") nil))
(add-hook 'erlang-mode-hook #'my-erlang-hook)
(add-hook 'after-save-hook #'ivy-erlang-complete-reparse)

(add-to-list 'auto-mode-alist '("rebar\\.config$" . erlang-mode))
(add-to-list 'auto-mode-alist '("relx\\.config$" . erlang-mode))
(add-to-list 'auto-mode-alist '("system\\.config$" . erlang-mode))
(add-to-list 'auto-mode-alist '("\\.app\\.src$" . erlang-mode))

;;; wrangler
;; install https://github.com/RefactoringTools/wrangler/blob/master/INSTALL
;; before usage
(add-to-list 'load-path "/usr/lib/erlang/lib/wrangler-1.2.0/elisp")
;(require 'wrangler)
; Some code inspection functionalities of Wrangler generate .dot
; files, which can be compiled and previewed in Emacs if the
; Graphviz-dot mode for Emacs is enabled.
;(load-library "graphviz-dot-mode")

Default keybindings

By default next keybindings will be setup (can be disabled by setting variable ivy-erlang-complete-use-default-keys to nil):

key function description
C-: ivy-erlang-complete start completion at point
C-c C-h ivy-erlang-complete-show-doc-at-point show docs for function under point (from standart library) in your browser
C-c C-e ivy-erlang-complete-set-project-root manually setup project root for strange cases (if you find that case please open issue)
M-. ivy-erlang-complete-find-definition go to definition
M-? ivy-erlang-complete-find-references go to references
C-c C-f ivy-erlang-complete-find-spec go to spec or callback definition
M-, xref-pop-marker-stack for emacs 25+ go back
M-, pop-global-mark for emacs 24 go back
C-c C-o ivy-erlang-complete-find-file find file in current project (preselect file or symbol under point)

Current state

For now project is useful for production erlang development. There are some minor issues with context identifying. In this cases accuracy sacrificed for speed. Also completing for functions in modules with export_all directive doesn't work. I can implement it. But I don't do it because this implementation is very slow. Also I think that export_all is bad practice.

There are context sensitive completions for:

  • local variables
  • local functions
  • module names
  • module functions
  • record names
  • record fields
  • macros names
  • guards
  • types

completions

Also you can find:

  • definition of:
    • functions
    • macros
    • records
    • types
  • references of:
    • functions
    • records
    • macros
    • types

go to definition references

  • specs for:
    • functions
    • callbacks from used behaviours

find spec

See documentation for functions from standard library in your browser.

TODO

  • [x] create company backend
  • [x] add eldoc support
  • [ ] improve working with macros (add arity and eldoc)
  • [x] renew gifs in this file (added link to asciinema)

Why not distel?

distel is great. I think distel much better than this package in some cases. But I can't configure it for work with my job's projects. I thought that only licensed nodes can connect to cluster, distel nodes can not. It was mistake. I was trying to use esense instead. But esense project is now dead and nobody fix crashes in it. So I start this project. For now this project can do all the things that esense can do and more.

Why not edts?

edts need for project configuration for every project you work with. Every day I work with many erlang projects. And I don't like configuration process at all. So this package no need it - it work out of the box. Also I don't use edts sufficient time so please add your comparison here.

Contributing

Patches are welcome :) You also can send your bugreports and feature requests here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].