mirror of
https://github.com/amix/vimrc
synced 2025-08-30 02:44:59 +08:00
Updated plugins
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
" Author: Jon Parise <jon@indelible.org>
|
||||
" Description: ElixirLS integration (https://github.com/JakeBecker/elixir-ls)
|
||||
" Description: ElixirLS integration (https://github.com/elixir-lsp/elixir-ls)
|
||||
|
||||
call ale#Set('elixir_elixir_ls_release', 'elixir-ls')
|
||||
call ale#Set('elixir_elixir_ls_config', {})
|
||||
|
@ -17,13 +17,15 @@ function! ale_linters#glsl#glslang#Handle(buffer, lines) abort
|
||||
" Matches patterns like the following:
|
||||
"
|
||||
" ERROR: 0:5: 'foo' : undeclared identifier
|
||||
let l:pattern = '^\(.\+\): \(\d\+\):\(\d\+\): \(.\+\)'
|
||||
" or when using options like -V or -G or --target-env
|
||||
" ERROR: filename:5: 'foo' : undeclared identifier
|
||||
let l:pattern = '^\(.\+\): \(.\+\):\(\d\+\): \(.\+\)'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': str2nr(l:match[3]),
|
||||
\ 'col': str2nr(l:match[2]),
|
||||
\ 'col' : 0,
|
||||
\ 'text': l:match[4],
|
||||
\ 'type': l:match[1] is# 'ERROR' ? 'E' : 'W',
|
||||
\})
|
||||
|
@ -1,58 +0,0 @@
|
||||
" Author: Ben Reedy <https://github.com/breed808>, Jeff Willette <jrwillette88@gmail.com>
|
||||
" Description: Adds support for the gometalinter suite for Go files
|
||||
|
||||
call ale#Set('go_gometalinter_options', '')
|
||||
call ale#Set('go_gometalinter_executable', 'gometalinter')
|
||||
call ale#Set('go_gometalinter_lint_package', 0)
|
||||
|
||||
function! ale_linters#go#gometalinter#GetCommand(buffer) abort
|
||||
let l:filename = expand('#' . a:buffer . ':t')
|
||||
let l:options = ale#Var(a:buffer, 'go_gometalinter_options')
|
||||
let l:lint_package = ale#Var(a:buffer, 'go_gometalinter_lint_package')
|
||||
|
||||
" BufferCdString is used so that we can be sure the paths output from gometalinter can
|
||||
" be calculated to absolute paths in the Handler
|
||||
if l:lint_package
|
||||
return ale#go#EnvString(a:buffer)
|
||||
\ . '%e'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
||||
endif
|
||||
|
||||
return ale#go#EnvString(a:buffer)
|
||||
\ . '%e'
|
||||
\ . ' --include=' . ale#Escape(ale#util#EscapePCRE(l:filename))
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#go#gometalinter#GetMatches(lines) abort
|
||||
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:?:?(warning|error):?\s\*?(.+)$'
|
||||
|
||||
return ale#util#GetMatches(a:lines, l:pattern)
|
||||
endfunction
|
||||
|
||||
function! ale_linters#go#gometalinter#Handler(buffer, lines) abort
|
||||
let l:dir = expand('#' . a:buffer . ':p:h')
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale_linters#go#gometalinter#GetMatches(a:lines)
|
||||
" l:match[1] will already be an absolute path, output from gometalinter
|
||||
call add(l:output, {
|
||||
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'col': l:match[3] + 0,
|
||||
\ 'type': tolower(l:match[4]) is# 'warning' ? 'W' : 'E',
|
||||
\ 'text': l:match[5],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'gometalinter',
|
||||
\ 'executable': {b -> ale#Var(b, 'go_gometalinter_executable')},
|
||||
\ 'cwd': '%s:h',
|
||||
\ 'command': function('ale_linters#go#gometalinter#GetCommand'),
|
||||
\ 'callback': 'ale_linters#go#gometalinter#Handler',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
35
sources_non_forked/ale/ale_linters/markdown/marksman.vim
Normal file
35
sources_non_forked/ale/ale_linters/markdown/marksman.vim
Normal file
@ -0,0 +1,35 @@
|
||||
" Author: Peter Benjamin <petermbenjamin@gmail.com>
|
||||
" Description: Write Markdown with code assist and intelligence in the comfort of your favourite editor.
|
||||
|
||||
call ale#Set('markdown_marksman_executable', 'marksman')
|
||||
|
||||
function! ale_linters#markdown#marksman#GetCommand(buffer) abort
|
||||
return '%e server'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#markdown#marksman#GetProjectRoot(buffer) abort
|
||||
" Find nearest .marksman.toml
|
||||
let l:marksman_toml = ale#path#FindNearestFile(a:buffer, '.marksman.toml')
|
||||
|
||||
if !empty(l:marksman_toml)
|
||||
return fnamemodify(l:marksman_toml, ':h')
|
||||
endif
|
||||
|
||||
" Find nearest .git/ directory
|
||||
let l:project_root = finddir('.git/..', expand('#' . a:buffer . '...').';')
|
||||
|
||||
if !empty(l:project_root)
|
||||
return l:project_root
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'marksman',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#Var(b, 'markdown_marksman_executable')},
|
||||
\ 'command': function('ale_linters#markdown#marksman#GetCommand'),
|
||||
\ 'project_root': function('ale_linters#markdown#marksman#GetProjectRoot'),
|
||||
\ 'initialization_options': {},
|
||||
\})
|
@ -3,50 +3,21 @@
|
||||
" nvim-lspconfig and volar/packages/shared/src/types.ts
|
||||
|
||||
call ale#Set('vue_volar_executable', 'vue-language-server')
|
||||
call ale#Set('vue_volar_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('vue_volar_use_global', 1)
|
||||
call ale#Set('vue_volar_init_options', {
|
||||
\ 'documentFeatures': {
|
||||
\ 'documentColor': v:false,
|
||||
\ 'documentFormatting': {
|
||||
\ 'defaultPrintWidth': 100,
|
||||
\ },
|
||||
\ 'documentSymbol': v:true,
|
||||
\ 'foldingRange': v:true,
|
||||
\ 'linkedEditingRange': v:true,
|
||||
\ 'selectionRange': v:true,
|
||||
\ },
|
||||
\ 'languageFeatures': {
|
||||
\ 'callHierarchy': v:true,
|
||||
\ 'codeAction': v:true,
|
||||
\ 'codeLens': v:true,
|
||||
\ 'completion': {
|
||||
\ 'defaultAttrNameCase': 'kebabCase',
|
||||
\ 'defaultTagNameCase': 'both',
|
||||
\ 'getDocumentNameCaseRequest': v:false,
|
||||
\ 'getDocumentSelectionRequest': v:false,
|
||||
\ },
|
||||
\ 'definition': v:true,
|
||||
\ 'diagnostics': v:true,
|
||||
\ 'documentHighlight': v:true,
|
||||
\ 'documentLink': v:true,
|
||||
\ 'hover': v:true,
|
||||
\ 'references': v:true,
|
||||
\ 'rename': v:true,
|
||||
\ 'renameFileRefactoring': v:true,
|
||||
\ 'schemaRequestService': v:true,
|
||||
\ 'semanticTokens': v:false,
|
||||
\ 'signatureHelp': v:true,
|
||||
\ 'typeDefinition': v:true,
|
||||
\ 'workspaceSymbol': v:false,
|
||||
\ },
|
||||
\ 'typescript': {
|
||||
\ 'serverPath': '',
|
||||
\ 'localizedPath': v:null,
|
||||
\ },
|
||||
\ 'typescript': { 'tsdk': '' },
|
||||
\})
|
||||
|
||||
function! ale_linters#vue#volar#GetProjectRoot(buffer) abort
|
||||
let l:project_roots = ['package.json', 'vite.config.js', '.git', bufname(a:buffer)]
|
||||
let l:project_roots = [
|
||||
\ 'package.json',
|
||||
\ 'vite.config.js',
|
||||
\ 'vite.config.mjs',
|
||||
\ 'vite.config.cjs',
|
||||
\ 'vite.config.ts',
|
||||
\ '.git',
|
||||
\ bufname(a:buffer)
|
||||
\]
|
||||
|
||||
for l:project_root in l:project_roots
|
||||
let l:nearest_filepath = ale#path#FindNearestFile(a:buffer, l:project_root)
|
||||
@ -60,11 +31,19 @@ function! ale_linters#vue#volar#GetProjectRoot(buffer) abort
|
||||
endfunction
|
||||
|
||||
function! ale_linters#vue#volar#GetInitializationOptions(buffer) abort
|
||||
let l:tsserver_path = ale#path#FindNearestExecutable(a:buffer, [
|
||||
\ 'node_modules/typescript/lib/tsserverlibrary.js'
|
||||
\ ])
|
||||
let l:tsserver_path = ale#path#FindNearestDirectory(a:buffer, 'node_modules/typescript/lib')
|
||||
|
||||
if l:tsserver_path is# ''
|
||||
" no-custom-checks
|
||||
echohl WarningMsg
|
||||
" no-custom-checks
|
||||
echom '[volar] Must have typescript installed in project, please install via `npm install -D typescript`.'
|
||||
" no-custom-checks
|
||||
echohl None
|
||||
endif
|
||||
|
||||
let l:init_options = ale#Var(a:buffer, 'vue_volar_init_options')
|
||||
let l:init_options.typescript.serverPath = l:tsserver_path
|
||||
let l:init_options.typescript.tsdk = l:tsserver_path
|
||||
|
||||
return l:init_options
|
||||
endfunction
|
||||
|
Reference in New Issue
Block a user