Skip to content
master
Go to file
Code

Latest commit

* Don’t run formatter directly on the saved file

The previous code formatter was triggered after a file was saved to the
disk. After that, the `mix format` command was run on that file,
formatting its content and changing them on the disk. At last, VSCode
reloaded the file with the updated contents.

This approach had two major disadvantages:
- The whole process is slow and has a delay of about 2 seconds on every
  file save.
- Since the changes to the file happen outside of the editor, we break
  the undo feature and cause some trouble with other extensions such as
  live-share.

With this commit we use stdio to pass and get the code from `mix format`
instead of formatting directly the file on the disk. The resulting
formatted code is managed by VSCode, allowing undos and increasing
performance.
ccf9457

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Elixir Support for Visual Studio Code

Download Download Gitter Build Status

Read the CHANGELOG to see what has changed in this extension over time.

This extension adds rich elixir language support to VS Code including:

  • Syntax Coloring
  • Snippets
  • Intellisense

Features

Autocomplete

example

Problems

problems

Theme used in the examples: 'Atom One Dark'

Using

Make sure you have installed elixir with all its dependencies correctly and make sure it's in your path. You can check this by typing elixir --version into a terminal.

There currently is no option to change the path of the elixir executable. If you feel like there is a need for this, feel free to open up a pull request.

Autocomplete

Autocomplete/Intellisense is implemented using the wonderful ElixirSense project. For the auto complete to work properly, you will have to recompile your source code from time to time (using mix compile) for it to pick up the latest changes to your source code.

If your are having issues with the new implmentation you can switch back to the old one (alchemist server) by setting the property elixir.useElixirSense to false

Problem Reporting

To get compile warning / errors and test failures in your problem view, add the following to your .vscode/tasks.json:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "build",
      "type": "shell",
      "command": "mix compile",
      "problemMatcher": [
        "$mixCompileError",
        "$mixCompileWarning"
      ],
      "group": {
        "kind": "build",
        "isDefault": true
      }
    },
    {
      "label": "test",
      "type": "shell",
      "command": "mix test",
      "problemMatcher": [
        "$mixCompileError",
        "$mixCompileWarning",
        "$mixTestFailure"
      ],
      "group": {
        "kind": "test",
        "isDefault": true
      }
    }
  ]
}

See https://code.visualstudio.com/docs/editor/tasks for the documentation about tasks or https://code.visualstudio.com/docs/editor/tasks-appendix#_schema-for-tasksjson for the documentation about the tasks.json schema.

Emmet completions

To get Emmet support in html.eex files add the following to your user settings (Ctrl + ,):

"emmet.includeLanguages": {"HTML (Eex)": "html"}

Contributors

These wonderful people have so far contributed to this extension. Feel free to add your name here:

(This list is in no particular order.)

You can’t perform that action at this time.