Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Vim Doc

on:
push:
branches:
- main

name: docs

permissions:
pull-requests: write
contents: write
Expand All @@ -23,7 +23,7 @@ jobs:
version: "Neovim >= 0.9.4"
demojify: true

- name: Create Pull Request
- name: create pull request
uses: peter-evans/create-pull-request@v5
with:
base: "main"
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/lint-test.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Lint

on:
push:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: lunarmodules/luacheck@v1
15 changes: 15 additions & 0 deletions .github/workflows/luarocks-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: LuaRocks Release
on:
push:
tags:
- "v*"
jobs:
luarocks-upload:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: luarocks upload
uses: nvim-neorocks/luarocks-tag-release@v4
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
27 changes: 17 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
name: "release"
name: Release

on:
push:
tags:
- 'v*'
branches: [main]
pull_request:
workflow_dispatch:

permissions:
pull-requests: write
contents: write

jobs:
luarocks-upload:
runs-on: ubuntu-22.04
release:
name: release
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v4
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
- uses: google-github-actions/release-please-action@v3
with:
release-type: simple
16 changes: 16 additions & 0 deletions .github/workflows/stylua.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Stylua

on:
push:
pull_request:

jobs:
stylua:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: JohnnyMorganz/stylua-action@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --color always --check lua
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test

on:
push:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
nvim-versions: ["stable", "nightly"]

name: test
steps:
- name: checkout
uses: actions/checkout@v3

- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: ${{ matrix.nvim-versions }}

- name: run tests
run: make test
13 changes: 13 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
globals = {
'vim.o',
'vim.g',
'vim.wo',
'vim.bo',
'vim.opt',
}
read_globals = {
'vim',
'describe',
'it',
'assert',
}
41 changes: 30 additions & 11 deletions lua/java-core/ls/servers/jdtls/lspconfig-types.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
---@class LspSetupConfig
---@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.
---@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.
---@field name? string Defaults to the server's name (`clangd`, `pyright`, etc.).
---@field filetypes string[] | nil Set of filetypes for which to attempt to resolve {root_dir}
---@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|).
---@field single_file_support? boolean Determines if a server is started without a matching root directory. See |lspconfig-single-file-support|.
---@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`.
---@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.
---@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.
---@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|.
---@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.
---@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.
---@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.
---@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|).
---@field single_file_support? boolean Determines if a server is started without a matching root directory.
---See |lspconfig-single-file-support|.
---@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`.
---@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.
---@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.
---@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|.
---@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.
---@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.
---@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.

---@class LspClientRequestParameters
---@field command string
Expand All @@ -23,6 +40,8 @@
---@field code number
---@field message string

---@alias LspClientRequest fun(err: any, result: any)

---@class LspClient
---@field attached_buffers table<number, boolean>
---@field cancel_request function
Expand All @@ -36,7 +55,7 @@
---@field name string
---@field notify fun(method: string, params: object): boolean
---@field offset_encoding string
---@field request fun(method: string, params: LspClientRequestParameters, callback: fun(err: any, result: any), bufnr?: number): any
---@field request fun(method:string,params:LspClientRequestParameters,callback:LspClientRequest, bufnr?:number): any
---@field request_sync function
---@field requests object
---@field rpc object
Expand Down
4 changes: 2 additions & 2 deletions lua/java-core/utils/async.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ local function async(func)
end,
__index = function(this, key)
if key == 'catch' then
return function(_error_handler)
error_handler = _error_handler
return function(loc_error_handler)
error_handler = loc_error_handler
return this
end
end
Expand Down
10 changes: 5 additions & 5 deletions lua/java-core/utils/class.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ local function call_ctor(c, obj, ...)
parent_with_init = rawget(parent_with_init, '_parent_with_init')
end
if parent_with_init then -- super() points to one above whereever _init came from
rawset(obj, 'super', function(obj, ...)
call_ctor(parent_with_init, obj, ...)
rawset(obj, 'super', function(loc_obj, ...)
call_ctor(parent_with_init, loc_obj, ...)
end)
end
else
Expand Down Expand Up @@ -180,7 +180,7 @@ local function _class(base, c_arg, c)
end

-- expose a ctor which can be called by <classname>(<args>)
mt.__call = function(class_tbl, ...)
mt.__call = function(_class_tbl, ...)
local obj
if rawget(c, '_create') then
obj = c._create(...)
Expand Down Expand Up @@ -237,10 +237,10 @@ end
-- @param c optional table to be used as class
local class
class = setmetatable({}, {
__call = function(fun, ...)
__call = function(_fun, ...)
return _class(...)
end,
__index = function(tbl, key)
__index = function(_tbl, key)
if key == 'class' then
io.stderr:write(
'require("pl.class").class is deprecated. Use require("pl.class")\n'
Expand Down
2 changes: 2 additions & 0 deletions lua/java-core/utils/log.lua
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ log.new = function(config, standalone)
end)
end
end

return obj
end

log.new(default_config, true)
Expand Down