mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated the plugins
This commit is contained in:
@ -1,18 +0,0 @@
|
||||
" Author: wizzup <wizzup@gmail.com>
|
||||
" Description: ghc-mod for Haskell files
|
||||
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'ghc_mod',
|
||||
\ 'aliases': ['ghc-mod'],
|
||||
\ 'executable': 'ghc-mod',
|
||||
\ 'command': 'ghc-mod --map-file %s=%t check %s',
|
||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||
\})
|
||||
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'stack_ghc_mod',
|
||||
\ 'aliases': ['stack-ghc-mod'],
|
||||
\ 'executable': 'stack',
|
||||
\ 'command': 'stack exec ghc-mod -- --map-file %s=%t check %s',
|
||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||
\})
|
19
sources_non_forked/ale/ale_linters/haskell/ghc_mod.vim
Normal file
19
sources_non_forked/ale/ale_linters/haskell/ghc_mod.vim
Normal file
@ -0,0 +1,19 @@
|
||||
" Author: wizzup <wizzup@gmail.com>
|
||||
" 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',
|
||||
\})
|
@ -5,7 +5,10 @@ call ale#Set('haskell_hdevtools_executable', 'hdevtools')
|
||||
call ale#Set('haskell_hdevtools_options', get(g:, 'hdevtools_options', '-g -Wall'))
|
||||
|
||||
function! ale_linters#haskell#hdevtools#GetCommand(buffer) abort
|
||||
return '%e check' . ale#Pad(ale#Var(a:buffer, 'haskell_hdevtools_options'))
|
||||
let l:executable = ale#Var(a:buffer, 'haskell_hdevtools_executable')
|
||||
|
||||
return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'hdevtools')
|
||||
\ . ' check' . ale#Pad(ale#Var(a:buffer, 'haskell_hdevtools_options'))
|
||||
\ . ' -p %s %t'
|
||||
endfunction
|
||||
|
||||
|
@ -3,10 +3,6 @@
|
||||
|
||||
call ale#Set('haskell_hie_executable', 'hie')
|
||||
|
||||
function! ale_linters#haskell#hie#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'haskell_hie_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#haskell#hie#GetProjectRoot(buffer) abort
|
||||
" Search for the stack file first
|
||||
let l:project_file = ale#path#FindNearestFile(a:buffer, 'stack.yaml')
|
||||
@ -35,10 +31,17 @@ function! ale_linters#haskell#hie#GetProjectRoot(buffer) abort
|
||||
return l:project_file
|
||||
endfunction
|
||||
|
||||
function! ale_linters#haskell#hie#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'haskell_hie_executable')
|
||||
|
||||
return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'hie')
|
||||
\ . ' --lsp'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'hie',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'command': '%e --lsp',
|
||||
\ 'executable_callback': 'ale_linters#haskell#hie#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#haskell#hie#GetCommand',
|
||||
\ 'executable_callback': ale#VarFunc('haskell_hie_executable'),
|
||||
\ 'project_root_callback': 'ale_linters#haskell#hie#GetProjectRoot',
|
||||
\})
|
||||
|
@ -1,6 +1,9 @@
|
||||
" Author: jparoz <jesse.paroz@gmail.com>
|
||||
" 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',
|
||||
\})
|
||||
|
Reference in New Issue
Block a user