mirror of
https://github.com/dense-analysis/ale.git
synced 2026-11-07 20:55:56 +08:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b415dddf9f | ||
|
|
55acb6536e | ||
|
|
34d1fd266b | ||
|
|
84eae97bf2 |
No files matched your search
@@ -1,6 +1,9 @@
|
||||
" Author: Arizard <https://github.com/Arizard>
|
||||
" Description: PHPactor integration for ALE
|
||||
|
||||
call ale#Set('php_phpactor_executable', 'phpactor')
|
||||
call ale#Set('php_phpactor_init_options', {})
|
||||
|
||||
" Copied from langserver.vim
|
||||
function! ale_linters#php#phpactor#GetProjectRoot(buffer) abort
|
||||
let l:composer_path = ale#path#FindNearestFile(a:buffer, 'composer.json')
|
||||
@@ -17,7 +20,8 @@ endfunction
|
||||
call ale#linter#Define('php', {
|
||||
\ 'name': 'phpactor',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': 'phpactor',
|
||||
\ 'executable': {b -> ale#Var(b, 'php_phpactor_executable')},
|
||||
\ 'command': '%e language-server',
|
||||
\ 'initialization_options': {b -> ale#Var(b, 'php_phpactor_init_options')},
|
||||
\ 'project_root': function('ale_linters#php#phpactor#GetProjectRoot'),
|
||||
\})
|
||||
@@ -200,7 +200,7 @@ function! ale#python#PoetryPresent(buffer) abort
|
||||
return findfile('poetry.lock', expand('#' . a:buffer . ':p:h') . ';') isnot# ''
|
||||
endfunction
|
||||
|
||||
" Detects whether a poetry environment is present.
|
||||
" Detects whether a uv environment is present.
|
||||
function! ale#python#UvPresent(buffer) abort
|
||||
return findfile('uv.lock', expand('#' . a:buffer . ':p:h') . ';') isnot# ''
|
||||
endfunction
|
||||
@@ -78,6 +78,36 @@ g:ale_php_phan_use_client
|
||||
instead of the phan standalone.
|
||||
|
||||
|
||||
===============================================================================
|
||||
phpactor *ale-php-phpactor*
|
||||
|
||||
*ale-options.php_phpactor_executable*
|
||||
*g:ale_php_phpactor_executable*
|
||||
*b:ale_php_phpactor_executable*
|
||||
php_phpactor_executable
|
||||
g:ale_php_phpactor_executable
|
||||
Type: |String|
|
||||
Default: `'phpactor'`
|
||||
|
||||
This variable sets executable used for phpactor.
|
||||
|
||||
php_phpactor_init_options
|
||||
g:ale_php_phpactor_init_options
|
||||
Type: |Dictionary|
|
||||
Default: `'{}'`
|
||||
|
||||
This variable can be changed to customize the LSP initialization_options.
|
||||
For example: >
|
||||
|
||||
let g:ale_php_phpactor_init_options = {
|
||||
\ 'language_server_phpstan.enabled': v:false,
|
||||
\ 'language_server_psalm.enabled': v:false,
|
||||
\ 'worse_reflection.stub_dir': '%application_root%/.php-stubs'
|
||||
\}
|
||||
<
|
||||
For all available options and explanations, visit
|
||||
https://phpactor.readthedocs.io/en/master/reference/configuration.html
|
||||
|
||||
===============================================================================
|
||||
phpcbf *ale-php-phpcbf*
|
||||
|
||||
|
||||
+1
-1
@@ -1465,7 +1465,7 @@ g:ale_python_pylsp_executable
|
||||
See |ale-integrations-local-executables|
|
||||
|
||||
Set this to `'pipenv'` to invoke `'pipenv` `run` `pylsp'`.
|
||||
Set this to `'poetry'` to invoke `'poetry` `run` `pyls'`.
|
||||
Set this to `'poetry'` to invoke `'poetry` `run` `pylsp'`.
|
||||
|
||||
*ale-options.python_pylsp_use_global*
|
||||
*g:ale_python_pylsp_use_global*
|
||||
|
||||
@@ -3760,6 +3760,7 @@ documented in additional help files.
|
||||
cspell................................|ale-php-cspell|
|
||||
langserver............................|ale-php-langserver|
|
||||
phan..................................|ale-php-phan|
|
||||
phpactor..............................|ale-php-phpactor|
|
||||
phpcbf................................|ale-php-phpcbf|
|
||||
phpcs.................................|ale-php-phpcs|
|
||||
phpmd.................................|ale-php-phpmd|
|
||||
|
||||
+2
-2
@@ -243,8 +243,8 @@ formatting.
|
||||
* [golangci-lint](https://github.com/golangci/golangci-lint) :warning: :floppy_disk:
|
||||
* [golangserver](https://github.com/sourcegraph/go-langserver) :warning:
|
||||
* [golines](https://github.com/segmentio/golines)
|
||||
* [gopls](https://github.com/golang/go/wiki/gopls) :speech_balloon:
|
||||
* [gosimple](https://github.com/dominikh/go-tools/tree/master/cmd/gosimple) :warning: :floppy_disk: :speech_balloon:
|
||||
* [gopls](https://github.com/golang/tools/blob/master/gopls/README.md) :speech_balloon:
|
||||
* [gosimple](https://staticcheck.io/changes/2019.2/#deprecated) :warning: :floppy_disk: :speech_balloon:
|
||||
* [gotype](https://godoc.org/golang.org/x/tools/cmd/gotype) :warning: :floppy_disk: :speech_balloon:
|
||||
* [revive](https://github.com/mgechev/revive) :warning: :floppy_disk:
|
||||
* [staticcheck](https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck) :warning: :floppy_disk: :speech_balloon:
|
||||
|
||||
Whitespace-only changes.
@@ -8,6 +8,12 @@ Execute(The default executable path should be correct):
|
||||
AssertLinter 'phpactor',
|
||||
\ ale#Escape('phpactor') . ' language-server'
|
||||
|
||||
Execute(Overriding the executable should work):
|
||||
let b:ale_php_phpactor_executable = 'my_phpactor'
|
||||
|
||||
AssertLinter 'my_phpactor', ale#Escape('my_phpactor') . ' language-server'
|
||||
unlet b:ale_php_phpactor_executable
|
||||
|
||||
Execute(The project path should be correct for .git directories):
|
||||
call ale#test#SetFilename('../test-files/php/with-git/test.php')
|
||||
silent! call mkdir('../test-files/php/with-git/.git')
|
||||
@@ -18,3 +24,20 @@ Execute(The project path should be correct for composer.json file):
|
||||
call ale#test#SetFilename('../test-files/php/with-composer/test.php')
|
||||
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/php/with-composer')
|
||||
|
||||
Execute(The LSP values should be set correctly):
|
||||
|
||||
AssertLSPLanguage 'php'
|
||||
|
||||
AssertLSPOptions {}
|
||||
|
||||
AssertLSPConfig {}
|
||||
|
||||
Execute(Should accept initialization options):
|
||||
let b:ale_php_phpactor_init_options = {
|
||||
\ 'language_server_phpstan.enabled': v:false,
|
||||
\ }
|
||||
|
||||
AssertLSPOptions {
|
||||
\ 'language_server_phpstan.enabled': v:false,
|
||||
\ }
|
||||
Whitespace-only changes.
Whitespace-only changes.
Reference in new issue
Block a user