This extension adds support for the Erlang language to Visual Studio Code, including editing, building and debugging.
New to the extension? Open Help > Welcome > Get started with Erlang: a walkthrough that checks your Erlang/OTP and rebar3 installation, then builds, tests and debugs your project.
| Area | Features |
|---|---|
| Editing | Completion with snippets, hover docs, signature help, inlay hints, CodeLens, diagnostics while typing |
| Highlighting | TextMate grammar + semantic highlighting from the syntax tree |
| Navigation | Definition, declaration, type definition, implementations, references, document/workspace symbols, call & type hierarchy, highlight occurrences, links in -include |
| Code actions | Quick fixes from compiler diagnostics, export/unexport, generate -spec, implement behaviour callbacks, extract function, inline variable, if ↔ case, sort -export |
| Formatting | Document, selection and on-type formatting (erlfmt), folding, expand/shrink selection, rename |
| Testing | EUnit and Common Test in the Testing view: run, debug, coverage |
| Build | rebar3 commands, rebar3 tasks (compile, eunit, ct, dialyzer, release, shell, clean), Dialyzer warnings in Problems with PLT status in the status bar |
| Debugger | Launch or attach to a running node; line, function, conditional, hit-count breakpoints, logpoints; variables, call stack, inline values |
| Status | Language server state and OTP version in the status bar |

InlayHints in function calls

Modules, functions, macros, variables, parameters, types, records and record fields are colored from the real syntax tree, on top of the TextMate grammar. OTP modules are flagged as defaultLibrary and functions listed in -deprecated as deprecated.
erlang.semanticTokensEnabled
Press Ctrl+. / Cmd+. on a diagnostic or on a selection:
_-module(...)-spec from the function clauses-behaviour(...)if ↔ case-export list

Ctrl+T / Cmd+T): functions, records, types, macros across the project-spec/type usage to its -type/-opaque)-callback to every module implementing the behaviour-include / -include_lib paths and URLs in comments

., ;, ,, newline), powered by erlfmt
erlang.formatterEnabled, line length with erlang.formattingLineLengthcase/receive/try, -export lists, comment blocks and %% region / %% endregion markersShift+Alt+→ / Shift+Alt+←)? for macros, - for attributes
EUnit and Common Test tests are discovered by the language server and shown in the VS Code Testing sidebar:
*_test/0, *_test_/0 functions (including inside -ifdef(TEST))*_SUITE.erl modules and their test cases



For every workspace folder with a rebar.config, Terminal > Run Task > rebar3 offers compile (the default build task), eunit and ct (test tasks), dialyzer, shell, clean, and release when relx is configured. Compiler errors and dialyzer warnings land in the Problems panel ($rebar3 and $rebar3-dialyzer problem matchers).
Customize them in tasks.json:
{
"type": "rebar3",
"command": "ct",
"profile": "test",
"args": ["--suite", "apps/myapp/test/myapp_SUITE"],
"problemMatcher": ["$rebar3"]
}
Erlang: rebar dialyzer shows its warnings in the Problems panel. The status bar shows the state of the project PLT: none (the first run builds it, which is slow), stale (rebar.lock or rebar.config changed since it was built; rebar3 updates it incrementally on the next run) or ready. Click it to run dialyzer.

You can provide a specific command line to 'erl' in launch.json configuration file in "arguments" entry.

The modified code may be automatically build before debugger is started: add "preLaunchTask": "rebar3: compile" to the launch configuration. Then, before debugging is started, modified files will be recompiled automatically.
"erlpath": "${command:erlpath}" uses the erl from erlang.erlangPath (or the PATH). Add Configuration... in launch.json offers ready-made snippets.
{
"name": "Attach to myapp",
"type": "erlang",
"request": "attach",
"node": "myapp@localhost",
"cwd": "${workspaceFolder}"
}
The debugger starts a hidden helper node, connects to node, loads its bridge there and interprets the project's modules, so breakpoints work in the running system. Disconnecting removes every breakpoint, releases the processes stopped at one and stops interpreting; the node keeps running (use Terminate to stop it instead).
-sname/-name), with the debugger and inets applications available (a release must include them).~/.erlang.cookie by default, or a "cookie" entry.debug_info (rebar3 default).Clone this repo, and try it :
For more information about vscode and containers :
Support for Erlang tools, including rebar3, EUnit and Dialyzer

Erlang: Check Erlang/OTP and rebar3 installation - which erl and rebar3 the extension usesErlang: Show Language Server Output, Erlang: Restart Language ServerThe status bar shows the language server state (starting, ready with the OTP version, failed). A start failure is reported with a notification; click the item to open the output.
For Erlang files the extension sets 4-space indentation (erlfmt's), enables semantic highlighting and keeps format-on-save off. Override them under "[erlang]" in your settings. Double-click selects whole Erlang words: node@host atoms, 'quoted atoms', 16#FF numbers.
erlang.erlangPath - Directory location of erl/escripterlang.erlangArgs - Arguments passed to Erlang backenderlang.erlangDistributedNode - Start the Erlang backend in a distributed Erlang node for extension developmenterlang.rebarPath - Directory location of rebar/rebar3erlang.rebarBuildArgs - Arguments to provide to rebar/rebar3 build commanderlang.includePaths - Include paths are read from rebar.config, and also standard set of paths is used. This setting is for special cases when the default behaviour is not enougherlang.linting - Enable/disable dynamic validation of opened Erlang source fileserlang.codeLensEnabled - Enable/Disable CodeLenserlang.cacheManagement - Specify where and how to store large cache tableserlang.inlayHintsEnabled - Enable/Disable InlayHintserlang.semanticTokensEnabled - Enable/Disable semantic highlightingerlang.formatterEnabled - Enable/Disable the formatter (document, selection and on-type)erlang.formattingLineLength - Maximum line length for formattingerlang.verbose - Activate technical traces for use in the extension developmenterlang.verboseExcludeFilter - LSP methods excluded from technical traceserlang.debuggerRunMode - How the debug adapter is run (external, server, inline)File 'Erlang.tmLanguage' is inspired from https://github.com/textmate/erlang.tmbundle/blob/master/Syntaxes/Erlang.plist
This extension adds support for the Erlang language to Visual Studio Code, including editing, building and debugging.
New to the extension? Open Help > Welcome > Get started with Erlang: a walkthrough that checks your Erlang/OTP and rebar3 installation, then builds, tests and debugs your project.
| Area | Features |
|---|---|
| Editing | Completion with snippets, hover docs, signature help, inlay hints, CodeLens, diagnostics while typing |
| Highlighting | TextMate grammar + semantic highlighting from the syntax tree |
| Navigation | Definition, declaration, type definition, implementations, references, document/workspace symbols, call & type hierarchy, highlight occurrences, links in -include |
| Code actions | Quick fixes from compiler diagnostics, export/unexport, generate -spec, implement behaviour callbacks, extract function, inline variable, if ↔ case, sort -export |
| Formatting | Document, selection and on-type formatting (erlfmt), folding, expand/shrink selection, rename |
| Testing | EUnit and Common Test in the Testing view: run, debug, coverage |
| Build | rebar3 commands, rebar3 tasks (compile, eunit, ct, dialyzer, release, shell, clean), Dialyzer warnings in Problems with PLT status in the status bar |
| Debugger | Launch or attach to a running node; line, function, conditional, hit-count breakpoints, logpoints; variables, call stack, inline values |
| Status | Language server state and OTP version in the status bar |

InlayHints in function calls

Modules, functions, macros, variables, parameters, types, records and record fields are colored from the real syntax tree, on top of the TextMate grammar. OTP modules are flagged as defaultLibrary and functions listed in -deprecated as deprecated.
erlang.semanticTokensEnabled
Press Ctrl+. / Cmd+. on a diagnostic or on a selection:
_-module(...)-spec from the function clauses-behaviour(...)if ↔ case-export list

Ctrl+T / Cmd+T): functions, records, types, macros across the project-spec/type usage to its -type/-opaque)-callback to every module implementing the behaviour-include / -include_lib paths and URLs in comments

., ;, ,, newline), powered by erlfmt
erlang.formatterEnabled, line length with erlang.formattingLineLengthcase/receive/try, -export lists, comment blocks and %% region / %% endregion markersShift+Alt+→ / Shift+Alt+←)? for macros, - for attributes
EUnit and Common Test tests are discovered by the language server and shown in the VS Code Testing sidebar:
*_test/0, *_test_/0 functions (including inside -ifdef(TEST))*_SUITE.erl modules and their test cases



For every workspace folder with a rebar.config, Terminal > Run Task > rebar3 offers compile (the default build task), eunit and ct (test tasks), dialyzer, shell, clean, and release when relx is configured. Compiler errors and dialyzer warnings land in the Problems panel ($rebar3 and $rebar3-dialyzer problem matchers).
Customize them in tasks.json:
{
"type": "rebar3",
"command": "ct",
"profile": "test",
"args": ["--suite", "apps/myapp/test/myapp_SUITE"],
"problemMatcher": ["$rebar3"]
}
Erlang: rebar dialyzer shows its warnings in the Problems panel. The status bar shows the state of the project PLT: none (the first run builds it, which is slow), stale (rebar.lock or rebar.config changed since it was built; rebar3 updates it incrementally on the next run) or ready. Click it to run dialyzer.

You can provide a specific command line to 'erl' in launch.json configuration file in "arguments" entry.

The modified code may be automatically build before debugger is started: add "preLaunchTask": "rebar3: compile" to the launch configuration. Then, before debugging is started, modified files will be recompiled automatically.
"erlpath": "${command:erlpath}" uses the erl from erlang.erlangPath (or the PATH). Add Configuration... in launch.json offers ready-made snippets.
{
"name": "Attach to myapp",
"type": "erlang",
"request": "attach",
"node": "myapp@localhost",
"cwd": "${workspaceFolder}"
}
The debugger starts a hidden helper node, connects to node, loads its bridge there and interprets the project's modules, so breakpoints work in the running system. Disconnecting removes every breakpoint, releases the processes stopped at one and stops interpreting; the node keeps running (use Terminate to stop it instead).
-sname/-name), with the debugger and inets applications available (a release must include them).~/.erlang.cookie by default, or a "cookie" entry.debug_info (rebar3 default).Clone this repo, and try it :
For more information about vscode and containers :
Support for Erlang tools, including rebar3, EUnit and Dialyzer

Erlang: Check Erlang/OTP and rebar3 installation - which erl and rebar3 the extension usesErlang: Show Language Server Output, Erlang: Restart Language ServerThe status bar shows the language server state (starting, ready with the OTP version, failed). A start failure is reported with a notification; click the item to open the output.
For Erlang files the extension sets 4-space indentation (erlfmt's), enables semantic highlighting and keeps format-on-save off. Override them under "[erlang]" in your settings. Double-click selects whole Erlang words: node@host atoms, 'quoted atoms', 16#FF numbers.
erlang.erlangPath - Directory location of erl/escripterlang.erlangArgs - Arguments passed to Erlang backenderlang.erlangDistributedNode - Start the Erlang backend in a distributed Erlang node for extension developmenterlang.rebarPath - Directory location of rebar/rebar3erlang.rebarBuildArgs - Arguments to provide to rebar/rebar3 build commanderlang.includePaths - Include paths are read from rebar.config, and also standard set of paths is used. This setting is for special cases when the default behaviour is not enougherlang.linting - Enable/disable dynamic validation of opened Erlang source fileserlang.codeLensEnabled - Enable/Disable CodeLenserlang.cacheManagement - Specify where and how to store large cache tableserlang.inlayHintsEnabled - Enable/Disable InlayHintserlang.semanticTokensEnabled - Enable/Disable semantic highlightingerlang.formatterEnabled - Enable/Disable the formatter (document, selection and on-type)erlang.formattingLineLength - Maximum line length for formattingerlang.verbose - Activate technical traces for use in the extension developmenterlang.verboseExcludeFilter - LSP methods excluded from technical traceserlang.debuggerRunMode - How the debug adapter is run (external, server, inline)File 'Erlang.tmLanguage' is inspired from https://github.com/textmate/erlang.tmbundle/blob/master/Syntaxes/Erlang.plist
Erlang
82.6%
TypeScript
16.5%