Skip to content

Commit 5a4b050

Browse files
authored
feat: add lint & release-please workflows (#42)
1 parent 33115d9 commit 5a4b050

File tree

12 files changed

+140
-64
lines changed

12 files changed

+140
-64
lines changed

.github/workflows/docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
name: Vim Doc
2+
13
on:
24
push:
35
branches:
46
- main
57

6-
name: docs
7-
88
permissions:
99
pull-requests: write
1010
contents: write
@@ -23,7 +23,7 @@ jobs:
2323
version: "Neovim >= 0.9.4"
2424
demojify: true
2525

26-
- name: Create Pull Request
26+
- name: create pull request
2727
uses: peter-evans/create-pull-request@v5
2828
with:
2929
base: "main"

.github/workflows/lint-test.yml

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

.github/workflows/lint.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: lunarmodules/luacheck@v1
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: LuaRocks Release
2+
on:
3+
push:
4+
tags:
5+
- "v*"
6+
jobs:
7+
luarocks-upload:
8+
runs-on: ubuntu-22.04
9+
steps:
10+
- uses: actions/checkout@v3
11+
12+
- name: luarocks upload
13+
uses: nvim-neorocks/luarocks-tag-release@v4
14+
env:
15+
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}

.github/workflows/release.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
name: "release"
1+
name: Release
2+
23
on:
34
push:
4-
tags:
5-
- 'v*'
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
permissions:
10+
pull-requests: write
11+
contents: write
12+
613
jobs:
7-
luarocks-upload:
8-
runs-on: ubuntu-22.04
14+
release:
15+
name: release
16+
if: ${{ github.ref == 'refs/heads/main' }}
17+
runs-on: ubuntu-latest
918
steps:
10-
- uses: actions/checkout@v3
11-
- name: LuaRocks Upload
12-
uses: nvim-neorocks/luarocks-tag-release@v4
13-
env:
14-
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
19+
- uses: google-github-actions/release-please-action@v3
20+
with:
21+
release-type: simple

.github/workflows/stylua.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Stylua
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
stylua:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: JohnnyMorganz/stylua-action@v3
13+
with:
14+
token: ${{ secrets.GITHUB_TOKEN }}
15+
version: latest
16+
args: --color always --check lua

.github/workflows/test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
nvim-versions: ["stable", "nightly"]
13+
14+
name: test
15+
steps:
16+
- name: checkout
17+
uses: actions/checkout@v3
18+
19+
- uses: rhysd/action-setup-vim@v1
20+
with:
21+
neovim: true
22+
version: ${{ matrix.nvim-versions }}
23+
24+
- name: run tests
25+
run: make test

.luacheckrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
globals = {
2+
'vim.o',
3+
'vim.g',
4+
'vim.wo',
5+
'vim.bo',
6+
'vim.opt',
7+
}
8+
read_globals = {
9+
'vim',
10+
'describe',
11+
'it',
12+
'assert',
13+
}

lua/java-core/ls/servers/jdtls/lspconfig-types.lua

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,33 @@
11
---@class LspSetupConfig
2-
---@field root_dir fun(filename: string, bufnr: number): string | nil Returns either a filepath (string) or nil. The language server will only start if the function returns a filepath.
2+
---@field root_dir fun(filename: string, bufnr: number): string | nil Returns either a filepath (string) or nil.
3+
---The language server will only start if the function returns a filepath.
34
---@field name? string Defaults to the server's name (`clangd`, `pyright`, etc.).
45
---@field filetypes string[] | nil Set of filetypes for which to attempt to resolve {root_dir}
5-
---@field autostart? boolean Controls if the `FileType` autocommand that launches a language server is created. If `false`, allows for deferring language servers until manually launched with `:LspStart` (|lspconfig-commands|).
6-
---@field single_file_support? boolean Determines if a server is started without a matching root directory. See |lspconfig-single-file-support|.
7-
---@field on_new_config fun(new_config: LspSetupConfig, new_root_dir: string) Function executed after a root directory is detected. This is used to modify the server configuration (including `cmd` itself). Most commonly, this is used to inject additional arguments into `cmd`.
8-
---@field capabilities table<string, string|table|boolean|function> a table which represents the neovim client capabilities. Useful for broadcasting to the server additional functionality (snippets, off-protocol features) provided by plugins.
9-
---@field cmd string[] a list where each entry corresponds to the blankspace delimited part of the command that launches the server. The first entry is the binary used to run the language server. Additional entries are passed as arguments.
10-
---@field handlers table<string, function> a list of handlers which override the function used to process a response from a given language server. Applied only to the server referenced by setup. See |lsp-handler|.
11-
---@field init_options table<string, string|table|boolean> a table passed during the initialization notification after launching a language server. Equivalent to the `initializationOptions` field found in `InitializeParams` in the LSP specification.
12-
---@field on_attach fun(client: object, bufnr: number) Callback invoked by Nvim's built-in client when attaching a buffer to a language server. Often used to set Nvim (buffer or global) options or to override the Nvim client properties (`server_capabilities`) after a language server attaches. Most commonly used for settings buffer local keybindings. See |lspconfig-keybindings| for a usage example.
13-
---@field settings table <string, string|table|boolean> The `settings` table is sent in `on_init` via a `workspace/didChangeConfiguration` notification from the Nvim client to the language server. These settings allow a user to change optional runtime settings of the language server.
6+
---@field autostart? boolean Controls if the `FileType` autocommand that launches a language server is created.
7+
---If `false`, allows for deferring language servers until manually launched with `:LspStart` (|lspconfig-commands|).
8+
---@field single_file_support? boolean Determines if a server is started without a matching root directory.
9+
---See |lspconfig-single-file-support|.
10+
---@field on_new_config fun(new_config: LspSetupConfig, new_root_dir: string) Function executed after a root directory
11+
---is detected. This is used to modify the server configuration (including `cmd` itself).
12+
---Most commonly, this is used to inject additional arguments into `cmd`.
13+
---@field capabilities table<string, string|table|boolean|function> a table which represents the neovim client
14+
---capabilities. Useful for broadcasting to the server additional functionality (snippets, off-protocol features)
15+
---provided by plugins.
16+
---@field cmd string[] a list where each entry corresponds to the blankspace delimited part of the command that
17+
---launches the server. The first entry is the binary used to run the language server.
18+
---Additional entries are passed as arguments.
19+
---@field handlers table<string, function> a list of handlers which override the function used to process a response
20+
---from a given language server. Applied only to the server referenced by setup. See |lsp-handler|.
21+
---@field init_options table<string, string|table|boolean> a table passed during the initialization notification after
22+
---launching a language server. Equivalent to the `initializationOptions` field found in `InitializeParams`
23+
---in the LSP specification.
24+
---@field on_attach fun(client: object, bufnr: number) Callback invoked by Nvim's built-in client when attaching a
25+
---buffer to a language server. Often used to set Nvim (buffer or global) options or to override the Nvim client
26+
---properties (`server_capabilities`) after a language server attaches. Most commonly used for settings buffer local
27+
---keybindings. See |lspconfig-keybindings| for a usage example.
28+
---@field settings table <string, string|table|boolean> The `settings` table is sent in `on_init` via a
29+
---`workspace/didChangeConfiguration` notification from the Nvim client to the language server.
30+
---These settings allow a user to change optional runtime settings of the language server.
1431

1532
---@class LspClientRequestParameters
1633
---@field command string
@@ -23,6 +40,8 @@
2340
---@field code number
2441
---@field message string
2542

43+
---@alias LspClientRequest fun(err: any, result: any)
44+
2645
---@class LspClient
2746
---@field attached_buffers table<number, boolean>
2847
---@field cancel_request function
@@ -36,7 +55,7 @@
3655
---@field name string
3756
---@field notify fun(method: string, params: object): boolean
3857
---@field offset_encoding string
39-
---@field request fun(method: string, params: LspClientRequestParameters, callback: fun(err: any, result: any), bufnr?: number): any
58+
---@field request fun(method:string,params:LspClientRequestParameters,callback:LspClientRequest, bufnr?:number): any
4059
---@field request_sync function
4160
---@field requests object
4261
---@field rpc object

lua/java-core/utils/async.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ local function async(func)
6060
end,
6161
__index = function(this, key)
6262
if key == 'catch' then
63-
return function(_error_handler)
64-
error_handler = _error_handler
63+
return function(loc_error_handler)
64+
error_handler = loc_error_handler
6565
return this
6666
end
6767
end

0 commit comments

Comments
 (0)