1
0
mirror of https://github.com/amix/vimrc synced 2025-07-12 14:15:00 +08:00

Merge with master

This commit is contained in:
jaegukhyun
2022-10-23 02:19:31 +09:00
120 changed files with 371 additions and 5095 deletions

View File

@ -3,15 +3,12 @@
call ale#Set('proto_buf_lint_executable', 'buf')
call ale#Set('proto_buf_lint_config', '')
call ale#Set('proto_buf_lint_options', '')
function! ale_linters#proto#buf_lint#GetCommand(buffer) abort
let l:config = ale#Var(a:buffer, 'proto_buf_lint_config')
let l:options = ale#Var(a:buffer, 'proto_buf_lint_options')
return '%e lint'
\ . (!empty(l:config) ? ' --config=' . ale#Escape(l:config) : '')
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' %s#include_package_files=true'
endfunction
@ -22,5 +19,5 @@ call ale#linter#Define('proto', {
\ 'output_stream': 'stdout',
\ 'executable': {b -> ale#Var(b, 'proto_buf_lint_executable')},
\ 'command': function('ale_linters#proto#buf_lint#GetCommand'),
\ 'callback': 'ale#handlers#go#Handler',
\ 'callback': 'ale#handlers#unix#HandleAsError',
\})

View File

@ -2,7 +2,7 @@
" Description: Volar Language Server integration for ALE adopted from
" nvim-lspconfig and volar/packages/shared/src/types.ts
call ale#Set('vue_volar_executable', 'vue-language-server')
call ale#Set('vue_volar_executable', 'volar-server')
call ale#Set('vue_volar_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('vue_volar_init_options', {
\ 'documentFeatures': {
@ -73,7 +73,7 @@ call ale#linter#Define('vue', {
\ 'name': 'volar',
\ 'language': 'vue',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#path#FindExecutable(b, 'vue_volar', ['node_modules/.bin/vue-language-server'])},
\ 'executable': {b -> ale#path#FindExecutable(b, 'vue_volar', ['node_modules/.bin/volar-server'])},
\ 'command': '%e --stdio',
\ 'project_root': function('ale_linters#vue#volar#GetProjectRoot'),
\ 'initialization_options': function('ale_linters#vue#volar#GetInitializationOptions'),

View File

@ -1,49 +0,0 @@
call ale#Set('yaml_gitlablint_executable', 'gll')
call ale#Set('yaml_gitlablint_options', '')
function! ale_linters#yaml#gitlablint#GetCommand(buffer) abort
return '%e' . ale#Pad(ale#Var(a:buffer, 'yaml_gitlablint_options'))
\ . ' -p %t'
endfunction
function! ale_linters#yaml#gitlablint#Handle(buffer, lines) abort
" Matches patterns line the following:
" (<unknown>): mapping values are not allowed in this context at line 68 column 8
" jobs:build:dev config contains unknown keys: ony
let l:pattern = '^\(.*\) at line \(\d\+\) column \(\d\+\)$'
let l:output = []
for l:line in a:lines
let l:match = matchlist(l:line, l:pattern)
if !empty(l:match)
let l:item = {
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'text': l:match[1],
\ 'type': 'E',
\}
call add(l:output, l:item)
else
if l:line isnot# 'GitLab CI configuration is invalid'
let l:item = {
\ 'lnum': 0,
\ 'col': 0,
\ 'text': l:line,
\ 'type': 'E',
\}
call add(l:output, l:item)
endif
endif
endfor
return l:output
endfunction
call ale#linter#Define('yaml', {
\ 'name': 'gitlablint',
\ 'executable': {b -> ale#Var(b, 'yaml_gitlablint_executable')},
\ 'command': function('ale_linters#yaml#gitlablint#GetCommand'),
\ 'callback': 'ale_linters#yaml#gitlablint#Handle',
\ 'output_stream': 'stderr',
\})