Skip to content

Features

Breadcrumbs display a list of links to the current element and its ancestors in the top part of the page.

Breadcrumbs

Breadcrumbs can be enabled or disabled via:

Settings > Workbench > Breadcrumbs

The settings section contains a number of additional preferences to tweak what to display exactly (e.g. icons, symbols, complete path to the file, etc).

Breadcrumbs are provided by the lsp-mode package. To enable breadcrumbs:

(setq lsp-headerline-breadcrumb-mode t)

You can also customize what to display in the breadcrumbs by customizing the lsp-headerline-breadcrumb-segments variable. For more information please refer to the official lsp-mode documentation.

Code Completion

Get context-aware code completions for function names, macros, records, variable names and more.

Code Completion

Go To Definition

Navigate to the definition of a function, macro, record or type.

Go To Definition

Go To Implementation for OTP Behaviours

Hovering a gen_server:start_link call? Jump to the respective init function with a single keystroke.

Go To Implementation

Signature Suggestions

Never remember the order of the lists:keytake/3 arguments? You are not alone. We got you covered.

Signature Suggestions

Compiler Diagnostics

Display warnings and errors from the compiler. Inline.

Compiler Diagnostics

Dialyzer Diagnostics

It has never been so easy to make Dialyzer happy.

Dialyzer Diagnostics

Elvis Diagnostics

Display Elvis style suggestions inline. No more nit-picking comments from colleagues!

Elvis Diagnostics

Edoc

Hover a local or remote function to see its edoc. You will miss this feature so much when edocs are not available that you will start writing them!

Edoc

Navigate to included files with a single click.

Included Files

Find/Peek References

Who is calling this function? Figure it out without leaving the current context.

Peek References

Outline

Get a nice outline of your module on the side and jump between functions.

Outline

Workspace Symbols

Jump to the module you're looking for, in no time.

Workspace Symbols

Folding

Focus on what's important, fold the rest.

Folding

Snippets

Quickly insert parametrized, reusable pieces of code.

Snippets

Suggest Type Specs

Annotate your Erlang programs with type information.

Suggest Specs

Call Hierarchy

The Call Hierarchy feature lets you explore callers of a given function (known as incoming calls), as well as show which functions are called by a given function (known as outgoing calls).

For an overview of what Call Hierarchy may look like, have a look to this video.

Call Hierarchy in VS Code

To display the Call Hierarchy panel, right-click on the name of a function and select Show Call Hierarchy. You can use the newly opened panel to navigate through the hierarchy of calls.

To switch between incoming calls and outgoing calls simply use the phone icon on the top-right corner of the panel.

Call Hierarchy in Emacs

The feature is provided by the lsp-treemacs package.

To show the incoming calls hierarchy:

M-x lsp-treemacs-call-hierarchy

To show the outgoing calls hierarchy:

C-u M-x lsp-treemacs-call-hierarchy

For more information please refer to the official lsp-treemacs documentation.

Code Actions

Code Actions are a mechanism providing the user with possible corrective actions right next to an error or warning. If actions are available, a light bulb or similar icon appears next to the error or warning. When the user clicks the light bulb (or hits a shortcut), a list of available code actions is presented.

Currently Erlang LS support code actions for:

  • Exporting unused functions
  • Prepending an underscore (_) to an unused variable
  • Correct a mistyped name for an unbound variable
  • Fix a module name to match the corresponding filename

Refactoring via Wrangler

Erlang LS can offer refactoring capabilities such as fold expression, extract function, rename variable and many more via the Wrangler extension. For details on how to enable Wrangler for Erlang LS, please refer to the official documentation.