mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-08 05:24:46 +08:00
Allow to configure haskell-language-server LSP config (#4038)
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
" <devildead13@gmail.com>). It search more project root files.
|
" <devildead13@gmail.com>). It search more project root files.
|
||||||
"
|
"
|
||||||
call ale#Set('haskell_hls_executable', 'haskell-language-server-wrapper')
|
call ale#Set('haskell_hls_executable', 'haskell-language-server-wrapper')
|
||||||
|
call ale#Set('haskell_hls_config', {})
|
||||||
|
|
||||||
function! ale_linters#haskell#hls#FindRootFile(buffer) abort
|
function! ale_linters#haskell#hls#FindRootFile(buffer) abort
|
||||||
let l:serach_root_files = [
|
let l:serach_root_files = [
|
||||||
@@ -60,4 +61,5 @@ call ale#linter#Define('haskell', {
|
|||||||
\ 'command': function('ale_linters#haskell#hls#GetCommand'),
|
\ 'command': function('ale_linters#haskell#hls#GetCommand'),
|
||||||
\ 'executable': {b -> ale#Var(b, 'haskell_hls_executable')},
|
\ 'executable': {b -> ale#Var(b, 'haskell_hls_executable')},
|
||||||
\ 'project_root': function('ale_linters#haskell#hls#GetProjectRoot'),
|
\ 'project_root': function('ale_linters#haskell#hls#GetProjectRoot'),
|
||||||
|
\ 'lsp_config': {b -> ale#Var(b, 'haskell_hls_config')},
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -142,6 +142,20 @@ g:ale_haskell_hls_executable *g:ale_haskell_hls_executable*
|
|||||||
language server.
|
language server.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_haskell_hls_config *g:ale_haskell_hls_config*
|
||||||
|
*b:ale_haskell_hls_config*
|
||||||
|
Type: |Dictionary|
|
||||||
|
Default: `{}`
|
||||||
|
|
||||||
|
Dictionary with configuration settings for HLS. For example, to see more
|
||||||
|
completions:
|
||||||
|
>
|
||||||
|
let g:ale_haskell_hls_config = {'haskell': {'maxCompletions': 250}}
|
||||||
|
<
|
||||||
|
Refer to HLS documentation for possible settings:
|
||||||
|
https://haskell-language-server.readthedocs.io/en/latest/configuration.html#language-specific-server-options
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
stack-build *ale-haskell-stack-build*
|
stack-build *ale-haskell-stack-build*
|
||||||
|
|
||||||
|
|||||||
@@ -25,3 +25,8 @@ Execute(The executable should be configurable):
|
|||||||
let g:ale_haskell_hls_executable = 'foobar'
|
let g:ale_haskell_hls_executable = 'foobar'
|
||||||
|
|
||||||
AssertLinter 'foobar', ale#Escape('foobar') . ' --lsp'
|
AssertLinter 'foobar', ale#Escape('foobar') . ' --lsp'
|
||||||
|
|
||||||
|
Execute(Should accept configuration settings):
|
||||||
|
AssertLSPConfig {}
|
||||||
|
let b:ale_haskell_hls_config = {'haskell': {'maxCompletions': 250}}
|
||||||
|
AssertLSPConfig {'haskell': {'maxCompletions': 250}}
|
||||||
|
|||||||
Reference in New Issue
Block a user