Skip to content

Commit 9c0d99d

Browse files
authored
Merge branch 'main' into projectionist-live-component-json-view
2 parents 5afed24 + e4e8196 commit 9c0d99d

19 files changed

+250
-123
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Tests
22

33
on: [push, pull_request]
4+
concurrency:
5+
group: ci-${{ github.ref }}
6+
cancel-in-progress: true
47

58
jobs:
69
unit_tests:
@@ -17,23 +20,32 @@ jobs:
1720
manager: sudo apt-get
1821
packages: -y fd-find esl-erlang elixir
1922
- os: ubuntu-20.04
20-
url: https://github.com/neovim/neovim/releases/download/v0.9.0/nvim-linux64.tar.gz
23+
url: https://github.com/neovim/neovim/releases/download/v0.9.1/nvim-linux64.tar.gz
2124
manager: sudo apt-get
2225
packages: -y fd-find esl-erlang elixir
2326
- os: ubuntu-20.04
2427
url: https://github.com/neovim/neovim/releases/download/v0.8.3/nvim-linux64.tar.gz
2528
manager: sudo apt-get
2629
packages: -y fd-find esl-erlang elixir
27-
# - os: macos-11
28-
# url: https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz
29-
# manager: brew
30-
# packages: fd elixir
31-
# - os: macos-11
32-
# url: https://github.com/neovim/neovim/releases/download/v0.6.0/nvim-macos.tar.gz
33-
# manager: brew
34-
# packages: fd elixir
30+
- os: macos-12
31+
url: https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz
32+
manager: brew
33+
packages: fd elixir
34+
- os: macos-12
35+
url: https://github.com/neovim/neovim/releases/download/v0.9.1/nvim-macos.tar.gz
36+
manager: brew
37+
packages: fd elixir
38+
- os: macos-12
39+
url: https://github.com/neovim/neovim/releases/download/v0.8.3/nvim-macos.tar.gz
40+
manager: brew
41+
packages: fd elixir
3542
steps:
36-
- uses: actions/checkout@v2
43+
- uses: actions/checkout@v3
44+
- uses: JohnnyMorganz/stylua-action@v3
45+
with:
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
version: latest
48+
args: --check .
3749

3850
- run: date +%F > todays-date
3951
- name: Restore from todays cache
@@ -54,11 +66,14 @@ jobs:
5466
mkdir -p _neovim
5567
curl -sL ${{ matrix.url }} | tar xzf - --strip-components=1 -C "${PWD}/_neovim"
5668
}
57-
mkdir -p ~/.local/share/nvim/site/pack/vendor/start
58-
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
59-
ln -s "$(pwd)" ~/.local/share/nvim/site/pack/vendor/start
69+
# mkdir -p ~/.local/share/nvim/site/pack/vendor/start
70+
# git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
71+
# git clone --depth 1 https://github.com/tpope/vim-projectionist ~/.local/share/nvim/site/pack/vendor/start/vim-projectionist
72+
# ln -s "$(pwd)" ~/.local/share/nvim/site/pack/vendor/start
6073
6174
- name: Run tests
75+
env:
76+
BUSTED_TIMEOUT: 600000
6277
run: |
6378
export PATH="${PWD}/_neovim/bin:${PATH}"
6479
export VIM="${PWD}/_neovim/share/nvim/runtime"

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Requires 0.8
3636
elixir.setup {
3737
credo = {},
3838
elixirls = {
39-
enabled = true,
39+
enable = true,
4040
settings = elixirls.settings {
4141
dialyzerEnabled = false,
4242
enableTestLenses = false,
@@ -71,7 +71,7 @@ The minimal setup will configure both ElixirLS and credo-language-server.
7171
require("elixir").setup()
7272
```
7373

74-
ElixirLS and credo-language-server can be disabled by setting the `enabled` flag in the respective options table.
74+
ElixirLS and credo-language-server can be disabled by setting the `enable` flag in the respective options table.
7575

7676
```lua
7777
require("elixir").setup({
@@ -94,6 +94,7 @@ elixir.setup {
9494
credo = {
9595
port = 9000, -- connect via TCP with the given port. mutually exclusive with `cmd`
9696
cmd = "path/to/credo-language-server", -- path to the executable. mutually exclusive with `port`
97+
version = "0.1.0-rc.3", -- version of credo-language-server to install and use. defaults to 0.0.5
9798
on_attach = function(client, bufnr)
9899
-- custom keybinds
99100
end
@@ -102,7 +103,7 @@ elixir.setup {
102103
-- specify a repository and branch
103104
repo = "mhanberg/elixir-ls", -- defaults to elixir-lsp/elixir-ls
104105
branch = "mh/all-workspace-symbols", -- defaults to nil, just checkouts out the default branch, mutually exclusive with the `tag` option
105-
tag = "v0.13.0", -- defaults to nil, mutually exclusive with the `branch` option
106+
tag = "v0.14.6", -- defaults to nil, mutually exclusive with the `branch` option
106107

107108
-- alternatively, point to an existing elixir-ls installation (optional)
108109
-- not currently supported by elixirls, but can be a table if you wish to pass other args `{"path/to/elixirls", "--foo"}`
@@ -175,10 +176,10 @@ ElixirLS provides a codelens to identify and run your tests. If you configure `e
175176
: Open the output panel that displays logs and compiler information from the server.
176177

177178
```lua
178-
require("elixir").open_output_panel()
179-
require("elixir").open_output_panel({ window = "split" })
180-
require("elixir").open_output_panel({ window = "vsplit" })
181-
require("elixir").open_output_panel({ window = "float" })
179+
require("elixir.elixirls").open_output_panel()
180+
require("elixir.elixirls").open_output_panel({ window = "split" })
181+
require("elixir.elixirls").open_output_panel({ window = "vsplit" })
182+
require("elixir.elixirls").open_output_panel({ window = "float" })
182183
```
183184

184185
## credo-language-server

bin/credo-language-server

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
#!/usr/bin/env elixir
1+
#!/usr/bin/env elixir --sname undefined
22

33
System.no_halt(true)
44

5-
{%{credo: {_, :credo, credo_version, _, _, _, _, _}}, _} = Code.eval_file(System.get_env("CREDO_MIX_LOCK_PATH", "./mix.lock"))
6-
7-
Mix.install([
8-
{:credo_language_server, "0.0.5"},
9-
{:credo, credo_version}
10-
])
5+
Mix.install([ {:credo_language_server, System.get_env("CREDO_LSP_VERSION")}, ])
116

127
Application.ensure_all_started(:credo_language_server)

bin/test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22

3-
nvim --headless --noplugin -u support/minimal_init.vim -c "PlenaryBustedDirectory tests/ {minimal_init = 'support/minimal_init.vim', timeout = 180000}"
3+
NVIM_APPNAME=elixirtoolsplenary nvim --headless -u support/minimal_init.lua -c "PlenaryBustedDirectory ${1:-tests} {init = 'support/minimal_init.lua', timeout = ${BUSTED_TIMEOUT:-180000}}"

bin/test-local

Lines changed: 0 additions & 3 deletions
This file was deleted.

doc/elixir-tools.nvim.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*elixir-tools.nvim.txt* For NVIM v0.8.0 Last change: 2023 May 13
1+
*elixir-tools.nvim.txt* For NVIM v0.8.0 Last change: 2023 June 07
22

33
==============================================================================
44
Table of Contents *elixir-tools.nvim-table-of-contents*
@@ -59,7 +59,7 @@ LAZY.NVIM *elixir-tools.nvim-install-lazy.nvim*
5959
elixir.setup {
6060
credo = {},
6161
elixirls = {
62-
enabled = true,
62+
enable = true,
6363
settings = elixirls.settings {
6464
dialyzerEnabled = false,
6565
enableTestLenses = false,
@@ -98,8 +98,8 @@ The minimal setup will configure both ElixirLS and credo-language-server.
9898
require("elixir").setup()
9999
<
100100

101-
ElixirLS and credo-language-server can be disabled by setting the `enabled`
102-
flag in the respective options table.
101+
ElixirLS and credo-language-server can be disabled by setting the `enable` flag
102+
in the respective options table.
103103

104104
>lua
105105
require("elixir").setup({
@@ -125,6 +125,7 @@ default to the latest release.
125125
credo = {
126126
port = 9000, -- connect via TCP with the given port. mutually exclusive with `cmd`
127127
cmd = "path/to/credo-language-server", -- path to the executable. mutually exclusive with `port`
128+
version = "0.1.0-rc.3", -- version of credo-language-server to install and use. defaults to 0.0.5
128129
on_attach = function(client, bufnr)
129130
-- custom keybinds
130131
end
@@ -133,7 +134,7 @@ default to the latest release.
133134
-- specify a repository and branch
134135
repo = "mhanberg/elixir-ls", -- defaults to elixir-lsp/elixir-ls
135136
branch = "mh/all-workspace-symbols", -- defaults to nil, just checkouts out the default branch, mutually exclusive with the `tag` option
136-
tag = "v0.13.0", -- defaults to nil, mutually exclusive with the `branch` option
137+
tag = "v0.14.6", -- defaults to nil, mutually exclusive with the `branch` option
137138

138139
-- alternatively, point to an existing elixir-ls installation (optional)
139140
-- not currently supported by elixirls, but can be a table if you wish to pass other args `{"path/to/elixirls", "--foo"}`
@@ -231,10 +232,10 @@ COMMANDS ~
231232

232233

233234
>lua
234-
require("elixir").open_output_panel()
235-
require("elixir").open_output_panel({ window = "split" })
236-
require("elixir").open_output_panel({ window = "vsplit" })
237-
require("elixir").open_output_panel({ window = "float" })
235+
require("elixir.elixirls").open_output_panel()
236+
require("elixir.elixirls").open_output_panel({ window = "split" })
237+
require("elixir.elixirls").open_output_panel({ window = "vsplit" })
238+
require("elixir.elixirls").open_output_panel({ window = "float" })
238239
<
239240

240241

lua/elixir/credo/init.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
local M = {}
22

3+
if not vim.uv then
4+
vim.uv = vim.loop
5+
end
6+
37
function M.setup(opts)
48
local credo = vim.api.nvim_create_augroup("elixir-tools.credo", { clear = true })
59

@@ -8,7 +12,7 @@ function M.setup(opts)
812
pattern = { "elixir" },
913
callback = function()
1014
local matches = vim.fs.find({ "mix.lock" }, {
11-
stop = vim.loop.os_homedir(),
15+
stop = vim.uv.os_homedir(),
1216
upward = true,
1317
path = vim.fs.dirname(vim.api.nvim_buf_get_name(0)),
1418
})
@@ -43,7 +47,9 @@ function M.setup(opts)
4347
vim.lsp.start {
4448
name = "Credo",
4549
cmd = cmd,
46-
cmd_env = { CREDO_MIX_LOCK_PATH = file },
50+
cmd_env = {
51+
CREDO_LSP_VERSION = opts.version,
52+
},
4753
settings = {},
4854
root_dir = vim.fs.dirname(file),
4955
on_attach = opts.on_attach or function() end,

lua/elixir/elixirls/compile.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function M.compile(source_path, install_path, opts)
4545

4646
-- sync is just for testing
4747
if do_sync then
48-
compile:sync(180000)
48+
compile:sync(300000)
4949
else
5050
compile:start()
5151
end

lua/elixir/elixirls/download.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function M.clone(dir, opts)
2222
enable_recording = true,
2323
}
2424

25-
clone:sync()
25+
clone:sync(60000)
2626

2727
assert(clone.code == 0, "Failed to clone")
2828

lua/elixir/elixirls/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ local Utils = require("elixir.utils")
99
local capabilities = vim.lsp.protocol.make_client_capabilities()
1010
capabilities.textDocument.completion.completionItem.snippetSupport = true
1111

12-
local default_install_tag = "tags/v0.13.0"
12+
local default_install_tag = "tags/v0.14.6"
1313

1414
local elixir_nvim_output_bufnr
1515

0 commit comments

Comments
 (0)