forked from amix/vimrc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
492 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
" Author: Ye Jingchen <[email protected]>, Ben Falconer <[email protected]>, jtalowell <[email protected]> | ||
" Description: A language server for C | ||
|
||
call ale#Set('c_ccls_executable', 'ccls') | ||
call ale#Set('c_ccls_init_options', {}) | ||
|
||
call ale#linter#Define('c', { | ||
\ 'name': 'ccls', | ||
\ 'lsp': 'stdio', | ||
\ 'executable_callback': ale#VarFunc('c_ccls_executable'), | ||
\ 'command': '%e', | ||
\ 'project_root_callback': 'ale#handlers#ccls#GetProjectRoot', | ||
\ 'initialization_options_callback':ale#VarFunc('c_ccls_init_options'), | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
" Author: Ye Jingchen <[email protected]>, Ben Falconer <[email protected]>, jtalowell <[email protected]> | ||
" Description: A language server for C++ | ||
|
||
call ale#Set('cpp_ccls_executable', 'ccls') | ||
call ale#Set('cpp_ccls_init_options', {}) | ||
|
||
call ale#linter#Define('cpp', { | ||
\ 'name': 'ccls', | ||
\ 'lsp': 'stdio', | ||
\ 'executable_callback': ale#VarFunc('cpp_ccls_executable'), | ||
\ 'command': '%e', | ||
\ 'project_root_callback': 'ale#handlers#ccls#GetProjectRoot', | ||
\ 'initialization_options_callback': ale#VarFunc('cpp_ccls_init_options'), | ||
\}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
" Author: wizzup <[email protected]> | ||
" Description: ghc-mod for Haskell files | ||
|
||
call ale#Set('haskell_ghc_mod_executable', 'ghc-mod') | ||
|
||
function! ale_linters#haskell#ghc_mod#GetCommand (buffer) abort | ||
let l:executable = ale#Var(a:buffer, 'haskell_ghc_mod_executable') | ||
|
||
return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'ghc-mod') | ||
\ . ' --map-file %s=%t check %s' | ||
endfunction | ||
|
||
call ale#linter#Define('haskell', { | ||
\ 'name': 'ghc_mod', | ||
\ 'aliases': ['ghc-mod'], | ||
\ 'executable_callback': ale#VarFunc('haskell_ghc_mod_executable'), | ||
\ 'command_callback': 'ale_linters#haskell#ghc_mod#GetCommand', | ||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat', | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
" Author: jparoz <[email protected]> | ||
" Description: hlint for Haskell files | ||
|
||
call ale#Set('haskell_hlint_executable', 'hlint') | ||
call ale#Set('haskell_hlint_options', get(g:, 'hlint_options', '')) | ||
|
||
function! ale_linters#haskell#hlint#Handle(buffer, lines) abort | ||
let l:output = [] | ||
|
||
|
@@ -26,9 +29,18 @@ function! ale_linters#haskell#hlint#Handle(buffer, lines) abort | |
return l:output | ||
endfunction | ||
|
||
function! ale_linters#haskell#hlint#GetCommand(buffer) abort | ||
let l:hlintopts = '--color=never --json' | ||
|
||
return ale#handlers#hlint#GetExecutable(a:buffer) | ||
\ . ' ' . ale#Var(a:buffer, 'haskell_hlint_options') | ||
\ . ' ' . l:hlintopts | ||
\ . ' -' | ||
endfunction | ||
|
||
call ale#linter#Define('haskell', { | ||
\ 'name': 'hlint', | ||
\ 'executable': 'hlint', | ||
\ 'command': 'hlint --color=never --json -', | ||
\ 'executable_callback': ale#VarFunc('haskell_hlint_executable'), | ||
\ 'command_callback': 'ale_linters#haskell#hlint#GetCommand' , | ||
\ 'callback': 'ale_linters#haskell#hlint#Handle', | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
" Author: Ye Jingchen <[email protected]>, Ben Falconer <[email protected]>, jtalowell <[email protected]> | ||
" Description: A language server for Objective-C | ||
|
||
call ale#Set('objc_ccls_executable', 'ccls') | ||
call ale#Set('objc_ccls_init_options', {}) | ||
|
||
call ale#linter#Define('objc', { | ||
\ 'name': 'ccls', | ||
\ 'lsp': 'stdio', | ||
\ 'executable_callback': ale#VarFunc('objc_ccls_executable'), | ||
\ 'command': '%e', | ||
\ 'project_root_callback': 'ale#handlers#ccls#GetProjectRoot', | ||
\ 'initialization_options_callback': ale#VarFunc('objc_ccls_init_options'), | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
" Author: richard marmorstein <https://github.com/twitchard> | ||
" Description: plugin for Psalm, static analyzer for PHP | ||
|
||
call ale#Set('php_psalm_executable', 'psalm') | ||
|
||
function! ale_linters#php#psalm#Handle(buffer, lines) abort | ||
" Matches patterns like the following: | ||
let l:pattern = '^.*:\(\d\+\):\(\d\+\):\(\w\+\) - \(.*\)$' | ||
let l:output = [] | ||
|
||
for l:match in ale#util#GetMatches(a:lines, l:pattern) | ||
call add(l:output, { | ||
\ 'lnum': l:match[1] + 0, | ||
\ 'text': l:match[4], | ||
\ 'type': l:match[3][:0] is# 'e' ? 'E' : 'W', | ||
\}) | ||
endfor | ||
|
||
return l:output | ||
endfunction | ||
|
||
call ale#linter#Define('php', { | ||
\ 'name': 'psalm', | ||
\ 'command': '%e --diff --output-format=emacs %s', | ||
\ 'executable_callback': ale#VarFunc('php_psalm_executable'), | ||
\ 'callback': 'ale_linters#php#psalm#Handle', | ||
\ 'lint_file': 1, | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
" Author: diartyz <[email protected]> | ||
|
||
call ale#Set('scss_stylelint_executable', 'stylelint') | ||
call ale#Set('scss_stylelint_options', '') | ||
call ale#Set('scss_stylelint_use_global', get(g:, 'ale_use_global_executables', 0)) | ||
|
||
function! ale_linters#scss#stylelint#GetCommand(buffer) abort | ||
return '%e ' . ale#Pad(ale#Var(a:buffer, 'scss_stylelint_options')) | ||
\ . ' --stdin-filename %s' | ||
endfunction | ||
|
||
call ale#linter#Define('scss', { | ||
\ 'name': 'stylelint', | ||
\ 'executable_callback': ale#node#FindExecutableFunc('scss_stylelint', [ | ||
\ 'node_modules/.bin/stylelint', | ||
\ ]), | ||
\ 'command': '%e --stdin-filename %s', | ||
\ 'command_callback': 'ale_linters#scss#stylelint#GetCommand', | ||
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat', | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
" Author: eborden <[email protected]> | ||
" Description: Integration of hlint refactor with ALE. | ||
" | ||
call ale#Set('haskell_hlint_executable', 'hlint') | ||
|
||
function! ale#fixers#hlint#Fix(buffer) abort | ||
let l:executable = ale#Var(a:buffer, 'haskell_hlint_executable') | ||
|
||
return { | ||
\ 'command': ale#Escape(l:executable) | ||
\ 'command': ale#handlers#hlint#GetExecutable(a:buffer) | ||
\ . ' --refactor' | ||
\ . ' --refactor-options="--inplace"' | ||
\ . ' %t', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
scriptencoding utf-8 | ||
" Author: Ye Jingchen <[email protected]> | ||
" Description: Utilities for ccls | ||
|
||
function! ale#handlers#ccls#GetProjectRoot(buffer) abort | ||
let l:project_root = ale#path#FindNearestFile(a:buffer, '.ccls-root') | ||
|
||
if empty(l:project_root) | ||
let l:project_root = ale#path#FindNearestFile(a:buffer, 'compile_commands.json') | ||
endif | ||
|
||
if empty(l:project_root) | ||
let l:project_root = ale#path#FindNearestFile(a:buffer, '.ccls') | ||
endif | ||
|
||
return !empty(l:project_root) ? fnamemodify(l:project_root, ':h') : '' | ||
endfunction |
7 changes: 7 additions & 0 deletions
7
sources_non_forked/ale/autoload/ale/handlers/haskell_stack.vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function! ale#handlers#haskell_stack#EscapeExecutable(executable, stack_exec) abort | ||
let l:exec_args = a:executable =~? 'stack$' | ||
\ ? ' exec ' . ale#Escape(a:stack_exec) . ' --' | ||
\ : '' | ||
|
||
return ale#Escape(a:executable) . l:exec_args | ||
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
call ale#Set('haskell_hlint_executable', 'hlint') | ||
call ale#Set('haskell_hlint_options', get(g:, 'hlint_options', '')) | ||
|
||
function! ale#handlers#hlint#GetExecutable(buffer) abort | ||
let l:executable = ale#Var(a:buffer, 'haskell_hlint_executable') | ||
|
||
return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'hlint') | ||
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.