Last active
July 6, 2019 16:09
-
-
Save jclosure/0d99907e89f0887e19fef6ec37f1c869 to your computer and use it in GitHub Desktop.
Hacking on lsp-elixir--get-root
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; ... | |
| (require-package 'elixir-mode) | |
| (require-package 'lsp-mode) | |
| (require-package 'company-lsp) | |
| (require 'lsp-elixir) | |
| (add-hook 'elixir-mode-hook #'lsp-elixir-enable) | |
| (require 'company) | |
| (push 'company-lsp company-backends) | |
| ;; ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (require 'lsp-mode) | |
| (require 'lsp-common) | |
| (defconst lsp-elixir--get-root | |
| (lsp-make-traverser #'(lambda (dir) | |
| (directory-files dir nil "mix.exs")))) | |
| (lsp-define-stdio-client | |
| lsp-elixir | |
| "elixir" | |
| lsp-elixir--get-root | |
| '("sh" "/Users/rodrigues/.elixir-ls-server/language_server.sh")) | |
| (provide 'lsp-elixir) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env elixir | |
| version = "0.2.14" | |
| repo = "https://github.com/JakeBecker/elixir-ls" | |
| release_url = "#{repo}/releases/download/v#{version}/elixir-ls.zip" | |
| release_path = "~/.elixir-ls-server" |> Path.expand() | |
| zip_path = "#{release_path}/server.zip" | |
| unless release_path |> File.dir?() do | |
| System.cmd("mkdir", ["-p", release_path]) | |
| System.cmd("curl", ["-fSL", release_url, "-o", zip_path]) | |
| :zip.unzip(to_charlist(zip_path), cwd: to_charlist(release_path)) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment