Added support for harper in markdown files (#5104)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled

This commit is contained in:
Armand Halbert
2026-03-28 06:22:26 -05:00
committed by GitHub
parent 0369442b06
commit 3d3b75cdc5
10 changed files with 166 additions and 1 deletions

View File

@@ -329,6 +329,27 @@ function! ale#lsp#UpdateConfig(conn_id, buffer, config) abort
return 1
endfunction
function! ale#lsp#GetConnectionConfig(conn_id) abort
let l:conn = get(s:connections, a:conn_id, {})
return get(l:conn, 'config', {})
endfunction
" Send a JSON-RPC response to a server-initiated request (e.g. workspace/configuration).
" Unlike ale#lsp#Send, which builds outgoing requests/notifications with a 'method' field,
" this sends a response with 'id' + 'result' fields to reply to a request the server sent us.
function! ale#lsp#SendResponse(conn_id, id, result) abort
let l:conn = get(s:connections, a:conn_id, {})
if empty(l:conn)
return
endif
let l:body = json_encode({'jsonrpc': '2.0', 'id': a:id, 'result': a:result})
let l:data = 'Content-Length: ' . strlen(l:body) . "\r\n\r\n" . l:body
call s:SendMessageData(l:conn, l:data)
endfunction
function! ale#lsp#CallInitCallbacks(conn_id) abort
let l:conn = get(s:connections, a:conn_id, {})

View File

@@ -241,6 +241,10 @@ function! ale#lsp_linter#HandleLSPResponse(conn_id, response) abort
\ : a:response.result.items
call ale#lsp_linter#HandleLSPDiagnostics(a:conn_id, l:uri, l:diagnostics)
elseif l:method is# 'workspace/configuration'
let l:items = get(get(a:response, 'params', {}), 'items', [])
let l:config = ale#lsp#GetConnectionConfig(a:conn_id)
call ale#lsp#SendResponse(a:conn_id, a:response.id, map(copy(l:items), 'l:config'))
elseif l:method is# 'window/showMessage'
call ale#lsp_window#HandleShowMessage(
\ s:lsp_linter_map[a:conn_id].name,