Skip to content

Commit

Permalink
Merge pull request JakeBecker#8 from balduncle/jj-changes
Browse files Browse the repository at this point in the history
Point to elixir-lsp, improve build process and docs
  • Loading branch information
Justin Johnson committed Aug 31, 2019
2 parents 3f5bde0 + 9e0d42b commit 1e1710a
Show file tree
Hide file tree
Showing 6 changed files with 417 additions and 24 deletions.
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "elixir-ls"]
path = elixir-ls
url = https://github.com/JakeBecker/elixir-ls
url = https://github.com/elixir-lsp/elixir-ls
branch = master
4 changes: 2 additions & 2 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Is this the right repo?

Most of the functionality for this extension comes from ElixirLS: https://github.com/JakeBecker/elixir-ls
Most of the functionality for this extension comes from ElixirLS: https://github.com/elixir-lsp/elixir-ls

Please file your issue on this repo (vscode-elixir-ls) only if it has something to do with VS Code specifically and would not apply to other IDEs running ElixirLS. Otherwise, file it here: https://github.com/JakeBecker/elixir-ls/issues
Please file your issue on this repo (vscode-elixir-ls) only if it has something to do with VS Code specifically and would not apply to other IDEs running ElixirLS. Otherwise, file it here: https://github.com/elixir-lsp/elixir-ls/issues

If the language server fails to launch, the problem is most likely in ElixirLS, so please file the issue on that repo.
43 changes: 28 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
# ElixirLS: Elixir support and debugger for VS Code

Provides Elixir language support and debugger. This extension is powered by the [Elixir Language Server (ElixirLS)](https://github.com/JakeBecker/elixir-ls), an Elixir implementation of Microsoft's IDE-agnostic [Language Server Protocol](https://github.com/Microsoft/language-server-protocol) and [VS Code debug protocol](https://code.visualstudio.com/docs/extensionAPI/api-debugging). Visit its page for more information. For a guide to debugger usage in Elixir, read [this blog post](https://medium.com/@JakeBeckerCode/debugging-elixir-in-vs-code-400e21814614).
Provides Elixir language support and debugger. This extension is powered by the [Elixir Language Server (ElixirLS)](https://github.com/elixir-lsp/elixir-ls), an Elixir implementation of Microsoft's IDE-agnostic [Language Server Protocol](https://github.com/Microsoft/language-server-protocol) and [VS Code debug protocol](https://code.visualstudio.com/docs/extensionAPI/api-debugging). Visit its page for more information. For a guide to debugger usage in Elixir, read [this blog post](https://medium.com/@JakeBeckerCode/debugging-elixir-in-vs-code-400e21814614).

Features include:

- Debugger support (requires Erlang >= OTP 19)
- Automatic, incremental Dialyzer analysis (requires Erlang OTP 20)
- Automatic suggestion for @spec annotations based on Dialyzer's inferred success typings
- Inline reporting of build warnings and errors (requires Elixir >= 1.6)
- Inline reporting of build warnings and errors (requires Elixir >= 1.7)
- Code completion **(suggestions are accepted using tab instead of enter, see below)**
- Smart automatic closing of code blocks
- Documentation lookup on hover
- Go-to-definition
- Code formatter (requires Elixir >= 1.6. Triggered by `Alt + Shift + F` hotkey or enabling `editor.formatOnSave`)
- Code formatter (requires Elixir >= 1.7. Triggered by `Alt + Shift + F` hotkey or enabling `editor.formatOnSave`)
- Find references to functions and modules (Thanks to @mattbaker)
- Quick symbol lookup in file (Thanks to @mattbaker)

![Screenshot](https://raw.githubusercontent.com/JakeBecker/elixir-ls/master/images/screenshot.png)
![Screenshot](https://raw.githubusercontent.com/elixir-lsp/elixir-ls/master/images/screenshot.png)

## The reason for this fork

This fork started when [Jake Becker's repository](https://github.com/JakeBecker/vscode-elixir-ls) became inactive for an extended period of time. So we decided to start an active fork to merge dormant PR's and fix issues where possible. We also believe in an open and shared governance model to share the work instead of relying on one person to shoulder the whole burden.

## Default settings

Expand Down Expand Up @@ -48,25 +52,17 @@ It may take some getting used to, but I highly recommend leaving `acceptSuggesti

## Supported versions

Elixir:

- 1.6.0 minimum
- \>= 1.6.6 recommended

Erlang:

- OTP 18 minimum
- \>= OTP 20 recommended
See [ElixirLS](https://github.com/elixir-lsp/elixir-ls) for details on the supported Elixir and Erlang versions.

## Contributing

Most of the functionality of this extension comes from ElixirLS which is included as a Git submodule in the `elixir-ls` folder. Make sure you clone the repo using `git clone --recursive` or run `git submodule init && git submodule update` after cloning. To launch the extension from VS Code, run the "Launch Extension" launch config.

Including `elixir-ls` as a submodule makes it easy to develop and test code changes for ElixirLS itself. If you want to modify ElixirLS, not just its VS Code client code, you'll want to fork the [ElixirLS](https://github.com/JakeBecker/elixir-ls) repo on Github and push any changes you make to the ElixirLS submodule to your fork. An example of how that might look:
Including `elixir-ls` as a submodule makes it easy to develop and test code changes for ElixirLS itself. If you want to modify ElixirLS, not just its VS Code client code, you'll want to fork the [ElixirLS](https://github.com/elixir-lsp/elixir-ls) repo on Github and push any changes you make to the ElixirLS submodule to your fork. An example of how that might look:

```
# Clone this repo recursively to ensure you get the elixir-ls submodule
git clone --recursive git@github.com:JakeBecker/vscode-elixir-ls.git
git clone --recursive git@github.com:elixir-lsp/vscode-elixir-ls.git
# Enter the submodule directory. Now, if you run git commands, they run in the submodule
cd vscode-elixir-ls/elixir-ls
Expand All @@ -82,6 +78,23 @@ git commit ...
git push my_fork my_new_branch
```

You can build and install the extension locally using `vsce` command and `code` CLI.

```
# Install JS dependencies
npm i
# Build the extension
vsce package
# Install it locally
code --install-extension *.vsix --force
```

Note that if you have the extension installed from the Visual Studio Marketplace and are also installing a locally
built package, you may need to disable the `Extensions: Auto Check Updates` setting to prevent your
local install from being replaced with the Marketplace version.

## Acknowledgements and related projects

There is another VS Code extension for Elixir, [VSCode Elixir](https://github.com/fr1zle/vscode-elixir). It's powered by [Elixir Sense](https://github.com/msaraiva/elixir_sense), another language "smartness" server similar to ElixirLS. Much of this extension's client code (such as syntax highlighting) was copied directly from VSCode Elixir, for which they deserve all the credit.
Loading

0 comments on commit 1e1710a

Please sign in to comment.