mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 05:04:28 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c17ba2a0f | ||
|
|
2dbfbe7b02 | ||
|
|
ceb2e8d350 | ||
|
|
96d84aec8f |
16
.github/ISSUE_TEMPLATE/report-a-bug.md
vendored
16
.github/ISSUE_TEMPLATE/report-a-bug.md
vendored
@@ -23,12 +23,14 @@ about: Report a bug with ALE.
|
||||
|
||||
Operating System: <!-- Describe your operating system version. -->
|
||||
|
||||
### :ALEInfo
|
||||
|
||||
<!-- Paste the output of :ALEInfo here. Try :ALEInfoToClipboard -->
|
||||
<!-- Make sure to run :ALEInfo from the buffer where the bug occurred. -->
|
||||
|
||||
## What went wrong
|
||||
|
||||
<!-- Describe what went wrong here. Be specific. -->
|
||||
|
||||
Something went wrong in specifically this place, and I also searched through
|
||||
both open and closed issues for the same problem before reporting a bug here.
|
||||
<!-- Describe what went wrong here. -->
|
||||
|
||||
## Reproducing the bug
|
||||
|
||||
@@ -36,9 +38,3 @@ both open and closed issues for the same problem before reporting a bug here.
|
||||
|
||||
1. I did this.
|
||||
2. Then this happened.
|
||||
|
||||
### :ALEInfo
|
||||
|
||||
<!-- Paste the output of :ALEInfo here. Try :ALEInfoToClipboard -->
|
||||
<!-- Make sure to run :ALEInfo from the buffer where the bug occurred. -->
|
||||
<!-- Read the output. You might figure out what went wrong yourself. -->
|
||||
|
||||
5
.github/PULL_REQUEST_TEMPLATE.md
vendored
5
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -6,8 +6,3 @@ Before creating a pull request, do the following.
|
||||
|
||||
Have fun!
|
||||
-->
|
||||
|
||||
Where are the tests? Have you added tests? Have you updated the tests? Read the
|
||||
comment above and the documentation referenced in it first. Write tests!
|
||||
|
||||
Seriously, read `:help ale-development` and write tests.
|
||||
|
||||
123
README.md
123
README.md
@@ -26,18 +26,14 @@ features, including:
|
||||
|
||||
* Diagnostics (via Language Server Protocol linters)
|
||||
* Go To Definition (`:ALEGoToDefinition`)
|
||||
* Completion (`let g:ale_completion_enabled = 1` before ALE is loaded)
|
||||
* Completion (`let g:ale_completion_enabled = 1`)
|
||||
* Finding references (`:ALEFindReferences`)
|
||||
* Hover information (`:ALEHover`)
|
||||
* Symbol search (`:ALESymbolSearch`)
|
||||
|
||||
If you don't care about Language Server Protocol, ALE won't load any of the code
|
||||
for working with it unless needed. One of ALE's general missions is that you
|
||||
won't pay for the features that you don't use.
|
||||
|
||||
If you enjoy this plugin, feel free to contribute or check out the author's
|
||||
other content at [w0rp.com](https://w0rp.com).
|
||||
|
||||
## Table of Contents
|
||||
|
||||
1. [Supported Languages and Tools](#supported-languages)
|
||||
@@ -48,12 +44,10 @@ other content at [w0rp.com](https://w0rp.com).
|
||||
4. [Go To Definition](#usage-go-to-definition)
|
||||
5. [Find References](#usage-find-references)
|
||||
6. [Hovering](#usage-hover)
|
||||
7. [Symbol Search](#usage-symbol-search)
|
||||
3. [Installation](#installation)
|
||||
1. [Installation with Vim package management](#standard-installation)
|
||||
2. [Installation with Pathogen](#installation-with-pathogen)
|
||||
3. [Installation with Vundle](#installation-with-vundle)
|
||||
4. [Installation with Vim-Plug](#installation-with-vim-plug)
|
||||
4. [Contributing](#contributing)
|
||||
5. [FAQ](#faq)
|
||||
1. [How do I disable particular linters?](#faq-disable-linters)
|
||||
@@ -68,11 +62,10 @@ other content at [w0rp.com](https://w0rp.com).
|
||||
10. [How can I run linters only when I save files?](#faq-lint-on-save)
|
||||
11. [How can I use the quickfix list instead of the loclist?](#faq-quickfix)
|
||||
12. [How can I check JSX files with both stylelint and eslint?](#faq-jsx-stylelint-eslint)
|
||||
13. [How can I check Vue files with ESLint?](#faq-vue-eslint)
|
||||
14. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
|
||||
15. [How can I configure my C or C++ project?](#faq-c-configuration)
|
||||
16. [How can I configure ALE differently for different buffers?](#faq-buffer-configuration)
|
||||
17. [How can I configure the height of the list in which ALE displays errors?](#faq-list-window-height)
|
||||
13. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
|
||||
14. [How can I configure my C or C++ project?](#faq-c-configuration)
|
||||
15. [How can I configure ALE differently for different buffers?](#faq-buffer-configuration)
|
||||
16. [How can I configure the height of the list in which ALE displays errors?](#faq-list-window-height)
|
||||
|
||||
<a name="supported-languages"></a>
|
||||
|
||||
@@ -97,16 +90,15 @@ formatting.
|
||||
|
||||
| Language | Tools |
|
||||
| -------- | ----- |
|
||||
| Ada | [gcc](https://gcc.gnu.org) |
|
||||
| ASM | [gcc](https://gcc.gnu.org) |
|
||||
| Ansible | [ansible-lint](https://github.com/willthames/ansible-lint) |
|
||||
| API Blueprint | [drafter](https://github.com/apiaryio/drafter) |
|
||||
| AsciiDoc | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [write-good](https://github.com/btford/write-good), [vale](https://github.com/ValeLint/vale) |
|
||||
| AsciiDoc | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [write-good](https://github.com/btford/write-good) |
|
||||
| Awk | [gawk](https://www.gnu.org/software/gawk/)|
|
||||
| Bash | [language-server](https://github.com/mads-hartmann/bash-language-server), shell [-n flag](https://www.gnu.org/software/bash/manual/bash.html#index-set), [shellcheck](https://www.shellcheck.net/), [shfmt](https://github.com/mvdan/sh) |
|
||||
| Bourne Shell | shell [-n flag](http://linux.die.net/man/1/sh), [shellcheck](https://www.shellcheck.net/), [shfmt](https://github.com/mvdan/sh) |
|
||||
| C | [cppcheck](http://cppcheck.sourceforge.net), [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint), [clang](http://clang.llvm.org/), [clangd](https://clang.llvm.org/extra/clangd.html), [clangtidy](http://clang.llvm.org/extra/clang-tidy/) !!, [clang-format](https://clang.llvm.org/docs/ClangFormat.html), [cquery](https://github.com/cquery-project/cquery), [flawfinder](https://www.dwheeler.com/flawfinder/), [gcc](https://gcc.gnu.org/), [uncrustify](https://github.com/uncrustify/uncrustify), [ccls](https://github.com/MaskRay/ccls) |
|
||||
| C++ (filetype cpp) | [clang](http://clang.llvm.org/), [clangd](https://clang.llvm.org/extra/clangd.html), [clangcheck](http://clang.llvm.org/docs/ClangCheck.html) !!, [clangtidy](http://clang.llvm.org/extra/clang-tidy/) !!, [clang-format](https://clang.llvm.org/docs/ClangFormat.html), [clazy](https://github.com/KDE/clazy) !!, [cppcheck](http://cppcheck.sourceforge.net), [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint) !!, [cquery](https://github.com/cquery-project/cquery), [flawfinder](https://www.dwheeler.com/flawfinder/), [gcc](https://gcc.gnu.org/), [uncrustify](https://github.com/uncrustify/uncrustify), [ccls](https://github.com/MaskRay/ccls) |
|
||||
| C | [cppcheck](http://cppcheck.sourceforge.net), [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint), [clang](http://clang.llvm.org/), [clangd](https://clang.llvm.org/extra/clangd.html), [clangtidy](http://clang.llvm.org/extra/clang-tidy/) !!, [clang-format](https://clang.llvm.org/docs/ClangFormat.html), [cquery](https://github.com/cquery-project/cquery), [flawfinder](https://www.dwheeler.com/flawfinder/), [gcc](https://gcc.gnu.org/), [uncrustify](https://github.com/uncrustify/uncrustify) |
|
||||
| C++ (filetype cpp) | [clang](http://clang.llvm.org/), [clangd](https://clang.llvm.org/extra/clangd.html), [clangcheck](http://clang.llvm.org/docs/ClangCheck.html) !!, [clangtidy](http://clang.llvm.org/extra/clang-tidy/) !!, [clang-format](https://clang.llvm.org/docs/ClangFormat.html), [clazy](https://github.com/KDE/clazy) !!, [cppcheck](http://cppcheck.sourceforge.net), [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint) !!, [cquery](https://github.com/cquery-project/cquery), [flawfinder](https://www.dwheeler.com/flawfinder/), [gcc](https://gcc.gnu.org/), [uncrustify](https://github.com/uncrustify/uncrustify) |
|
||||
| CUDA | [nvcc](http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html) |
|
||||
| C# | [mcs](http://www.mono-project.com/docs/about-mono/languages/csharp/) see:`help ale-cs-mcs` for details, [mcsc](http://www.mono-project.com/docs/about-mono/languages/csharp/) !! see:`help ale-cs-mcsc` for details and configuration, [uncrustify](https://github.com/uncrustify/uncrustify) |
|
||||
| Chef | [foodcritic](http://www.foodcritic.io/) |
|
||||
@@ -118,13 +110,13 @@ formatting.
|
||||
| CSS | [csslint](http://csslint.net/), [prettier](https://github.com/prettier/prettier), [stylelint](https://github.com/stylelint/stylelint) |
|
||||
| Cucumber | [cucumber](https://cucumber.io/) |
|
||||
| Cython (pyrex filetype) | [cython](http://cython.org/) |
|
||||
| D | [dls](https://github.com/d-language-server/dls), [dmd](https://dlang.org/dmd-linux.html), [uncrustify](https://github.com/uncrustify/uncrustify) |
|
||||
| D | [dmd](https://dlang.org/dmd-linux.html), [uncrustify](https://github.com/uncrustify/uncrustify) |
|
||||
| Dafny | [dafny](https://rise4fun.com/Dafny) !! |
|
||||
| Dart | [dartanalyzer](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) !!, [language_server](https://github.com/natebosch/dart_language_server), [dartfmt](https://github.com/dart-lang/sdk/tree/master/utils/dartfmt) |
|
||||
| Dockerfile | [dockerfile_lint](https://github.com/projectatomic/dockerfile_lint), [hadolint](https://github.com/hadolint/hadolint) |
|
||||
| Elixir | [credo](https://github.com/rrrene/credo), [dialyxir](https://github.com/jeremyjh/dialyxir), [dogma](https://github.com/lpil/dogma), [mix](https://hexdocs.pm/mix/Mix.html) !!, [elixir-ls](https://github.com/JakeBecker/elixir-ls) |
|
||||
| Dockerfile | [hadolint](https://github.com/hadolint/hadolint) |
|
||||
| Elixir | [credo](https://github.com/rrrene/credo), [dialyxir](https://github.com/jeremyjh/dialyxir), [dogma](https://github.com/lpil/dogma), [mix](https://hexdocs.pm/mix/Mix.html) !!|
|
||||
| Elm | [elm-format](https://github.com/avh4/elm-format), [elm-make](https://github.com/elm-lang/elm-make) |
|
||||
| Erb | [erb](https://apidock.com/ruby/ERB), [erubi](https://github.com/jeremyevans/erubi), [erubis](https://github.com/kwatch/erubis), [ruumba](https://github.com/ericqweinstein/ruumba) |
|
||||
| Erb | [erb](https://apidock.com/ruby/ERB), [erubi](https://github.com/jeremyevans/erubi), [erubis](https://github.com/kwatch/erubis) |
|
||||
| Erlang | [erlc](http://erlang.org/doc/man/erlc.html), [SyntaxErl](https://github.com/ten0s/syntaxerl) |
|
||||
| Fish | fish [-n flag](https://linux.die.net/man/1/fish)
|
||||
| Fortran | [gcc](https://gcc.gnu.org/), [language_server](https://github.com/hansec/fortran-language-server) |
|
||||
@@ -137,11 +129,9 @@ formatting.
|
||||
| Hack | [hack](http://hacklang.org/), [hackfmt](https://github.com/facebook/hhvm/tree/master/hphp/hack/hackfmt), [hhast](https://github.com/hhvm/hhast) (disabled by default; see `:help ale-integration-hack`) |
|
||||
| Haml | [haml-lint](https://github.com/brigade/haml-lint) |
|
||||
| Handlebars | [ember-template-lint](https://github.com/rwjblue/ember-template-lint) |
|
||||
| Haskell | [brittany](https://github.com/lspitzner/brittany), [ghc](https://www.haskell.org/ghc/), [cabal-ghc](https://www.haskell.org/cabal/), [stylish-haskell](https://github.com/jaspervdj/stylish-haskell), [stack-ghc](https://haskellstack.org/), [stack-build](https://haskellstack.org/) !!, [ghc-mod](https://github.com/DanielG/ghc-mod), [hlint](https://hackage.haskell.org/package/hlint), [hdevtools](https://hackage.haskell.org/package/hdevtools), [hfmt](https://github.com/danstiner/hfmt), [hie](https://github.com/haskell/haskell-ide-engine) |
|
||||
| HCL | [terraform-fmt](https://github.com/hashicorp/terraform) |
|
||||
| HTML | [alex](https://github.com/wooorm/alex) !!, [HTMLHint](http://htmlhint.com/), [proselint](http://proselint.com/), [tidy](http://www.html-tidy.org/), [prettier](https://github.com/prettier/prettier), [write-good](https://github.com/btford/write-good) |
|
||||
| Haskell | [brittany](https://github.com/lspitzner/brittany), [ghc](https://www.haskell.org/ghc/), [cabal-ghc](https://www.haskell.org/cabal/), [stylish-haskell](https://github.com/jaspervdj/stylish-haskell), [stack-ghc](https://haskellstack.org/), [stack-build](https://haskellstack.org/) !!, [ghc-mod](https://github.com/DanielG/ghc-mod), [stack-ghc-mod](https://github.com/DanielG/ghc-mod), [hlint](https://hackage.haskell.org/package/hlint), [hdevtools](https://hackage.haskell.org/package/hdevtools), [hfmt](https://github.com/danstiner/hfmt), [hie](https://github.com/haskell/haskell-ide-engine) |
|
||||
| HTML | [alex](https://github.com/wooorm/alex) !!, [HTMLHint](http://htmlhint.com/), [proselint](http://proselint.com/), [tidy](http://www.html-tidy.org/), [write-good](https://github.com/btford/write-good) |
|
||||
| Idris | [idris](http://www.idris-lang.org/) |
|
||||
| ISPC | [ispc](https://ispc.github.io/) !! |
|
||||
| Java | [checkstyle](http://checkstyle.sourceforge.net), [javac](http://www.oracle.com/technetwork/java/javase/downloads/index.html), [google-java-format](https://github.com/google/google-java-format), [PMD](https://pmd.github.io/), [javalsp](https://github.com/georgewfraser/vscode-javac), [uncrustify](https://github.com/uncrustify/uncrustify) |
|
||||
| JavaScript | [eslint](http://eslint.org/), [flow](https://flowtype.org/), [jscs](http://jscs.info/), [jshint](http://jshint.com/), [prettier](https://github.com/prettier/prettier), [prettier-eslint](https://github.com/prettier/prettier-eslint-cli), [prettier-standard](https://github.com/sheerun/prettier-standard), [standard](http://standardjs.com/), [xo](https://github.com/sindresorhus/xo)
|
||||
| JSON | [fixjson](https://github.com/rhysd/fixjson), [jsonlint](http://zaa.ch/jsonlint/), [jq](https://stedolan.github.io/jq/), [prettier](https://github.com/prettier/prettier) |
|
||||
@@ -160,17 +150,15 @@ formatting.
|
||||
| Nim | [nim check](https://nim-lang.org/docs/nimc.html) !! |
|
||||
| nix | [nix-instantiate](http://nixos.org/nix/manual/#sec-nix-instantiate) |
|
||||
| nroff | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good)|
|
||||
| Objective-C | [clang](http://clang.llvm.org/), [clangd](https://clang.llvm.org/extra/clangd.html), [uncrustify](https://github.com/uncrustify/uncrustify), [ccls](https://github.com/MaskRay/ccls) |
|
||||
| Objective-C | [clang](http://clang.llvm.org/), [clangd](https://clang.llvm.org/extra/clangd.html), [uncrustify](https://github.com/uncrustify/uncrustify) |
|
||||
| Objective-C++ | [clang](http://clang.llvm.org/), [clangd](https://clang.llvm.org/extra/clangd.html), [uncrustify](https://github.com/uncrustify/uncrustify) |
|
||||
| OCaml | [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-ocaml-merlin` for configuration instructions, [ols](https://github.com/freebroccolo/ocaml-language-server), [ocamlformat](https://github.com/ocaml-ppx/ocamlformat) |
|
||||
| Pawn | [uncrustify](https://github.com/uncrustify/uncrustify) |
|
||||
| Perl | [perl -c](https://perl.org/), [perl-critic](https://metacpan.org/pod/Perl::Critic), [perltidy](https://metacpan.org/pod/distribution/Perl-Tidy/bin/perltidy) |
|
||||
| Perl6 | [perl6 -c](https://perl6.org) |
|
||||
| PHP | [langserver](https://github.com/felixfbecker/php-language-server), [phan](https://github.com/phan/phan) see `:help ale-php-phan` to instructions, [php -l](https://secure.php.net/), [phpcs](https://github.com/squizlabs/PHP_CodeSniffer), [phpmd](https://phpmd.org), [phpstan](https://github.com/phpstan/phpstan), [phpcbf](https://github.com/squizlabs/PHP_CodeSniffer), [php-cs-fixer](http://cs.sensiolabs.org/), [psalm](https://getpsalm.org) !! |
|
||||
| PHP | [langserver](https://github.com/felixfbecker/php-language-server), [phan](https://github.com/phan/phan) see `:help ale-php-phan` to instructions, [php -l](https://secure.php.net/), [phpcs](https://github.com/squizlabs/PHP_CodeSniffer), [phpmd](https://phpmd.org), [phpstan](https://github.com/phpstan/phpstan), [phpcbf](https://github.com/squizlabs/PHP_CodeSniffer), [php-cs-fixer](http://cs.sensiolabs.org/) |
|
||||
| PO | [alex](https://github.com/wooorm/alex) !!, [msgfmt](https://www.gnu.org/software/gettext/manual/html_node/msgfmt-Invocation.html), [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good) |
|
||||
| Pod | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good) |
|
||||
| Pony | [ponyc](https://github.com/ponylang/ponyc) |
|
||||
| Prolog | [swipl](https://github.com/SWI-Prolog/swipl-devel) |
|
||||
| proto | [protoc-gen-lint](https://github.com/ckaznocha/protoc-gen-lint) |
|
||||
| Pug | [pug-lint](https://github.com/pugjs/pug-lint) |
|
||||
| Puppet | [languageserver](https://github.com/lingua-pupuli/puppet-editor-services), [puppet](https://puppet.com), [puppet-lint](https://puppet-lint.com) |
|
||||
@@ -182,7 +170,7 @@ formatting.
|
||||
| Re:VIEW | [redpen](http://redpen.cc/) |
|
||||
| RPM spec | [rpmlint](https://github.com/rpm-software-management/rpmlint) (disabled by default; see `:help ale-integration-spec`) |
|
||||
| Ruby | [brakeman](http://brakemanscanner.org/) !!, [rails_best_practices](https://github.com/flyerhzm/rails_best_practices) !!, [reek](https://github.com/troessner/reek), [rubocop](https://github.com/bbatsov/rubocop), [ruby](https://www.ruby-lang.org), [rufo](https://github.com/ruby-formatter/rufo), [solargraph](https://solargraph.org) |
|
||||
| Rust | [cargo](https://github.com/rust-lang/cargo) !! (see `:help ale-integration-rust` for configuration instructions), [rls](https://github.com/rust-lang-nursery/rls), [rustc](https://www.rust-lang.org/), [rustfmt](https://github.com/rust-lang-nursery/rustfmt) |
|
||||
| Rust | cargo !! (see `:help ale-integration-rust` for configuration instructions), [rls](https://github.com/rust-lang-nursery/rls), [rustc](https://www.rust-lang.org/), [rustfmt](https://github.com/rust-lang-nursery/rustfmt) |
|
||||
| SASS | [sass-lint](https://www.npmjs.com/package/sass-lint), [stylelint](https://github.com/stylelint/stylelint) |
|
||||
| SCSS | [prettier](https://github.com/prettier/prettier), [sass-lint](https://www.npmjs.com/package/sass-lint), [scss-lint](https://github.com/brigade/scss-lint), [stylelint](https://github.com/stylelint/stylelint) |
|
||||
| Scala | [fsc](https://www.scala-lang.org/old/sites/default/files/linuxsoft_archives/docu/files/tools/fsc.html), [sbtserver](https://www.scala-sbt.org/1.x/docs/sbt-server.html), [scalac](http://scala-lang.org), [scalafmt](https://scalameta.org/scalafmt/), [scalastyle](http://www.scalastyle.org)|
|
||||
@@ -193,11 +181,11 @@ formatting.
|
||||
| SQL | [sqlint](https://github.com/purcell/sqlint), [sqlfmt](https://github.com/jackc/sqlfmt) |
|
||||
| Swift | [swiftlint](https://github.com/realm/SwiftLint), [swiftformat](https://github.com/nicklockwood/SwiftFormat) |
|
||||
| Tcl | [nagelfar](http://nagelfar.sourceforge.net) !! |
|
||||
| Terraform | [fmt](https://github.com/hashicorp/terraform), [tflint](https://github.com/wata727/tflint) |
|
||||
| Terraform | [tflint](https://github.com/wata727/tflint) |
|
||||
| Texinfo | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good)|
|
||||
| Text^ | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [textlint](https://textlint.github.io/), [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good) |
|
||||
| Thrift | [thrift](http://thrift.apache.org/) |
|
||||
| TypeScript | [eslint](http://eslint.org/), [prettier](https://github.com/prettier/prettier), [tslint](https://github.com/palantir/tslint), [tsserver](https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29), typecheck |
|
||||
| TypeScript | [eslint](http://eslint.org/), [prettier](https://github.com/prettier/prettier), [tslint](https://github.com/palantir/tslint), tsserver, typecheck |
|
||||
| VALA | [uncrustify](https://github.com/uncrustify/uncrustify) |
|
||||
| Verilog | [iverilog](https://github.com/steveicarus/iverilog), [verilator](http://www.veripool.org/projects/verilator/wiki/Intro) |
|
||||
| Vim | [vint](https://github.com/Kuniwak/vint) |
|
||||
@@ -286,7 +274,6 @@ Protocol linters, or from `tsserver` for TypeScript.
|
||||
|
||||
```vim
|
||||
" Enable completion where available.
|
||||
" This setting must be set before ALE is loaded.
|
||||
let g:ale_completion_enabled = 1
|
||||
```
|
||||
|
||||
@@ -320,24 +307,11 @@ ALE supports "hover" information for printing brief information about symbols at
|
||||
the cursor taken from Language Server Protocol linters and `tsserver` with the
|
||||
`ALEHover` command.
|
||||
|
||||
The information can be displayed in a `balloon` tooltip in Vim or GVim by
|
||||
hovering your mouse over symbols. Mouse hovering is enabled by default in GVim,
|
||||
and needs to be configured for Vim 8.1+ in terminals.
|
||||
On vim/gvim with `balloon` support you can see the information in a tooltip
|
||||
that appears under the mouse when you mouseover a symbol.
|
||||
|
||||
See `:help ale-hover` for more information.
|
||||
|
||||
<a name="usage-symbol-search"></a>
|
||||
|
||||
### 2.vii Symbol Search
|
||||
|
||||
ALE supports searching for workspace symbols via Language Server Protocol
|
||||
linters with the `ALESymbolSearch` command.
|
||||
|
||||
Search queries can be performed to find functions, types, and more which are
|
||||
similar to a given query string.
|
||||
|
||||
See `:help ale-symbol-search` for more information.
|
||||
|
||||
<a name="installation"></a>
|
||||
|
||||
## 3. Installation
|
||||
@@ -421,18 +395,6 @@ Plugin 'w0rp/ale'
|
||||
|
||||
See the Vundle documentation for more information.
|
||||
|
||||
<a name="installation-with-vim-plug"></a>
|
||||
|
||||
### 3.iiii. Installation with Vim-Plug
|
||||
|
||||
You can install this plugin using [Vim-Plug](https://github.com/junegunn/vim-plug)
|
||||
by adding the GitHub path for this repository to your `~/.vimrc`
|
||||
and running `:PlugInstall`.
|
||||
|
||||
```vim
|
||||
Plug 'w0rp/ale'
|
||||
```
|
||||
|
||||
<a name="contributing"></a>
|
||||
|
||||
## 4. Contributing
|
||||
@@ -751,16 +713,16 @@ options in a jsx.vim ftplugin file.
|
||||
|
||||
```vim
|
||||
" In ~/.vim/ftplugin/jsx.vim, or somewhere similar.
|
||||
let b:ale_linter_aliases = ['css', 'javascript']
|
||||
let b:ale_linters = ['stylelint', 'eslint']
|
||||
let b:ale_linter_aliases = ['css']
|
||||
```
|
||||
|
||||
Or if you want, you can configure the linters from your vimrc file.
|
||||
|
||||
```vim
|
||||
" In ~/.vim/vimrc, or somewhere similar.
|
||||
let g:ale_linter_aliases = {'jsx': ['css, 'javascript']}
|
||||
let g:ale_linters = {'jsx': ['stylelint', 'eslint']}
|
||||
let g:ale_linter_aliases = {'jsx': 'css'}
|
||||
```
|
||||
|
||||
ALE will alias the `jsx` filetype so it uses the `css` filetype linters, and
|
||||
@@ -768,40 +730,9 @@ use the original Array of selected linters for `jsx` from the `g:ale_linters`
|
||||
object. All available linters will be used for the filetype `javascript`, and
|
||||
no linter will be run twice for the same file.
|
||||
|
||||
<a name="faq-vue-eslint"></a>
|
||||
|
||||
### 5.xiii. How can I check Vue files with ESLint?
|
||||
|
||||
To check Vue files with ESLint, your ESLint project configuration file must be
|
||||
configured to use the [Vue plugin](https://github.com/vuejs/eslint-plugin-vue).
|
||||
After that, you need to configure ALE so it will run the JavaScript ESLint
|
||||
linter on your files. The settings you need are similar to the settings needed
|
||||
for checking JSX code with both stylelint and ESLint, in the previous section.
|
||||
|
||||
```vim
|
||||
" In ~/.vim/ftplugin/vue.vim, or somewhere similar.
|
||||
|
||||
" Run both javascript and vue linters for vue files.
|
||||
let b:ale_linter_aliases = ['javascript', 'vue']
|
||||
" Select the eslint and vls linters.
|
||||
let b:ale_linters = ['eslint', 'vls']
|
||||
```
|
||||
|
||||
Run `:ALEInfo` to see which linters are available after telling ALE to run
|
||||
JavaScript linters on Vue files. Not all linters support checking Vue files.
|
||||
|
||||
If you don't want to configure your linters in ftplugin files for some reason,
|
||||
you can configure them from your vimrc file instead.
|
||||
|
||||
```vim
|
||||
" In ~/.vim/vimrc, or somewhere similar.
|
||||
let g:ale_linter_aliases = {'vue': ['vue', 'javascript']}
|
||||
let g:ale_linters = {'vue': ['eslint', 'vls']}
|
||||
```
|
||||
|
||||
<a name="faq-my-battery-is-sad"></a>
|
||||
|
||||
### 5.xiv. Will this plugin eat all of my laptop battery power?
|
||||
### 5.xiii. Will this plugin eat all of my laptop battery power?
|
||||
|
||||
ALE takes advantage of the power of various tools to check your code. This of
|
||||
course means that CPU time will be used to continuously check your code. If you
|
||||
@@ -826,7 +757,7 @@ including the option `g:ale_lint_on_enter`, and you can run ALE manually with
|
||||
|
||||
<a name="faq-c-configuration"></a>
|
||||
|
||||
### 5.xv. How can I configure my C or C++ project?
|
||||
### 5.xiv. How can I configure my C or C++ project?
|
||||
|
||||
The structure of C and C++ projects varies wildly from project to project, with
|
||||
many different build tools being used for building them, and many different
|
||||
@@ -852,7 +783,7 @@ used for executing local vimrc files which can be shared in your project.
|
||||
|
||||
<a name="faq-buffer-configuration"></a>
|
||||
|
||||
### 5.xvi. How can I configure ALE differently for different buffers?
|
||||
### 5.xv. How can I configure ALE differently for different buffers?
|
||||
|
||||
ALE offers various ways to configure which linters or fixers are run, and
|
||||
other settings. For the majority of ALE's settings, they can either be
|
||||
@@ -888,7 +819,7 @@ Buffer-local variables for settings always override the global settings.
|
||||
|
||||
<a name="faq-list-window-height"></a>
|
||||
|
||||
### 5.xvii. How can I configure the height of the list in which ALE displays errors?
|
||||
### 5.xvi. How can I configure the height of the list in which ALE displays errors?
|
||||
|
||||
To set a default height for the error list, use the `g:ale_list_window_size` variable.
|
||||
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
" Author: Martino Pilia <martino.pilia@gmail.com>
|
||||
" Description: Lint Ada files with GCC
|
||||
|
||||
call ale#Set('ada_gcc_executable', 'gcc')
|
||||
|
||||
" -gnatwa: activate most optional warnings
|
||||
" -gnatq: try semantic analysis even if syntax errors have been found
|
||||
call ale#Set('ada_gcc_options', '-gnatwa -gnatq')
|
||||
|
||||
function! ale_linters#ada#gcc#GetCommand(buffer) abort
|
||||
" Build a suitable output file name. The output file is specified because
|
||||
" the .ali file may be created even if no code generation is attempted.
|
||||
" The output file name must match the source file name (except for the
|
||||
" extension), so here we cannot use the null file as output.
|
||||
let l:tmp_dir = fnamemodify(ale#engine#CreateDirectory(a:buffer), ':p')
|
||||
let l:out_file = l:tmp_dir . fnamemodify(bufname(a:buffer), ':t:r') . '.o'
|
||||
|
||||
" -gnatc: Check syntax and semantics only (no code generation attempted)
|
||||
return '%e -x ada -c -gnatc'
|
||||
\ . ' -o ' . ale#Escape(l:out_file)
|
||||
\ . ' -I ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'ada_gcc_options'))
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
" For the message format please refer to:
|
||||
" https://gcc.gnu.org/onlinedocs/gnat_ugn/Output-and-Error-Message-Control.html
|
||||
" https://gcc.gnu.org/onlinedocs/gnat_ugn/Warning-Message-Control.html
|
||||
function! ale_linters#ada#gcc#Handle(buffer, lines) abort
|
||||
" Error format: <filename>:<lnum>:<col>: <text>
|
||||
" Warning format: <filename>:<lnum>:<col>: warning: <text>
|
||||
let l:re = '\v(.+):([0-9]+):([0-9]+):\s+(warning:)?\s*(.+)\s*'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:re)
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': str2nr(l:match[2]),
|
||||
\ 'col': str2nr(l:match[3]),
|
||||
\ 'type': l:match[4] is# 'warning:' ? 'W' : 'E',
|
||||
\ 'text': l:match[5],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('ada', {
|
||||
\ 'name': 'gcc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': ale#VarFunc('ada_gcc_executable'),
|
||||
\ 'command_callback': 'ale_linters#ada#gcc#GetCommand',
|
||||
\ 'callback': 'ale_linters#ada#gcc#Handle',
|
||||
\})
|
||||
@@ -1,12 +1,6 @@
|
||||
" Author: Bjorn Neergaard <bjorn@neersighted.com>
|
||||
" Description: ansible-lint for ansible-yaml files
|
||||
|
||||
call ale#Set('ansible_ansible_lint_executable', 'ansible-lint')
|
||||
|
||||
function! ale_linters#ansible#ansible_lint#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'ansible_ansible_lint_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#ansible#ansible_lint#Handle(buffer, lines) abort
|
||||
for l:line in a:lines[:10]
|
||||
if match(l:line, '^Traceback') >= 0
|
||||
@@ -48,9 +42,8 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, lines) abort
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('ansible', {
|
||||
\ 'name': 'ansible_lint',
|
||||
\ 'aliases': ['ansible', 'ansible-lint'],
|
||||
\ 'executable_callback': 'ale_linters#ansible#ansible_lint#GetExecutable',
|
||||
\ 'command': '%e -p %t',
|
||||
\ 'name': 'ansible',
|
||||
\ 'executable': 'ansible',
|
||||
\ 'command': 'ansible-lint -p %t',
|
||||
\ 'callback': 'ale_linters#ansible#ansible_lint#Handle',
|
||||
\})
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
" Author: Jeff Kreeftmeijer https://github.com/jeffkreeftmeijer
|
||||
" Description: vale for AsciiDoc files
|
||||
|
||||
call ale#linter#Define('asciidoc', {
|
||||
\ 'name': 'vale',
|
||||
\ 'executable': 'vale',
|
||||
\ 'command': 'vale --output=line %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
||||
@@ -1,14 +0,0 @@
|
||||
" Author: Ye Jingchen <ye.jingchen@gmail.com>, Ben Falconer <ben@falconers.me.uk>, jtalowell <jtalowell@protonmail.com>
|
||||
" 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'),
|
||||
\})
|
||||
@@ -10,7 +10,7 @@ call ale#Set('c_clangtidy_executable', 'clang-tidy')
|
||||
" Consult the check list in clang-tidy's documentation:
|
||||
" http://clang.llvm.org/extra/clang-tidy/checks/list.html
|
||||
|
||||
call ale#Set('c_clangtidy_checks', [])
|
||||
call ale#Set('c_clangtidy_checks', ['*'])
|
||||
" Set this option to manually set some options for clang-tidy.
|
||||
" This will disable compile_commands.json detection.
|
||||
call ale#Set('c_clangtidy_options', '')
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
" Author: Ye Jingchen <ye.jingchen@gmail.com>, Ben Falconer <ben@falconers.me.uk>, jtalowell <jtalowell@protonmail.com>
|
||||
" 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'),
|
||||
\})
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
call ale#Set('cpp_clangtidy_executable', 'clang-tidy')
|
||||
" Set this option to check the checks clang-tidy will apply.
|
||||
call ale#Set('cpp_clangtidy_checks', [])
|
||||
call ale#Set('cpp_clangtidy_checks', ['*'])
|
||||
" Set this option to manually set some options for clang-tidy.
|
||||
" This will disable compile_commands.json detection.
|
||||
call ale#Set('cpp_clangtidy_options', '')
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
" Author: aurieh <me@aurieh.me>
|
||||
" Description: A Language Server implementation for D
|
||||
|
||||
call ale#Set('d_dls_executable', 'dls')
|
||||
|
||||
function! ale_linters#d#dls#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'd_dls_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#d#dls#FindProjectRoot(buffer) abort
|
||||
" Note: this will return . if dub config is empty
|
||||
" dls can run outside DUB projects just fine
|
||||
return fnamemodify(ale#d#FindDUBConfig(a:buffer), ':h')
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('d', {
|
||||
\ 'name': 'dls',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': 'ale_linters#d#dls#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#d#dls#GetExecutable',
|
||||
\ 'project_root_callback': 'ale_linters#d#dls#FindProjectRoot',
|
||||
\})
|
||||
@@ -1,6 +1,20 @@
|
||||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" Description: "dmd for D files"
|
||||
|
||||
function! s:FindDUBConfig(buffer) abort
|
||||
" Find a DUB configuration file in ancestor paths.
|
||||
" The most DUB-specific names will be tried first.
|
||||
for l:possible_filename in ['dub.sdl', 'dub.json', 'package.json']
|
||||
let l:dub_file = ale#path#FindNearestFile(a:buffer, l:possible_filename)
|
||||
|
||||
if !empty(l:dub_file)
|
||||
return l:dub_file
|
||||
endif
|
||||
endfor
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! ale_linters#d#dmd#DUBCommand(buffer) abort
|
||||
" If we can't run dub, then skip this command.
|
||||
if !executable('dub')
|
||||
@@ -8,7 +22,7 @@ function! ale_linters#d#dmd#DUBCommand(buffer) abort
|
||||
return ''
|
||||
endif
|
||||
|
||||
let l:dub_file = ale#d#FindDUBConfig(a:buffer)
|
||||
let l:dub_file = s:FindDUBConfig(a:buffer)
|
||||
|
||||
if empty(l:dub_file)
|
||||
return ''
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
" Author: Alexander Olofsson <alexander.olofsson@liu.se>
|
||||
|
||||
call ale#Set('dockerfile_dockerfile_lint_executable', 'dockerfile_lint')
|
||||
call ale#Set('dockerfile_dockerfile_lint_options', '')
|
||||
|
||||
function! ale_linters#dockerfile#dockerfile_lint#GetType(type) abort
|
||||
if a:type is? 'error'
|
||||
return 'E'
|
||||
elseif a:type is? 'warn'
|
||||
return 'W'
|
||||
endif
|
||||
|
||||
return 'I'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#dockerfile#dockerfile_lint#Handle(buffer, lines) abort
|
||||
try
|
||||
let l:data = json_decode(join(a:lines, ''))
|
||||
catch
|
||||
return []
|
||||
endtry
|
||||
|
||||
if empty(l:data)
|
||||
" Should never happen, but it's better to be on the safe side
|
||||
return []
|
||||
endif
|
||||
|
||||
let l:messages = []
|
||||
|
||||
for l:type in ['error', 'warn', 'info']
|
||||
for l:object in l:data[l:type]['data']
|
||||
let l:line = get(l:object, 'line', -1)
|
||||
let l:message = l:object['message']
|
||||
|
||||
if get(l:object, 'description', 'None') isnot# 'None'
|
||||
let l:message = l:message . '. ' . l:object['description']
|
||||
endif
|
||||
|
||||
call add(l:messages, {
|
||||
\ 'lnum': l:line,
|
||||
\ 'text': l:message,
|
||||
\ 'type': ale_linters#dockerfile#dockerfile_lint#GetType(l:type),
|
||||
\})
|
||||
endfor
|
||||
endfor
|
||||
|
||||
return l:messages
|
||||
endfunction
|
||||
|
||||
function! ale_linters#dockerfile#dockerfile_lint#GetCommand(buffer) abort
|
||||
return '%e' . ale#Pad(ale#Var(a:buffer, 'dockerfile_dockerfile_lint_options'))
|
||||
\ . ' -p -j -f'
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('dockerfile', {
|
||||
\ 'name': 'dockerfile_lint',
|
||||
\ 'executable_callback': ale#VarFunc('dockerfile_dockerfile_lint_executable'),
|
||||
\ 'command_callback': 'ale_linters#dockerfile#dockerfile_lint#GetCommand',
|
||||
\ 'callback': 'ale_linters#dockerfile#dockerfile_lint#Handle',
|
||||
\})
|
||||
@@ -11,18 +11,10 @@ function! ale_linters#elixir#credo#Handle(buffer, lines) abort
|
||||
let l:type = l:match[3]
|
||||
let l:text = l:match[4]
|
||||
|
||||
" Refactoring opportunities
|
||||
if l:type is# 'F'
|
||||
let l:type = 'W'
|
||||
" Consistency
|
||||
elseif l:type is# 'C'
|
||||
let l:type = 'W'
|
||||
" Software Design
|
||||
elseif l:type is# 'D'
|
||||
let l:type = 'I'
|
||||
" Code Readability
|
||||
if l:type is# 'C'
|
||||
let l:type = 'E'
|
||||
elseif l:type is# 'R'
|
||||
let l:type = 'I'
|
||||
let l:type = 'W'
|
||||
endif
|
||||
|
||||
call add(l:output, {
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
" Author: Jon Parise <jon@indelible.org>
|
||||
" Description: ElixirLS integration (https://github.com/JakeBecker/elixir-ls)
|
||||
|
||||
call ale#Set('elixir_elixir_ls_release', 'elixir-ls')
|
||||
call ale#Set('elixir_elixir_ls_config', {})
|
||||
|
||||
function! ale_linters#elixir#elixir_ls#GetExecutable(buffer) abort
|
||||
let l:dir = ale#path#Simplify(ale#Var(a:buffer, 'elixir_elixir_ls_release'))
|
||||
let l:cmd = ale#Has('win32') ? '\language_server.bat' : '/language_server.sh'
|
||||
|
||||
return l:dir . l:cmd
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('elixir', {
|
||||
\ 'name': 'elixir-ls',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': 'ale_linters#elixir#elixir_ls#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#elixir#elixir_ls#GetExecutable',
|
||||
\ 'project_root_callback': 'ale#handlers#elixir#FindMixUmbrellaRoot',
|
||||
\ 'lsp_config_callback': ale#VarFunc('elixir_elixir_ls_config'),
|
||||
\})
|
||||
@@ -1,62 +0,0 @@
|
||||
" Author: aclemons - https://github.com/aclemons
|
||||
" based on the ale rubocop linter
|
||||
" Description: Ruumba, RuboCop linting for ERB templates.
|
||||
|
||||
call ale#Set('eruby_ruumba_executable', 'ruumba')
|
||||
call ale#Set('eruby_ruumba_options', '')
|
||||
|
||||
function! ale_linters#eruby#ruumba#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'eruby_ruumba_executable')
|
||||
|
||||
return ale#handlers#ruby#EscapeExecutable(l:executable, 'ruumba')
|
||||
\ . ' --format json --force-exclusion '
|
||||
\ . ale#Var(a:buffer, 'eruby_ruumba_options')
|
||||
\ . ' --stdin ' . ale#Escape(expand('#' . a:buffer . ':p'))
|
||||
endfunction
|
||||
|
||||
function! ale_linters#eruby#ruumba#Handle(buffer, lines) abort
|
||||
try
|
||||
let l:errors = json_decode(a:lines[0])
|
||||
catch
|
||||
return []
|
||||
endtry
|
||||
|
||||
if !has_key(l:errors, 'summary')
|
||||
\|| l:errors['summary']['offense_count'] == 0
|
||||
\|| empty(l:errors['files'])
|
||||
return []
|
||||
endif
|
||||
|
||||
let l:output = []
|
||||
|
||||
for l:error in l:errors['files'][0]['offenses']
|
||||
let l:start_col = l:error['location']['column'] + 0
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:error['location']['line'] + 0,
|
||||
\ 'col': l:start_col,
|
||||
\ 'end_col': l:start_col + l:error['location']['length'] - 1,
|
||||
\ 'code': l:error['cop_name'],
|
||||
\ 'text': l:error['message'],
|
||||
\ 'type': ale_linters#eruby#ruumba#GetType(l:error['severity']),
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
function! ale_linters#eruby#ruumba#GetType(severity) abort
|
||||
if a:severity is? 'convention'
|
||||
\|| a:severity is? 'warning'
|
||||
\|| a:severity is? 'refactor'
|
||||
return 'W'
|
||||
endif
|
||||
|
||||
return 'E'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('eruby', {
|
||||
\ 'name': 'ruumba',
|
||||
\ 'executable_callback': ale#VarFunc('eruby_ruumba_executable'),
|
||||
\ 'command_callback': 'ale_linters#eruby#ruumba#GetCommand',
|
||||
\ 'callback': 'ale_linters#eruby#ruumba#Handle',
|
||||
\})
|
||||
@@ -1,21 +1,10 @@
|
||||
" Author: neersighted <bjorn@neersighted.com>
|
||||
" Description: golint for Go files
|
||||
|
||||
call ale#Set('go_golint_executable', 'golint')
|
||||
call ale#Set('go_golint_options', '')
|
||||
|
||||
function! ale_linters#go#golint#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'go_golint_options')
|
||||
|
||||
return '%e'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'golint',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'executable_callback': ale#VarFunc('go_golint_executable'),
|
||||
\ 'command_callback': 'ale_linters#go#golint#GetCommand',
|
||||
\ 'executable': 'golint',
|
||||
\ 'command': 'golint %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
" Author: Michiel Westerbeek <happylinks@gmail.com>
|
||||
" Description: Linter for GraphQL Schemas
|
||||
|
||||
function! ale_linters#graphql#gqlint#GetCommand(buffer) abort
|
||||
return ale#path#BufferCdString(a:buffer)
|
||||
\ . 'gqlint'
|
||||
\ . ' --reporter=simple %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('graphql', {
|
||||
\ 'name': 'gqlint',
|
||||
\ 'executable': 'gqlint',
|
||||
\ 'command_callback': 'ale_linters#graphql#gqlint#GetCommand',
|
||||
\ 'command': 'gqlint --reporter=simple %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
" Author: Patrick Lewis - https://github.com/patricklewis, thenoseman - https://github.com/thenoseman
|
||||
" Description: haml-lint for Haml files
|
||||
|
||||
call ale#Set('haml_hamllint_executable', 'haml-lint')
|
||||
|
||||
function! ale_linters#haml#hamllint#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'haml_hamllint_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#haml#hamllint#GetCommand(buffer) abort
|
||||
let l:prefix = ''
|
||||
|
||||
@@ -27,7 +21,7 @@ function! ale_linters#haml#hamllint#GetCommand(buffer) abort
|
||||
endif
|
||||
|
||||
return (!empty(l:prefix) ? l:prefix . ' ' : '')
|
||||
\ . ale_linters#haml#hamllint#GetExecutable(a:buffer)
|
||||
\ . 'haml-lint'
|
||||
\ . (!empty(l:hamllint_config_file_path) ? ' --config ' . ale#Escape(l:hamllint_config_file_path) : '')
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
@@ -51,7 +45,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('haml', {
|
||||
\ 'name': 'hamllint',
|
||||
\ 'executable_callback': 'ale_linters#haml#hamllint#GetExecutable',
|
||||
\ 'executable': 'haml-lint',
|
||||
\ 'command_callback': 'ale_linters#haml#hamllint#GetCommand',
|
||||
\ 'callback': 'ale_linters#haml#hamllint#Handle'
|
||||
\})
|
||||
|
||||
18
ale_linters/haskell/ghc-mod.vim
Normal file
18
ale_linters/haskell/ghc-mod.vim
Normal file
@@ -0,0 +1,18 @@
|
||||
" 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',
|
||||
\})
|
||||
@@ -1,19 +0,0 @@
|
||||
" 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,10 +5,7 @@ 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
|
||||
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'))
|
||||
return '%e check' . ale#Pad(ale#Var(a:buffer, 'haskell_hdevtools_options'))
|
||||
\ . ' -p %s %t'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -3,39 +3,42 @@
|
||||
|
||||
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')
|
||||
|
||||
" If it's empty, search for the cabal file
|
||||
if empty(l:project_file)
|
||||
" Search all of the paths except for the root filesystem path.
|
||||
let l:paths = join(
|
||||
\ ale#path#Upwards(expand('#' . a:buffer . ':p:h'))[:-2],
|
||||
\ ','
|
||||
\)
|
||||
let l:cabal_file = fnamemodify(bufname(a:buffer), ':p:h')
|
||||
let l:paths = ''
|
||||
|
||||
while empty(matchstr(l:cabal_file, '^\(\/\|\(\w:\\\)\)$'))
|
||||
let l:cabal_file = fnamemodify(l:cabal_file, ':h')
|
||||
let l:paths = l:paths . l:cabal_file . ','
|
||||
endwhile
|
||||
|
||||
let l:project_file = globpath(l:paths, '*.cabal')
|
||||
endif
|
||||
|
||||
" If we still can't find one, use the current file.
|
||||
if empty(l:project_file)
|
||||
let l:project_file = expand('#' . a:buffer . ':p')
|
||||
" Either extract the project directory or take the current working
|
||||
" directory
|
||||
if !empty(l:project_file)
|
||||
let l:project_file = fnamemodify(l:project_file, ':h')
|
||||
else
|
||||
let l:project_file = expand('#' . a:buffer . ':p:h')
|
||||
endif
|
||||
|
||||
return fnamemodify(l:project_file, ':h')
|
||||
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'
|
||||
return l:project_file
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'hie',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'command_callback': 'ale_linters#haskell#hie#GetCommand',
|
||||
\ 'executable_callback': ale#VarFunc('haskell_hie_executable'),
|
||||
\ 'command': '%e --lsp',
|
||||
\ 'executable_callback': 'ale_linters#haskell#hie#GetExecutable',
|
||||
\ 'project_root_callback': 'ale_linters#haskell#hie#GetProjectRoot',
|
||||
\})
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
" 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 = []
|
||||
|
||||
@@ -29,18 +26,9 @@ 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_callback': ale#VarFunc('haskell_hlint_executable'),
|
||||
\ 'command_callback': 'ale_linters#haskell#hlint#GetCommand' ,
|
||||
\ 'executable': 'hlint',
|
||||
\ 'command': 'hlint --color=never --json -',
|
||||
\ 'callback': 'ale_linters#haskell#hlint#Handle',
|
||||
\})
|
||||
|
||||
@@ -16,7 +16,7 @@ call ale#linter#Define('haskell', {
|
||||
\ 'name': 'stack_build',
|
||||
\ 'aliases': ['stack-build'],
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale#handlers#haskell#GetStackExecutable',
|
||||
\ 'executable': 'stack',
|
||||
\ 'command_callback': 'ale_linters#haskell#stack_build#GetCommand',
|
||||
\ 'lint_file': 1,
|
||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||
|
||||
@@ -5,7 +5,7 @@ call ale#linter#Define('haskell', {
|
||||
\ 'name': 'stack_ghc',
|
||||
\ 'aliases': ['stack-ghc'],
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale#handlers#haskell#GetStackExecutable',
|
||||
\ 'executable': 'stack',
|
||||
\ 'command': 'stack ghc -- -fno-code -v0 %t',
|
||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||
\})
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
" Author: Martino Pilia <martino.pilia@gmail.com>
|
||||
" Description: Lint ispc files with the Intel(R) SPMD Program Compiler
|
||||
|
||||
call ale#Set('ispc_ispc_executable', 'ispc')
|
||||
call ale#Set('ispc_ispc_options', '')
|
||||
|
||||
function! ale_linters#ispc#ispc#GetCommand(buffer) abort
|
||||
" --nowrap: do not wrap message lines
|
||||
return '%e --nowrap'
|
||||
\ . ale#Pad(ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer)))
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'ispc_ispc_options'))
|
||||
\ . ' %s'
|
||||
endfunction
|
||||
|
||||
" Note that we ignore the two warnings in the beginning of the compiler output
|
||||
" ('no output file specified' and 'no --target specified'), since they have
|
||||
" nothing to do with linting.
|
||||
function! ale_linters#ispc#ispc#Handle(buffer, lines) abort
|
||||
" Message format: <filename>:<lnum>:<col> <type>: <text>
|
||||
" As far as I know, <type> can be any of:
|
||||
" 'error', 'Error', 'fatal error', 'Warning', 'Performance Warning'
|
||||
let l:re = '\v.+:([0-9]+):([0-9]+):\s+([^:]+):\s+(.+)'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:re)
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': str2nr(l:match[1]),
|
||||
\ 'col': str2nr(l:match[2]),
|
||||
\ 'type': l:match[3] =~? 'error' ? 'E' : 'W',
|
||||
\ 'text': l:match[4],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('ispc', {
|
||||
\ 'name': 'ispc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': ale#VarFunc('ispc_ispc_executable'),
|
||||
\ 'command_callback': 'ale_linters#ispc#ispc#GetCommand',
|
||||
\ 'callback': 'ale_linters#ispc#ispc#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
@@ -2,10 +2,8 @@
|
||||
" Description: checkstyle for Java files
|
||||
|
||||
function! ale_linters#java#checkstyle#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
|
||||
" modern checkstyle versions
|
||||
let l:pattern = '\v\[(WARN|ERROR)\] [a-zA-Z]?:?[^:]+:(\d+):(\d+)?:? (.*) \[(.+)\]$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
@@ -17,24 +15,13 @@ function! ale_linters#java#checkstyle#Handle(buffer, lines) abort
|
||||
\})
|
||||
endfor
|
||||
|
||||
" old checkstyle versions
|
||||
let l:pattern = '\v(.+):(\d+): ([^:]+): (.+)$'
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'type': l:match[3] is? 'warning' ? 'W' : 'E',
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'text': l:match[4],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
function! ale_linters#java#checkstyle#GetCommand(buffer) abort
|
||||
return 'checkstyle '
|
||||
\ . ale#Var(a:buffer, 'java_checkstyle_options')
|
||||
\ . ' %s'
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
if !exists('g:ale_java_checkstyle_options')
|
||||
@@ -46,5 +33,4 @@ call ale#linter#Define('java', {
|
||||
\ 'executable': 'checkstyle',
|
||||
\ 'command_callback': 'ale_linters#java#checkstyle#GetCommand',
|
||||
\ 'callback': 'ale_linters#java#checkstyle#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Description: PMD for Java files
|
||||
|
||||
function! ale_linters#java#pmd#Handle(buffer, lines) abort
|
||||
let l:pattern = '"\(\d\+\)",".*","\(.\+\)","\(\d\+\)","\(\d\+\)","\(.\+\)","\(.\+\)","\(.\+\)"$'
|
||||
let l:pattern = '"\(\d\+\)",".\+","\(.\+\)","\(\d\+\)","\(\d\+\)","\(.\+\)","\(.\+\)","\(.\+\)"$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
|
||||
@@ -155,8 +155,7 @@ function! ale_linters#javascript#flow#Handle(buffer, lines) abort
|
||||
\}
|
||||
|
||||
if has_key(l:error, 'extra')
|
||||
let l:errorToAdd.detail = l:errorToAdd.text
|
||||
\ . "\n" . s:GetDetails(l:error)
|
||||
let l:errorToAdd.detail = s:GetDetails(l:error)
|
||||
endif
|
||||
|
||||
call add(l:output, l:errorToAdd)
|
||||
|
||||
@@ -18,7 +18,7 @@ function! ale_linters#javascript#jshint#GetCommand(buffer) abort
|
||||
let l:command .= ' --config ' . ale#Escape(l:jshint_config)
|
||||
endif
|
||||
|
||||
let l:command .= ' --filename %s -'
|
||||
let l:command .= ' -'
|
||||
|
||||
return l:command
|
||||
endfunction
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
" Author: Ye Jingchen <ye.jingchen@gmail.com>, Ben Falconer <ben@falconers.me.uk>, jtalowell <jtalowell@protonmail.com>
|
||||
" 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'),
|
||||
\})
|
||||
@@ -1,166 +0,0 @@
|
||||
" Author:Travis Gibson <https://github.com/Garland-g>
|
||||
" Description: This file adds support for checking perl6 syntax
|
||||
|
||||
let g:ale_perl6_perl6_executable =
|
||||
\ get(g:, 'ale_perl6_perl6_executable', 'perl6')
|
||||
|
||||
let g:ale_perl6_perl6_options =
|
||||
\ get(g:, 'ale_perl6_perl6_options', '-c -Ilib')
|
||||
|
||||
let $PERL6_EXCEPTIONS_HANDLER = 'JSON'
|
||||
|
||||
let $RAKUDO_ERROR_COLOR = 0
|
||||
|
||||
function! ale_linters#perl6#perl6#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'perl6_perl6_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#perl6#perl6#GetCommand(buffer) abort
|
||||
return ale_linters#perl6#perl6#GetExecutable(a:buffer)
|
||||
\ . ' ' . ale#Var(a:buffer, 'perl6_perl6_options')
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#perl6#perl6#ExtractError(dict, item, type, buffer) abort
|
||||
let l:file = ''
|
||||
let l:line = 1
|
||||
let l:column = ''
|
||||
let l:text = ''
|
||||
let l:pre = ''
|
||||
let l:counter = 2
|
||||
let l:end_line = ''
|
||||
let l:linepatternmessage = 'at\s\+line\s\+\(\d\+\)'
|
||||
|
||||
if has_key(a:dict[a:item], 'filename') && !empty(a:dict[a:item]['filename'])
|
||||
let l:file = a:dict[a:item]['filename']
|
||||
endif
|
||||
|
||||
if has_key(a:dict[a:item], 'line') && !empty(a:dict[a:item]['line'])
|
||||
let l:line = a:dict[a:item]['line']
|
||||
let l:counter -= 1
|
||||
endif
|
||||
|
||||
if has_key(a:dict[a:item], 'column') && !empty(a:dict[a:item]['column'])
|
||||
let l:column = a:dict[a:item]['column']
|
||||
endif
|
||||
|
||||
if has_key(a:dict[a:item], 'message') && !empty(a:dict[a:item]['message'])
|
||||
let l:text = substitute(a:dict[a:item]['message'], '\s*\n\s*', ' ', 'g')
|
||||
let l:counter -= 1
|
||||
endif
|
||||
|
||||
if has_key(a:dict[a:item], 'line-real') && !empty(a:dict[a:item]['line-real'])
|
||||
let l:end_line = l:line
|
||||
let l:line = a:dict[a:item]['line-real']
|
||||
endif
|
||||
|
||||
for l:match in ale#util#GetMatches(l:text, l:linepatternmessage)
|
||||
let l:line = l:match[1]
|
||||
let l:counter -= 1
|
||||
endfor
|
||||
|
||||
" Currently, filenames and line numbers are not always given in the error output
|
||||
if l:counter < 2
|
||||
\&& ( ale#path#IsBufferPath(a:buffer, l:file) || l:file is# '' )
|
||||
return {
|
||||
\ 'lnum': '' . l:line,
|
||||
\ 'text': l:text,
|
||||
\ 'type': a:type,
|
||||
\ 'col': l:column,
|
||||
\ 'end_lnum': l:end_line,
|
||||
\ 'code': a:item,
|
||||
\}
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! ale_linters#perl6#perl6#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
|
||||
if empty(a:lines)
|
||||
return l:output
|
||||
endif
|
||||
|
||||
if a:lines[0] is# 'Syntax OK'
|
||||
return l:output
|
||||
endif
|
||||
|
||||
try
|
||||
let l:json = json_decode(join(a:lines, ''))
|
||||
catch /E474/
|
||||
call add(l:output, {
|
||||
\ 'lnum': '1',
|
||||
\ 'text': 'Received output in the default Perl6 error format. See :ALEDetail for details',
|
||||
\ 'detail': join(a:lines, "\n"),
|
||||
\ 'type': 'W',
|
||||
\ })
|
||||
|
||||
return l:output
|
||||
endtry
|
||||
|
||||
if type(l:json) is v:t_dict
|
||||
for l:key in keys(l:json)
|
||||
if has_key(l:json[l:key], 'sorrows') &&
|
||||
\ has_key(l:json[l:key], 'worries')
|
||||
if !empty(l:json[l:key]['sorrows'])
|
||||
for l:dictionary in get(l:json[l:key], 'sorrows')
|
||||
for l:item in keys(l:dictionary)
|
||||
let l:result =
|
||||
\ ale_linters#perl6#perl6#ExtractError(
|
||||
\ l:dictionary,
|
||||
\ l:item,
|
||||
\ 'E',
|
||||
\ a:buffer,
|
||||
\ )
|
||||
|
||||
if l:result isnot# ''
|
||||
call add(l:output, l:result)
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
endif
|
||||
|
||||
if !empty(l:json[l:key]['worries'])
|
||||
for l:dictionary in get(l:json[l:key], 'worries')
|
||||
for l:item in keys(l:dictionary)
|
||||
let l:result =
|
||||
\ ale_linters#perl6#perl6#ExtractError(
|
||||
\ l:dictionary,
|
||||
\ l:item,
|
||||
\ 'W',
|
||||
\ a:buffer,
|
||||
\ )
|
||||
|
||||
if l:result isnot# ''
|
||||
call add(l:output, l:result)
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
endif
|
||||
else
|
||||
let l:result = ale_linters#perl6#perl6#ExtractError(
|
||||
\ l:json,
|
||||
\ l:key,
|
||||
\ 'E',
|
||||
\ a:buffer,
|
||||
\ )
|
||||
|
||||
if l:result isnot# ''
|
||||
call add(l:output, l:result)
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('perl6', {
|
||||
\ 'name': 'perl6',
|
||||
\ 'executable_callback': 'ale_linters#perl6#perl6#GetExecutable',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'command_callback': 'ale_linters#perl6#perl6#GetCommand',
|
||||
\ 'callback': 'ale_linters#perl6#perl6#Handle',
|
||||
\})
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" Author: Spencer Wood <https://github.com/scwood>, Adriaan Zonnenberg <amz@adriaan.xyz>
|
||||
" Description: This file adds support for checking PHP with php-cli
|
||||
|
||||
call ale#Set('php_php_executable', 'php')
|
||||
|
||||
function! ale_linters#php#php#Handle(buffer, lines) abort
|
||||
" Matches patterns like the following:
|
||||
"
|
||||
@@ -32,8 +30,8 @@ endfunction
|
||||
|
||||
call ale#linter#Define('php', {
|
||||
\ 'name': 'php',
|
||||
\ 'executable_callback': ale#VarFunc('php_php_executable'),
|
||||
\ 'executable': 'php',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'command': '%e -l -d error_reporting=E_ALL -d display_errors=1 -d log_errors=0 --',
|
||||
\ 'command': 'php -l -d error_reporting=E_ALL -d display_errors=1 -d log_errors=0 --',
|
||||
\ 'callback': 'ale_linters#php#php#Handle',
|
||||
\})
|
||||
|
||||
@@ -6,40 +6,15 @@ let g:ale_php_phpstan_executable = get(g:, 'ale_php_phpstan_executable', 'phpsta
|
||||
let g:ale_php_phpstan_level = get(g:, 'ale_php_phpstan_level', '4')
|
||||
let g:ale_php_phpstan_configuration = get(g:, 'ale_php_phpstan_configuration', '')
|
||||
|
||||
function! ale_linters#php#phpstan#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'php_phpstan_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#php#phpstan#VersionCheck(buffer) abort
|
||||
let l:executable = ale_linters#php#phpstan#GetExecutable(a:buffer)
|
||||
|
||||
" If we have previously stored the version number in a cache, then
|
||||
" don't look it up again.
|
||||
if ale#semver#HasVersion(l:executable)
|
||||
" Returning an empty string skips this command.
|
||||
return ''
|
||||
endif
|
||||
|
||||
let l:executable = ale#Escape(l:executable)
|
||||
|
||||
return l:executable . ' --version'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#php#phpstan#GetCommand(buffer, version_output) abort
|
||||
function! ale_linters#php#phpstan#GetCommand(buffer) abort
|
||||
let l:configuration = ale#Var(a:buffer, 'php_phpstan_configuration')
|
||||
let l:configuration_option = !empty(l:configuration)
|
||||
\ ? ' -c ' . l:configuration
|
||||
\ : ''
|
||||
|
||||
let l:executable = ale_linters#php#phpstan#GetExecutable(a:buffer)
|
||||
let l:version = ale#semver#GetVersion(l:executable, a:version_output)
|
||||
let l:error_format = ale#semver#GTE(l:version, [0, 10, 3])
|
||||
\ ? ' --error-format raw'
|
||||
\ : ' --errorFormat raw'
|
||||
|
||||
return '%e analyze -l'
|
||||
\ . ale#Var(a:buffer, 'php_phpstan_level')
|
||||
\ . l:error_format
|
||||
\ . ' --errorFormat raw'
|
||||
\ . l:configuration_option
|
||||
\ . ' %s'
|
||||
endfunction
|
||||
@@ -65,10 +40,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('php', {
|
||||
\ 'name': 'phpstan',
|
||||
\ 'executable_callback': 'ale_linters#php#phpstan#GetExecutable',
|
||||
\ 'command_chain': [
|
||||
\ {'callback': 'ale_linters#php#phpstan#VersionCheck'},
|
||||
\ {'callback': 'ale_linters#php#phpstan#GetCommand'},
|
||||
\ ],
|
||||
\ 'executable_callback': ale#VarFunc('php_phpstan_executable'),
|
||||
\ 'command_callback': 'ale_linters#php#phpstan#GetCommand',
|
||||
\ 'callback': 'ale_linters#php#phpstan#Handle',
|
||||
\})
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
" Author: Matt Brown <https://github.com/muglug>
|
||||
" Description: plugin for Psalm, static analyzer for PHP
|
||||
|
||||
call ale#Set('psalm_langserver_executable', 'psalm-language-server')
|
||||
call ale#Set('psalm_langserver_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#php#psalm#GetProjectRoot(buffer) abort
|
||||
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
|
||||
|
||||
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('php', {
|
||||
\ 'name': 'psalm',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('psalm_langserver', [
|
||||
\ 'vendor/bin/psalm-language-server',
|
||||
\ ]),
|
||||
\ 'command': '%e',
|
||||
\ 'project_root_callback': 'ale_linters#php#psalm#GetProjectRoot',
|
||||
\})
|
||||
@@ -1,100 +0,0 @@
|
||||
" Author: Takuya Fujiwara <tyru.exe@gmail.com>
|
||||
" Description: swipl syntax / semantic check for Prolog files
|
||||
|
||||
call ale#Set('prolog_swipl_executable', 'swipl')
|
||||
call ale#Set('prolog_swipl_load', 'current_prolog_flag(argv, [File]), load_files(File, [sandboxed(true)]), halt.')
|
||||
call ale#Set('prolog_swipl_timeout', 3)
|
||||
call ale#Set('prolog_swipl_alarm', 'alarm(%t, (%h), _, [])')
|
||||
call ale#Set('prolog_swipl_alarm_handler', 'writeln(user_error, "ERROR: Exceeded %t seconds, Please change g:prolog_swipl_timeout to modify the limit."), halt(1)')
|
||||
|
||||
function! ale_linters#prolog#swipl#GetCommand(buffer) abort
|
||||
let l:goals = ale#Var(a:buffer, 'prolog_swipl_load')
|
||||
let l:goals = l:goals =~# '^\s*$' ? 'halt' : l:goals
|
||||
let l:timeout = ale#Var(a:buffer, 'prolog_swipl_timeout') + 0
|
||||
|
||||
if l:timeout > 0
|
||||
let l:goals = s:GetAlarm(a:buffer, l:timeout) . ', ' . l:goals
|
||||
endif
|
||||
|
||||
return '%e -g ' . ale#Escape(l:goals) . ' -- %s'
|
||||
endfunction
|
||||
|
||||
function! s:GetAlarm(buffer, timeout) abort
|
||||
let l:handler = ale#Var(a:buffer, 'prolog_swipl_alarm_handler')
|
||||
let l:handler = s:Subst(l:handler, {'t': a:timeout})
|
||||
let l:alarm = ale#Var(a:buffer, 'prolog_swipl_alarm')
|
||||
let l:alarm = s:Subst(l:alarm, {'t': a:timeout, 'h': l:handler})
|
||||
|
||||
return l:alarm
|
||||
endfunction
|
||||
|
||||
function! s:Subst(format, vars) abort
|
||||
let l:vars = extend(copy(a:vars), {'%': '%'})
|
||||
|
||||
return substitute(a:format, '%\(.\)', '\=get(l:vars, submatch(1), "")', 'g')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#prolog#swipl#Handle(buffer, lines) abort
|
||||
let l:pattern = '\v^(ERROR|Warning)+%(:\s*[^:]+:(\d+)%(:(\d+))?)?:\s*(.*)$'
|
||||
let l:output = []
|
||||
let l:i = 0
|
||||
|
||||
while l:i < len(a:lines)
|
||||
let l:match = matchlist(a:lines[l:i], l:pattern)
|
||||
|
||||
if empty(l:match)
|
||||
let l:i += 1
|
||||
continue
|
||||
endif
|
||||
|
||||
let [l:i, l:text] = s:GetErrMsg(l:i, a:lines, l:match[4])
|
||||
let l:item = {
|
||||
\ 'lnum': (l:match[2] + 0 ? l:match[2] + 0 : 1),
|
||||
\ 'col': l:match[3] + 0,
|
||||
\ 'text': l:text,
|
||||
\ 'type': (l:match[1] is# 'ERROR' ? 'E' : 'W'),
|
||||
\}
|
||||
|
||||
if !s:Ignore(l:item)
|
||||
call add(l:output, l:item)
|
||||
endif
|
||||
endwhile
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
" This returns [<next line number>, <error message string>]
|
||||
function! s:GetErrMsg(i, lines, text) abort
|
||||
if a:text !~# '^\s*$'
|
||||
return [a:i + 1, a:text]
|
||||
endif
|
||||
|
||||
let l:i = a:i + 1
|
||||
let l:text = []
|
||||
|
||||
while l:i < len(a:lines) && a:lines[l:i] =~# '^\s'
|
||||
call add(l:text, s:Trim(a:lines[l:i]))
|
||||
let l:i += 1
|
||||
endwhile
|
||||
|
||||
return [l:i, join(l:text, '. ')]
|
||||
endfunction
|
||||
|
||||
function! s:Trim(str) abort
|
||||
return substitute(a:str, '\v^\s+|\s+$', '', 'g')
|
||||
endfunction
|
||||
|
||||
" Skip sandbox error which is caused by directives
|
||||
" because what we want is syntactic or semantic check.
|
||||
function! s:Ignore(item) abort
|
||||
return a:item.type is# 'E' &&
|
||||
\ a:item.text =~# '\vNo permission to (call|directive|assert) sandboxed'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('prolog', {
|
||||
\ 'name': 'swipl',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': ale#VarFunc('prolog_swipl_executable'),
|
||||
\ 'command_callback': 'ale_linters#prolog#swipl#GetCommand',
|
||||
\ 'callback': 'ale_linters#prolog#swipl#Handle',
|
||||
\})
|
||||
@@ -110,7 +110,6 @@ function! ale_linters#python#flake8#Handle(buffer, lines) abort
|
||||
let l:item = {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'col': l:match[2] + 0,
|
||||
\ 'vcol': 1,
|
||||
\ 'text': l:match[4],
|
||||
\ 'code': l:code,
|
||||
\ 'type': 'W',
|
||||
|
||||
@@ -30,7 +30,7 @@ function! ale_linters#ruby#reek#GetCommand(buffer, version_output) abort
|
||||
\ : ''
|
||||
|
||||
return ale#handlers#ruby#EscapeExecutable(l:executable, 'reek')
|
||||
\ . ' -f json --no-progress --no-color --force-exclusion'
|
||||
\ . ' -f json --no-progress --no-color'
|
||||
\ . l:display_name_args
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
" Description: updated to use stdio
|
||||
|
||||
call ale#Set('ruby_solargraph_executable', 'solargraph')
|
||||
call ale#Set('ruby_solargraph_options', {})
|
||||
|
||||
function! ale_linters#ruby#solargraph#GetCommand(buffer) abort
|
||||
return '%e' . ale#Pad('stdio')
|
||||
@@ -18,5 +17,4 @@ call ale#linter#Define('ruby', {
|
||||
\ 'executable_callback': ale#VarFunc('ruby_solargraph_executable'),
|
||||
\ 'command_callback': 'ale_linters#ruby#solargraph#GetCommand',
|
||||
\ 'project_root_callback': 'ale#ruby#FindProjectRoot',
|
||||
\ 'initialization_options_callback': ale#VarFunc('ruby_solargraph_options'),
|
||||
\})
|
||||
|
||||
@@ -9,8 +9,6 @@ call ale#Set('rust_cargo_check_tests', 0)
|
||||
call ale#Set('rust_cargo_avoid_whole_workspace', 1)
|
||||
call ale#Set('rust_cargo_default_feature_behavior', 'default')
|
||||
call ale#Set('rust_cargo_include_features', '')
|
||||
call ale#Set('rust_cargo_use_clippy', 0)
|
||||
call ale#Set('rust_cargo_clippy_options', '')
|
||||
|
||||
function! ale_linters#rust#cargo#GetCargoExecutable(bufnr) abort
|
||||
if ale#path#FindNearestFile(a:bufnr, 'Cargo.toml') isnot# ''
|
||||
@@ -72,23 +70,14 @@ function! ale_linters#rust#cargo#GetCommand(buffer, version_output) abort
|
||||
let l:default_feature = ''
|
||||
endif
|
||||
|
||||
let l:subcommand = l:use_check ? 'check' : 'build'
|
||||
let l:clippy_options = ''
|
||||
|
||||
if ale#Var(a:buffer, 'rust_cargo_use_clippy')
|
||||
let l:subcommand = 'clippy'
|
||||
let l:clippy_options = ' ' . ale#Var(a:buffer, 'rust_cargo_clippy_options')
|
||||
endif
|
||||
|
||||
return l:nearest_cargo_prefix . 'cargo '
|
||||
\ . l:subcommand
|
||||
\ . (l:use_check ? 'check' : 'build')
|
||||
\ . (l:use_all_targets ? ' --all-targets' : '')
|
||||
\ . (l:use_examples ? ' --examples' : '')
|
||||
\ . (l:use_tests ? ' --tests' : '')
|
||||
\ . ' --frozen --message-format=json -q'
|
||||
\ . l:default_feature
|
||||
\ . l:include_features
|
||||
\ . l:clippy_options
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('rust', {
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
" Author: diartyz <diartyz@gmail.com>
|
||||
|
||||
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_callback': 'ale_linters#scss#stylelint#GetCommand',
|
||||
\ 'command': '%e --stdin-filename %s',
|
||||
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
|
||||
\})
|
||||
|
||||
@@ -8,26 +8,20 @@ function! ale_linters#tex#lacheck#Handle(buffer, lines) abort
|
||||
"
|
||||
" "book.tex", line 37: possible unwanted space at "{"
|
||||
" "book.tex", line 38: missing `\ ' after "etc."
|
||||
let l:pattern = '^"\(.\+\)", line \(\d\+\): \(.\+\)$'
|
||||
let l:pattern = '^".\+", line \(\d\+\): \(.\+\)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
" lacheck follows `\input{}` commands. If the cwd is not the same as the
|
||||
" file in the buffer then it will fail to find the inputed items. We do not
|
||||
" want warnings from those items anyway
|
||||
if !empty(matchstr(l:match[3], '^Could not open ".\+"$'))
|
||||
continue
|
||||
endif
|
||||
|
||||
" lacheck follows `\input{}` commands. We are only interested in
|
||||
" reporting errors for the current buffer only.
|
||||
if empty(matchstr(fnamemodify(l:match[1], ':t'), fnamemodify(bufname(a:buffer), ':t')))
|
||||
if !empty(matchstr(l:match[2], '^Could not open ".\+"$'))
|
||||
continue
|
||||
endif
|
||||
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'text': l:match[3],
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'text': l:match[2],
|
||||
\ 'type': 'W',
|
||||
\})
|
||||
endfor
|
||||
|
||||
115
autoload/ale.vim
115
autoload/ale.vim
@@ -10,7 +10,8 @@ let g:ale_echo_msg_warning_str = get(g:, 'ale_echo_msg_warning_str', 'Warning')
|
||||
let g:ale_linters_ignore = get(g:, 'ale_linters_ignore', {})
|
||||
|
||||
let s:lint_timer = -1
|
||||
let s:getcmdwintype_exists = exists('*getcmdwintype')
|
||||
let s:queued_buffer_number = -1
|
||||
let s:should_lint_file_for_buffer = {}
|
||||
|
||||
" Return 1 if a file is too large for ALE to handle.
|
||||
function! ale#FileTooLarge(buffer) abort
|
||||
@@ -19,6 +20,8 @@ function! ale#FileTooLarge(buffer) abort
|
||||
return l:max > 0 ? (line2byte(line('$') + 1) > l:max) : 0
|
||||
endfunction
|
||||
|
||||
let s:getcmdwintype_exists = exists('*getcmdwintype')
|
||||
|
||||
" A function for checking various conditions whereby ALE just shouldn't
|
||||
" attempt to do anything, say if particular buffer types are open in Vim.
|
||||
function! ale#ShouldDoNothing(buffer) abort
|
||||
@@ -83,44 +86,18 @@ function! ale#ShouldDoNothing(buffer) abort
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:Lint(buffer, should_lint_file, timer_id) abort
|
||||
" Use the filetype from the buffer
|
||||
let l:filetype = getbufvar(a:buffer, '&filetype')
|
||||
let l:linters = ale#linter#Get(l:filetype)
|
||||
|
||||
" Apply ignore lists for linters only if needed.
|
||||
let l:ignore_config = ale#Var(a:buffer, 'linters_ignore')
|
||||
let l:linters = !empty(l:ignore_config)
|
||||
\ ? ale#engine#ignore#Exclude(l:filetype, l:linters, l:ignore_config)
|
||||
\ : l:linters
|
||||
|
||||
" Tell other sources that they can start checking the buffer now.
|
||||
let g:ale_want_results_buffer = a:buffer
|
||||
silent doautocmd <nomodeline> User ALEWantResults
|
||||
unlet! g:ale_want_results_buffer
|
||||
|
||||
" Don't set up buffer data and so on if there are no linters to run.
|
||||
if !has_key(g:ale_buffer_info, a:buffer) && empty(l:linters)
|
||||
return
|
||||
endif
|
||||
|
||||
" Clear lint_file linters, or only run them if the file exists.
|
||||
let l:lint_file = empty(l:linters)
|
||||
\ || (a:should_lint_file && filereadable(expand('#' . a:buffer . ':p')))
|
||||
|
||||
call ale#engine#RunLinters(a:buffer, l:linters, l:lint_file)
|
||||
endfunction
|
||||
|
||||
" (delay, [linting_flag, buffer_number])
|
||||
function! ale#Queue(delay, ...) abort
|
||||
if a:0 > 2
|
||||
throw 'too many arguments!'
|
||||
endif
|
||||
|
||||
let l:buffer = get(a:000, 1, v:null)
|
||||
" Default linting_flag to ''
|
||||
let l:linting_flag = get(a:000, 0, '')
|
||||
let l:buffer = get(a:000, 1, bufnr(''))
|
||||
|
||||
if l:buffer is v:null
|
||||
let l:buffer = bufnr('')
|
||||
if l:linting_flag isnot# '' && l:linting_flag isnot# 'lint_file'
|
||||
throw "linting_flag must be either '' or 'lint_file'"
|
||||
endif
|
||||
|
||||
if type(l:buffer) isnot v:t_number
|
||||
@@ -131,22 +108,78 @@ function! ale#Queue(delay, ...) abort
|
||||
return
|
||||
endif
|
||||
|
||||
" Default linting_flag to ''
|
||||
let l:should_lint_file = get(a:000, 0) is# 'lint_file'
|
||||
" Remember that we want to check files for this buffer.
|
||||
" We will remember this until we finally run the linters, via any event.
|
||||
if l:linting_flag is# 'lint_file'
|
||||
let s:should_lint_file_for_buffer[l:buffer] = 1
|
||||
endif
|
||||
|
||||
if s:lint_timer != -1
|
||||
call timer_stop(s:lint_timer)
|
||||
let s:lint_timer = -1
|
||||
endif
|
||||
|
||||
if a:delay > 0
|
||||
let s:lint_timer = timer_start(
|
||||
\ a:delay,
|
||||
\ function('s:Lint', [l:buffer, l:should_lint_file])
|
||||
\)
|
||||
else
|
||||
call s:Lint(l:buffer, l:should_lint_file, 0)
|
||||
let l:linters = ale#linter#Get(getbufvar(l:buffer, '&filetype'))
|
||||
|
||||
" Don't set up buffer data and so on if there are no linters to run.
|
||||
if empty(l:linters)
|
||||
" If we have some previous buffer data, then stop any jobs currently
|
||||
" running and clear everything.
|
||||
if has_key(g:ale_buffer_info, l:buffer)
|
||||
call ale#engine#RunLinters(l:buffer, [], 1)
|
||||
endif
|
||||
|
||||
return
|
||||
endif
|
||||
|
||||
if a:delay > 0
|
||||
let s:queued_buffer_number = l:buffer
|
||||
let s:lint_timer = timer_start(a:delay, function('ale#Lint'))
|
||||
else
|
||||
call ale#Lint(-1, l:buffer)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale#Lint(...) abort
|
||||
if a:0 > 1
|
||||
" Use the buffer number given as the optional second argument.
|
||||
let l:buffer = a:2
|
||||
elseif a:0 > 0 && a:1 == s:lint_timer
|
||||
" Use the buffer number for the buffer linting was queued for.
|
||||
let l:buffer = s:queued_buffer_number
|
||||
else
|
||||
" Use the current buffer number.
|
||||
let l:buffer = bufnr('')
|
||||
endif
|
||||
|
||||
if ale#ShouldDoNothing(l:buffer)
|
||||
return
|
||||
endif
|
||||
|
||||
" Use the filetype from the buffer
|
||||
let l:filetype = getbufvar(l:buffer, '&filetype')
|
||||
let l:linters = ale#linter#Get(l:filetype)
|
||||
let l:should_lint_file = 0
|
||||
|
||||
" Check if we previously requested checking the file.
|
||||
if has_key(s:should_lint_file_for_buffer, l:buffer)
|
||||
unlet s:should_lint_file_for_buffer[l:buffer]
|
||||
" Lint files if they exist.
|
||||
let l:should_lint_file = filereadable(expand('#' . l:buffer . ':p'))
|
||||
endif
|
||||
|
||||
" Apply ignore lists for linters only if needed.
|
||||
let l:ignore_config = ale#Var(l:buffer, 'linters_ignore')
|
||||
let l:linters = !empty(l:ignore_config)
|
||||
\ ? ale#engine#ignore#Exclude(l:filetype, l:linters, l:ignore_config)
|
||||
\ : l:linters
|
||||
|
||||
call ale#engine#RunLinters(l:buffer, l:linters, l:should_lint_file)
|
||||
endfunction
|
||||
|
||||
" Reset flags indicating that files should be checked for all buffers.
|
||||
function! ale#ResetLintFileMarkers() abort
|
||||
let s:should_lint_file_for_buffer = {}
|
||||
endfunction
|
||||
|
||||
let g:ale_has_override = get(g:, 'ale_has_override', {})
|
||||
|
||||
@@ -85,14 +85,6 @@ function! ale#assert#LSPOptions(expected_options) abort
|
||||
AssertEqual a:expected_options, l:initialization_options
|
||||
endfunction
|
||||
|
||||
function! ale#assert#LSPConfig(expected_config) abort
|
||||
let l:buffer = bufnr('')
|
||||
let l:linter = s:GetLinter()
|
||||
let l:config = ale#lsp_linter#GetConfig(l:buffer, l:linter)
|
||||
|
||||
AssertEqual a:expected_config, l:config
|
||||
endfunction
|
||||
|
||||
function! ale#assert#LSPLanguage(expected_language) abort
|
||||
let l:buffer = bufnr('')
|
||||
let l:linter = s:GetLinter()
|
||||
@@ -155,7 +147,6 @@ function! ale#assert#SetUpLinterTest(filetype, name) abort
|
||||
command! -nargs=+ AssertLinter :call ale#assert#Linter(<args>)
|
||||
command! -nargs=0 AssertLinterNotExecuted :call ale#assert#LinterNotExecuted()
|
||||
command! -nargs=+ AssertLSPOptions :call ale#assert#LSPOptions(<args>)
|
||||
command! -nargs=+ AssertLSPConfig :call ale#assert#LSPConfig(<args>)
|
||||
command! -nargs=+ AssertLSPLanguage :call ale#assert#LSPLanguage(<args>)
|
||||
command! -nargs=+ AssertLSPProject :call ale#assert#LSPProject(<args>)
|
||||
command! -nargs=+ AssertLSPAddress :call ale#assert#LSPAddress(<args>)
|
||||
@@ -181,10 +172,6 @@ function! ale#assert#TearDownLinterTest() abort
|
||||
delcommand AssertLSPOptions
|
||||
endif
|
||||
|
||||
if exists(':AssertLSPConfig')
|
||||
delcommand AssertLSPConfig
|
||||
endif
|
||||
|
||||
if exists(':AssertLSPLanguage')
|
||||
delcommand AssertLSPLanguage
|
||||
endif
|
||||
|
||||
@@ -50,17 +50,12 @@ function! ale#c#ParseCFlags(path_prefix, cflag_line) abort
|
||||
let l:cflags_list = []
|
||||
let l:previous_options = []
|
||||
|
||||
let l:split_lines = split(a:cflag_line, '-')
|
||||
let l:option_index = 0
|
||||
|
||||
while l:option_index < len(l:split_lines)
|
||||
let l:option = l:split_lines[l:option_index]
|
||||
let l:option_index = l:option_index + 1
|
||||
for l:option in split(a:cflag_line, '-')
|
||||
call add(l:previous_options, l:option)
|
||||
" Check if cflag contained a '-' and should not have been splitted
|
||||
let l:option_list = split(l:option, '\zs')
|
||||
|
||||
if len(l:option_list) > 0 && l:option_list[-1] isnot# ' ' && l:option_index < len(l:split_lines)
|
||||
if len(l:option_list) > 0 && l:option_list[-1] isnot# ' '
|
||||
continue
|
||||
endif
|
||||
|
||||
@@ -86,7 +81,7 @@ function! ale#c#ParseCFlags(path_prefix, cflag_line) abort
|
||||
call add(l:cflags_list, l:option)
|
||||
endif
|
||||
endif
|
||||
endwhile
|
||||
endfor
|
||||
|
||||
return join(l:cflags_list, ' ')
|
||||
endfunction
|
||||
|
||||
@@ -52,6 +52,16 @@ function! ale#cursor#TruncatedEcho(original_message) abort
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
function! s:FindItemAtCursor(buffer) abort
|
||||
let l:info = get(g:ale_buffer_info, a:buffer, {})
|
||||
let l:loclist = get(l:info, 'loclist', [])
|
||||
let l:pos = getcurpos()
|
||||
let l:index = ale#util#BinarySearch(l:loclist, a:buffer, l:pos[1], l:pos[2])
|
||||
let l:loc = l:index >= 0 ? l:loclist[l:index] : {}
|
||||
|
||||
return [l:info, l:loc]
|
||||
endfunction
|
||||
|
||||
function! s:StopCursorTimer() abort
|
||||
if s:cursor_timer != -1
|
||||
call timer_stop(s:cursor_timer)
|
||||
@@ -75,7 +85,7 @@ function! ale#cursor#EchoCursorWarning(...) abort
|
||||
return
|
||||
endif
|
||||
|
||||
let [l:info, l:loc] = ale#util#FindItemAtCursor(l:buffer)
|
||||
let [l:info, l:loc] = s:FindItemAtCursor(l:buffer)
|
||||
|
||||
if g:ale_echo_cursor
|
||||
if !empty(l:loc)
|
||||
@@ -159,7 +169,7 @@ function! ale#cursor#ShowCursorDetail() abort
|
||||
|
||||
call s:StopCursorTimer()
|
||||
|
||||
let [l:info, l:loc] = ale#util#FindItemAtCursor(l:buffer)
|
||||
let [l:info, l:loc] = s:FindItemAtCursor(l:buffer)
|
||||
|
||||
if !empty(l:loc)
|
||||
call s:ShowCursorDetailForItem(l:loc, {'stay_here': 0})
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
" Author: Auri <me@aurieh.me>
|
||||
" Description: Functions for integrating with D linters.
|
||||
|
||||
function! ale#d#FindDUBConfig(buffer) abort
|
||||
" Find a DUB configuration file in ancestor paths.
|
||||
" The most DUB-specific names will be tried first.
|
||||
for l:possible_filename in ['dub.sdl', 'dub.json', 'package.json']
|
||||
let l:dub_file = ale#path#FindNearestFile(a:buffer, l:possible_filename)
|
||||
|
||||
if !empty(l:dub_file)
|
||||
return l:dub_file
|
||||
endif
|
||||
endfor
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
@@ -22,14 +22,14 @@ let s:global_variable_list = [
|
||||
\ 'ale_lint_delay',
|
||||
\ 'ale_lint_on_enter',
|
||||
\ 'ale_lint_on_filetype_changed',
|
||||
\ 'ale_lint_on_insert_leave',
|
||||
\ 'ale_lint_on_save',
|
||||
\ 'ale_lint_on_text_changed',
|
||||
\ 'ale_lint_on_insert_leave',
|
||||
\ 'ale_linter_aliases',
|
||||
\ 'ale_linters',
|
||||
\ 'ale_linters_explicit',
|
||||
\ 'ale_list_vertical',
|
||||
\ 'ale_list_window_size',
|
||||
\ 'ale_list_vertical',
|
||||
\ 'ale_loclist_msg_format',
|
||||
\ 'ale_max_buffer_history_size',
|
||||
\ 'ale_max_signs',
|
||||
@@ -52,7 +52,6 @@ let s:global_variable_list = [
|
||||
\ 'ale_statusline_format',
|
||||
\ 'ale_type_map',
|
||||
\ 'ale_use_global_executables',
|
||||
\ 'ale_virtualtext_cursor',
|
||||
\ 'ale_warn_about_trailing_blank_lines',
|
||||
\ 'ale_warn_about_trailing_whitespace',
|
||||
\]
|
||||
@@ -237,11 +236,10 @@ function! ale#debugging#Info() abort
|
||||
endfunction
|
||||
|
||||
function! ale#debugging#InfoToClipboard() abort
|
||||
redir => l:output
|
||||
redir @+>
|
||||
silent call ale#debugging#Info()
|
||||
redir END
|
||||
|
||||
let @+ = l:output
|
||||
call s:Echo('ALEInfo copied to your clipboard')
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -79,7 +79,6 @@ function! ale#engine#InitBufferInfo(buffer) abort
|
||||
let g:ale_buffer_info[a:buffer] = {
|
||||
\ 'job_list': [],
|
||||
\ 'active_linter_list': [],
|
||||
\ 'active_other_sources_list': [],
|
||||
\ 'loclist': [],
|
||||
\ 'temporary_file_list': [],
|
||||
\ 'temporary_directory_list': [],
|
||||
@@ -98,7 +97,6 @@ function! ale#engine#IsCheckingBuffer(buffer) abort
|
||||
let l:info = get(g:ale_buffer_info, a:buffer, {})
|
||||
|
||||
return !empty(get(l:info, 'active_linter_list', []))
|
||||
\ || !empty(get(l:info, 'active_other_sources_list', []))
|
||||
endfunction
|
||||
|
||||
" Register a temporary file to be managed with the ALE engine for
|
||||
@@ -179,27 +177,20 @@ function! s:GatherOutput(job_id, line) abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale#engine#HandleLoclist(linter_name, buffer, loclist, from_other_source) abort
|
||||
function! ale#engine#HandleLoclist(linter_name, buffer, loclist) abort
|
||||
let l:info = get(g:ale_buffer_info, a:buffer, {})
|
||||
|
||||
if empty(l:info)
|
||||
return
|
||||
endif
|
||||
|
||||
if !a:from_other_source
|
||||
" Remove this linter from the list of active linters.
|
||||
" This may have already been done when the job exits.
|
||||
call filter(l:info.active_linter_list, 'v:val isnot# a:linter_name')
|
||||
endif
|
||||
" Remove this linter from the list of active linters.
|
||||
" This may have already been done when the job exits.
|
||||
call filter(l:info.active_linter_list, 'v:val isnot# a:linter_name')
|
||||
|
||||
" Make some adjustments to the loclists to fix common problems, and also
|
||||
" to set default values for loclist items.
|
||||
let l:linter_loclist = ale#engine#FixLocList(
|
||||
\ a:buffer,
|
||||
\ a:linter_name,
|
||||
\ a:from_other_source,
|
||||
\ a:loclist,
|
||||
\)
|
||||
let l:linter_loclist = ale#engine#FixLocList(a:buffer, a:linter_name, a:loclist)
|
||||
|
||||
" Remove previous items for this linter.
|
||||
call filter(l:info.loclist, 'v:val.linter_name isnot# a:linter_name')
|
||||
@@ -272,7 +263,7 @@ function! s:HandleExit(job_id, exit_code) abort
|
||||
let l:loclist = []
|
||||
endtry
|
||||
|
||||
call ale#engine#HandleLoclist(l:linter.name, l:buffer, l:loclist, 0)
|
||||
call ale#engine#HandleLoclist(l:linter.name, l:buffer, l:loclist)
|
||||
endfunction
|
||||
|
||||
function! ale#engine#SetResults(buffer, loclist) abort
|
||||
@@ -304,12 +295,6 @@ function! ale#engine#SetResults(buffer, loclist) abort
|
||||
call ale#cursor#EchoCursorWarning()
|
||||
endif
|
||||
|
||||
if g:ale_virtualtext_cursor
|
||||
" Try and show the warning now.
|
||||
" This will only do something meaningful if we're in normal mode.
|
||||
call ale#virtualtext#ShowCursorWarning()
|
||||
endif
|
||||
|
||||
" Reset the save event marker, used for opening windows, etc.
|
||||
call setbufvar(a:buffer, 'ale_save_event_fired', 0)
|
||||
" Set a marker showing how many times a buffer has been checked.
|
||||
@@ -350,7 +335,7 @@ function! s:RemapItemTypes(type_map, loclist) abort
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! ale#engine#FixLocList(buffer, linter_name, from_other_source, loclist) abort
|
||||
function! ale#engine#FixLocList(buffer, linter_name, loclist) abort
|
||||
let l:bufnr_map = {}
|
||||
let l:new_loclist = []
|
||||
|
||||
@@ -383,10 +368,6 @@ function! ale#engine#FixLocList(buffer, linter_name, from_other_source, loclist)
|
||||
\ 'linter_name': a:linter_name,
|
||||
\}
|
||||
|
||||
if a:from_other_source
|
||||
let l:item.from_other_source = 1
|
||||
endif
|
||||
|
||||
if has_key(l:old_item, 'code')
|
||||
let l:item.code = l:old_item.code
|
||||
endif
|
||||
@@ -710,7 +691,6 @@ endfunction
|
||||
function! s:RemoveProblemsForDisabledLinters(buffer, linters) abort
|
||||
" Figure out which linters are still enabled, and remove
|
||||
" problems for linters which are no longer enabled.
|
||||
" Problems from other sources will be kept.
|
||||
let l:name_map = {}
|
||||
|
||||
for l:linter in a:linters
|
||||
@@ -719,7 +699,7 @@ function! s:RemoveProblemsForDisabledLinters(buffer, linters) abort
|
||||
|
||||
call filter(
|
||||
\ get(g:ale_buffer_info[a:buffer], 'loclist', []),
|
||||
\ 'get(v:val, ''from_other_source'') || get(l:name_map, get(v:val, ''linter_name''))',
|
||||
\ 'get(l:name_map, get(v:val, ''linter_name''))',
|
||||
\)
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ function! ale#events#SaveEvent(buffer) abort
|
||||
call setbufvar(a:buffer, 'ale_save_event_fired', 1)
|
||||
endif
|
||||
|
||||
if ale#Var(a:buffer, 'fix_on_save') && !ale#events#QuitRecently(a:buffer)
|
||||
if ale#Var(a:buffer, 'fix_on_save')
|
||||
let l:will_fix = ale#fix#Fix(a:buffer, 'save_file')
|
||||
let l:should_lint = l:should_lint && !l:will_fix
|
||||
endif
|
||||
@@ -139,14 +139,6 @@ function! ale#events#Init() abort
|
||||
autocmd InsertLeave * if exists('*ale#engine#Cleanup') | call ale#cursor#EchoCursorWarning() | endif
|
||||
endif
|
||||
|
||||
if g:ale_virtualtext_cursor
|
||||
autocmd CursorMoved,CursorHold * if exists('*ale#engine#Cleanup') | call ale#virtualtext#ShowCursorWarningWithDelay() | endif
|
||||
" Look for a warning to echo as soon as we leave Insert mode.
|
||||
" The script's position variable used when moving the cursor will
|
||||
" not be changed here.
|
||||
autocmd InsertLeave * if exists('*ale#engine#Cleanup') | call ale#virtualtext#ShowCursorWarning() | endif
|
||||
endif
|
||||
|
||||
if g:ale_close_preview_on_insert
|
||||
autocmd InsertEnter * if exists('*ale#preview#CloseIfTypeMatches') | call ale#preview#CloseIfTypeMatches('ale-preview') | endif
|
||||
endif
|
||||
|
||||
@@ -56,7 +56,7 @@ let s:default_registry = {
|
||||
\ },
|
||||
\ 'prettier': {
|
||||
\ 'function': 'ale#fixers#prettier#Fix',
|
||||
\ 'suggested_filetypes': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'json5', 'graphql', 'markdown', 'vue', 'html', 'yaml'],
|
||||
\ 'suggested_filetypes': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'json5', 'graphql', 'markdown', 'vue'],
|
||||
\ 'description': 'Apply prettier to a file.',
|
||||
\ },
|
||||
\ 'prettier_eslint': {
|
||||
@@ -250,11 +250,6 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['c', 'cpp', 'cs', 'objc', 'objcpp', 'd', 'java', 'p', 'vala' ],
|
||||
\ 'description': 'Fix C, C++, C#, ObjectiveC, ObjectiveC++, D, Java, Pawn, and VALA files with uncrustify.',
|
||||
\ },
|
||||
\ 'terraform': {
|
||||
\ 'function': 'ale#fixers#terraform#Fix',
|
||||
\ 'suggested_filetypes': ['hcl', 'terraform'],
|
||||
\ 'description': 'Fix tf and hcl files with terraform fmt.',
|
||||
\ },
|
||||
\}
|
||||
|
||||
" Reset the function registry to the default entries.
|
||||
|
||||
@@ -3,17 +3,11 @@
|
||||
|
||||
call ale#Set('haskell_brittany_executable', 'brittany')
|
||||
|
||||
function! ale#fixers#brittany#GetExecutable(buffer) abort
|
||||
function! ale#fixers#brittany#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'haskell_brittany_executable')
|
||||
|
||||
return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'brittany')
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#brittany#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#brittany#GetExecutable(a:buffer)
|
||||
|
||||
return {
|
||||
\ 'command': l:executable
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' --write-mode inplace'
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
|
||||
@@ -7,7 +7,7 @@ function! ale#fixers#hfmt#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'haskell_hfmt_executable')
|
||||
|
||||
return {
|
||||
\ 'command': ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'hfmt')
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' -w'
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
" Author: eborden <evan@evan-borden.com>
|
||||
" 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#handlers#hlint#GetExecutable(a:buffer)
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' --refactor'
|
||||
\ . ' --refactor-options="--inplace"'
|
||||
\ . ' %t',
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
call ale#Set('json_jq_executable', 'jq')
|
||||
call ale#Set('json_jq_options', '')
|
||||
call ale#Set('json_jq_filters', '.')
|
||||
|
||||
function! ale#fixers#jq#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'json_jq_executable')
|
||||
@@ -8,15 +7,9 @@ endfunction
|
||||
|
||||
function! ale#fixers#jq#Fix(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'json_jq_options')
|
||||
let l:filters = ale#Var(a:buffer, 'json_jq_filters')
|
||||
|
||||
if empty(l:filters)
|
||||
return 0
|
||||
endif
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(ale#fixers#jq#GetExecutable(a:buffer))
|
||||
\ . ' ' . l:filters . ' '
|
||||
\ . l:options,
|
||||
\ . ' . ' . l:options,
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -5,14 +5,14 @@ call ale#Set('ocaml_ocamlformat_executable', 'ocamlformat')
|
||||
call ale#Set('ocaml_ocamlformat_options', '')
|
||||
|
||||
function! ale#fixers#ocamlformat#Fix(buffer) abort
|
||||
let l:filename = expand('#' . a:buffer . ':p')
|
||||
let l:executable = ale#Var(a:buffer, 'ocaml_ocamlformat_executable')
|
||||
let l:options = ale#Var(a:buffer, 'ocaml_ocamlformat_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' --name=' . ale#Escape(l:filename)
|
||||
\ . ' -'
|
||||
\ . ' --inplace'
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -58,7 +58,6 @@ function! ale#fixers#prettier#ApplyFixForVersion(buffer, version_output) abort
|
||||
\ 'markdown': 'markdown',
|
||||
\ 'vue': 'vue',
|
||||
\ 'yaml': 'yaml',
|
||||
\ 'html': 'html',
|
||||
\}
|
||||
let l:parser = ''
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ function! ale#fixers#rubocop#GetCommand(buffer) abort
|
||||
return ale#handlers#ruby#EscapeExecutable(l:executable, 'rubocop')
|
||||
\ . (!empty(l:config) ? ' --config ' . ale#Escape(l:config) : '')
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --auto-correct --force-exclusion %t'
|
||||
\ . ' --auto-correct %t'
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#rubocop#Fix(buffer) abort
|
||||
|
||||
@@ -3,17 +3,11 @@
|
||||
"
|
||||
call ale#Set('haskell_stylish_haskell_executable', 'stylish-haskell')
|
||||
|
||||
function! ale#fixers#stylish_haskell#GetExecutable(buffer) abort
|
||||
function! ale#fixers#stylish_haskell#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'haskell_stylish_haskell_executable')
|
||||
|
||||
return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'stylish-haskell')
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#stylish_haskell#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#stylish_haskell#GetExecutable(a:buffer)
|
||||
|
||||
return {
|
||||
\ 'command': l:executable
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' --inplace'
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
" Author: dsifford <dereksifford@gmail.com>
|
||||
" Description: Fixer for terraform and .hcl files
|
||||
|
||||
call ale#Set('terraform_fmt_executable', 'terraform')
|
||||
call ale#Set('terraform_fmt_options', '')
|
||||
|
||||
function! ale#fixers#terraform#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'terraform_fmt_executable')
|
||||
let l:options = ale#Var(a:buffer, 'terraform_fmt_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' fmt'
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' -'
|
||||
\}
|
||||
endfunction
|
||||
@@ -1,17 +0,0 @@
|
||||
scriptencoding utf-8
|
||||
" Author: Ye Jingchen <ye.jingchen@gmail.com>
|
||||
" 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
|
||||
@@ -1,28 +1,13 @@
|
||||
" Author: Matteo Centenaro (bugant) - https://github.com/bugant
|
||||
" Author: Jon Parise <jon@indelible.org>
|
||||
" Description: Functions for working with Elixir projects
|
||||
"
|
||||
" Description: find the root directory for an elixir project that uses mix
|
||||
|
||||
" Find the root directory for an elixir project that uses mix.
|
||||
function! ale#handlers#elixir#FindMixProjectRoot(buffer) abort
|
||||
let l:mix_file = ale#path#FindNearestFile(a:buffer, 'mix.exs')
|
||||
|
||||
if !empty(l:mix_file)
|
||||
return fnamemodify(l:mix_file, ':p:h')
|
||||
return fnamemodify(l:mix_file, ':p:h')
|
||||
endif
|
||||
|
||||
return '.'
|
||||
endfunction
|
||||
|
||||
" Similar to ale#handlers#elixir#FindMixProjectRoot but also continue the
|
||||
" search upward for a potential umbrella project root. If an umbrella root
|
||||
" does not exist, the initial project root will be returned.
|
||||
function! ale#handlers#elixir#FindMixUmbrellaRoot(buffer) abort
|
||||
let l:app_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer)
|
||||
let l:umbrella_root = fnamemodify(l:app_root, ':h:h')
|
||||
|
||||
if filereadable(l:umbrella_root . '/mix.exs')
|
||||
return l:umbrella_root
|
||||
endif
|
||||
|
||||
return l:app_root
|
||||
endfunction
|
||||
|
||||
@@ -121,7 +121,7 @@ function! ale#handlers#eslint#Handle(buffer, lines) abort
|
||||
let l:text = l:match[3]
|
||||
|
||||
if ale#Var(a:buffer, 'javascript_eslint_suppress_eslintignore')
|
||||
if l:text =~# '^File ignored'
|
||||
if l:text is# 'File ignored because of a matching ignore pattern. Use "--no-ignore" to override.'
|
||||
continue
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" Description: Error handling for the format GHC outputs.
|
||||
"
|
||||
function! ale#handlers#haskell#GetStackExecutable(bufnr) abort
|
||||
if ale#path#FindNearestFile(a:bufnr, 'stack.yaml') isnot# ''
|
||||
return 'stack'
|
||||
endif
|
||||
|
||||
" if there is no stack.yaml file, we don't use stack even if it exists,
|
||||
" so we return '', because executable('') apparently always fails
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
" Remember the directory used for temporary files for Vim.
|
||||
let s:temp_dir = fnamemodify(ale#util#Tempname(), ':h')
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
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
|
||||
@@ -1,8 +0,0 @@
|
||||
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
|
||||
@@ -7,10 +7,6 @@ if !exists('g:ale_rust_ignore_error_codes')
|
||||
let g:ale_rust_ignore_error_codes = []
|
||||
endif
|
||||
|
||||
if !exists('g:ale_rust_ignore_secondary_spans')
|
||||
let g:ale_rust_ignore_secondary_spans = 0
|
||||
endif
|
||||
|
||||
function! s:FindSpan(buffer, span) abort
|
||||
if ale#path#IsBufferPath(a:buffer, a:span.file_name) || a:span.file_name is# '<anon>'
|
||||
return a:span
|
||||
@@ -51,10 +47,6 @@ function! ale#handlers#rust#HandleRustErrors(buffer, lines) abort
|
||||
for l:root_span in l:error.spans
|
||||
let l:span = s:FindSpan(a:buffer, l:root_span)
|
||||
|
||||
if ale#Var(a:buffer, 'rust_ignore_secondary_spans') && !get(l:span, 'is_primary', 1)
|
||||
continue
|
||||
endif
|
||||
|
||||
if !empty(l:span)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:span.line_start,
|
||||
|
||||
@@ -16,7 +16,6 @@ let s:default_ale_linter_aliases = {
|
||||
\ 'systemverilog': 'verilog',
|
||||
\ 'verilog_systemverilog': ['verilog_systemverilog', 'verilog'],
|
||||
\ 'vimwiki': 'markdown',
|
||||
\ 'vue': ['vue', 'javascript'],
|
||||
\ 'zsh': 'sh',
|
||||
\}
|
||||
|
||||
@@ -32,17 +31,14 @@ let s:default_ale_linter_aliases = {
|
||||
" NOTE: Update the g:ale_linters documentation when modifying this.
|
||||
let s:default_ale_linters = {
|
||||
\ 'csh': ['shell'],
|
||||
\ 'elixir': ['credo', 'dialyxir', 'dogma', 'elixir-ls'],
|
||||
\ 'go': ['gofmt', 'golint', 'go vet'],
|
||||
\ 'hack': ['hack'],
|
||||
\ 'help': [],
|
||||
\ 'perl': ['perlcritic'],
|
||||
\ 'perl6': [],
|
||||
\ 'python': ['flake8', 'mypy', 'pylint'],
|
||||
\ 'rust': ['cargo'],
|
||||
\ 'spec': [],
|
||||
\ 'text': [],
|
||||
\ 'vue': ['eslint', 'vls'],
|
||||
\ 'zsh': ['shell'],
|
||||
\}
|
||||
|
||||
@@ -259,24 +255,6 @@ function! ale#linter#PreProcess(filetype, linter) abort
|
||||
elseif has_key(a:linter, 'initialization_options')
|
||||
let l:obj.initialization_options = a:linter.initialization_options
|
||||
endif
|
||||
|
||||
if has_key(a:linter, 'lsp_config_callback')
|
||||
if has_key(a:linter, 'lsp_config')
|
||||
throw 'Only one of `lsp_config` or `lsp_config_callback` should be set'
|
||||
endif
|
||||
|
||||
let l:obj.lsp_config_callback = a:linter.lsp_config_callback
|
||||
|
||||
if !s:IsCallback(l:obj.lsp_config_callback)
|
||||
throw '`lsp_config_callback` must be a callback if defined'
|
||||
endif
|
||||
elseif has_key(a:linter, 'lsp_config')
|
||||
if type(a:linter.lsp_config) isnot v:t_dict
|
||||
throw '`lsp_config` must be a Dictionary'
|
||||
endif
|
||||
|
||||
let l:obj.lsp_config = a:linter.lsp_config
|
||||
endif
|
||||
endif
|
||||
|
||||
let l:obj.output_stream = get(a:linter, 'output_stream', 'stdout')
|
||||
@@ -359,9 +337,8 @@ endfunction
|
||||
function! s:GetAliasedFiletype(original_filetype) abort
|
||||
let l:buffer_aliases = get(b:, 'ale_linter_aliases', {})
|
||||
|
||||
" b:ale_linter_aliases can be set to a List or String.
|
||||
" b:ale_linter_aliases can be set to a List.
|
||||
if type(l:buffer_aliases) is v:t_list
|
||||
\|| type(l:buffer_aliases) is v:t_string
|
||||
return l:buffer_aliases
|
||||
endif
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ function! ale#lsp#Register(executable_or_address, project, init_options) abort
|
||||
" initialized: 0 if the connection is ready, 1 otherwise.
|
||||
" init_request_id: The ID for the init request.
|
||||
" init_options: Options to send to the server.
|
||||
" config: Configuration settings to send to the server.
|
||||
" callback_list: A list of callbacks for handling LSP responses.
|
||||
" message_queue: Messages queued for sending to callbacks.
|
||||
" capabilities_queue: The list of callbacks to call with capabilities.
|
||||
@@ -33,7 +32,6 @@ function! ale#lsp#Register(executable_or_address, project, init_options) abort
|
||||
\ 'initialized': 0,
|
||||
\ 'init_request_id': 0,
|
||||
\ 'init_options': a:init_options,
|
||||
\ 'config': {},
|
||||
\ 'callback_list': [],
|
||||
\ 'message_queue': [],
|
||||
\ 'capabilities_queue': [],
|
||||
@@ -43,7 +41,6 @@ function! ale#lsp#Register(executable_or_address, project, init_options) abort
|
||||
\ 'completion': 0,
|
||||
\ 'completion_trigger_characters': [],
|
||||
\ 'definition': 0,
|
||||
\ 'symbol_search': 0,
|
||||
\ },
|
||||
\}
|
||||
endif
|
||||
@@ -206,31 +203,8 @@ function! s:UpdateCapabilities(conn, capabilities) abort
|
||||
if get(a:capabilities, 'definitionProvider') is v:true
|
||||
let a:conn.capabilities.definition = 1
|
||||
endif
|
||||
|
||||
if get(a:capabilities, 'workspaceSymbolProvider') is v:true
|
||||
let a:conn.capabilities.symbol_search = 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Update a connection's configuration dictionary and notify LSP servers
|
||||
" of any changes since the last update. Returns 1 if a configuration
|
||||
" update was sent; otherwise 0 will be returned.
|
||||
function! ale#lsp#UpdateConfig(conn_id, buffer, config) abort
|
||||
let l:conn = get(s:connections, a:conn_id, {})
|
||||
|
||||
if empty(l:conn) || a:config ==# l:conn.config " no-custom-checks
|
||||
return 0
|
||||
endif
|
||||
|
||||
let l:conn.config = a:config
|
||||
let l:message = ale#lsp#message#DidChangeConfiguration(a:buffer, a:config)
|
||||
|
||||
call ale#lsp#Send(a:conn_id, l:message)
|
||||
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
|
||||
function! ale#lsp#HandleInitResponse(conn, response) abort
|
||||
if get(a:response, 'method', '') is# 'initialize'
|
||||
let a:conn.initialized = 1
|
||||
@@ -311,7 +285,6 @@ function! ale#lsp#MarkConnectionAsTsserver(conn_id) abort
|
||||
let l:conn.capabilities.completion = 1
|
||||
let l:conn.capabilities.completion_trigger_characters = ['.']
|
||||
let l:conn.capabilities.definition = 1
|
||||
let l:conn.capabilities.symbol_search = 1
|
||||
endfunction
|
||||
|
||||
" Start a program for LSP servers.
|
||||
|
||||
@@ -130,12 +130,6 @@ function! ale#lsp#message#References(buffer, line, column) abort
|
||||
\}]
|
||||
endfunction
|
||||
|
||||
function! ale#lsp#message#Symbol(query) abort
|
||||
return [0, 'workspace/symbol', {
|
||||
\ 'query': a:query,
|
||||
\}]
|
||||
endfunction
|
||||
|
||||
function! ale#lsp#message#Hover(buffer, line, column) abort
|
||||
return [0, 'textDocument/hover', {
|
||||
\ 'textDocument': {
|
||||
@@ -144,9 +138,3 @@ function! ale#lsp#message#Hover(buffer, line, column) abort
|
||||
\ 'position': {'line': a:line - 1, 'character': a:column},
|
||||
\}]
|
||||
endfunction
|
||||
|
||||
function! ale#lsp#message#DidChangeConfiguration(buffer, config) abort
|
||||
return [0, 'workspace/didChangeConfiguration', {
|
||||
\ 'settings': a:config,
|
||||
\}]
|
||||
endfunction
|
||||
|
||||
@@ -17,7 +17,7 @@ function! ale#lsp#reset#StopAllLSPs() abort
|
||||
|
||||
for l:linter in ale#linter#Get(getbufvar(l:buffer, '&filetype'))
|
||||
if !empty(l:linter.lsp)
|
||||
call ale#engine#HandleLoclist(l:linter.name, l:buffer, [], 0)
|
||||
call ale#engine#HandleLoclist(l:linter.name, l:buffer, [])
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
|
||||
@@ -66,10 +66,6 @@ function! ale#lsp#response#ReadDiagnostics(response) abort
|
||||
let l:loclist_item.detail = l:diagnostic.message . "\n" . join(l:related, "\n")
|
||||
endif
|
||||
|
||||
if has_key(l:diagnostic, 'source')
|
||||
let l:loclist_item.detail = printf('[%s] %s', l:diagnostic.source, l:diagnostic.message)
|
||||
endif
|
||||
|
||||
call add(l:loclist, l:loclist_item)
|
||||
endfor
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ function! s:HandleLSPDiagnostics(conn_id, response) abort
|
||||
|
||||
let l:loclist = ale#lsp#response#ReadDiagnostics(a:response)
|
||||
|
||||
call ale#engine#HandleLoclist(l:linter_name, l:buffer, l:loclist, 0)
|
||||
call ale#engine#HandleLoclist(l:linter_name, l:buffer, l:loclist)
|
||||
endfunction
|
||||
|
||||
function! s:HandleTSServerDiagnostics(response, error_type) abort
|
||||
@@ -81,7 +81,7 @@ function! s:HandleTSServerDiagnostics(response, error_type) abort
|
||||
let l:loclist = get(l:info, 'semantic_loclist', [])
|
||||
\ + get(l:info, 'syntax_loclist', [])
|
||||
|
||||
call ale#engine#HandleLoclist(l:linter_name, l:buffer, l:loclist, 0)
|
||||
call ale#engine#HandleLoclist(l:linter_name, l:buffer, l:loclist)
|
||||
endfunction
|
||||
|
||||
function! s:HandleLSPErrorMessage(linter_name, response) abort
|
||||
@@ -140,18 +140,6 @@ function! ale#lsp_linter#GetOptions(buffer, linter) abort
|
||||
return l:initialization_options
|
||||
endfunction
|
||||
|
||||
function! ale#lsp_linter#GetConfig(buffer, linter) abort
|
||||
let l:config = {}
|
||||
|
||||
if has_key(a:linter, 'lsp_config_callback')
|
||||
let l:config = ale#util#GetFunction(a:linter.lsp_config_callback)(a:buffer)
|
||||
elseif has_key(a:linter, 'lsp_config')
|
||||
let l:config = a:linter.lsp_config
|
||||
endif
|
||||
|
||||
return l:config
|
||||
endfunction
|
||||
|
||||
" Given a buffer, an LSP linter, start up an LSP linter and get ready to
|
||||
" receive messages for the document.
|
||||
function! ale#lsp_linter#StartLSP(buffer, linter) abort
|
||||
@@ -200,7 +188,6 @@ function! ale#lsp_linter#StartLSP(buffer, linter) abort
|
||||
call ale#lsp#MarkConnectionAsTsserver(l:conn_id)
|
||||
endif
|
||||
|
||||
let l:config = ale#lsp_linter#GetConfig(a:buffer, a:linter)
|
||||
let l:language_id = ale#util#GetFunction(a:linter.language_callback)(a:buffer)
|
||||
|
||||
let l:details = {
|
||||
@@ -211,8 +198,6 @@ function! ale#lsp_linter#StartLSP(buffer, linter) abort
|
||||
\ 'language_id': l:language_id,
|
||||
\}
|
||||
|
||||
call ale#lsp#UpdateConfig(l:conn_id, a:buffer, l:config)
|
||||
|
||||
if ale#lsp#OpenDocument(l:conn_id, a:buffer, l:language_id)
|
||||
if g:ale_history_enabled && !empty(l:command)
|
||||
call ale#history#Add(a:buffer, 'started', l:conn_id, l:command)
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
" Tell ALE that another source has started checking a buffer.
|
||||
function! ale#other_source#StartChecking(buffer, linter_name) abort
|
||||
call ale#engine#InitBufferInfo(a:buffer)
|
||||
let l:list = g:ale_buffer_info[a:buffer].active_other_sources_list
|
||||
|
||||
call add(l:list, a:linter_name)
|
||||
call uniq(sort(l:list))
|
||||
endfunction
|
||||
|
||||
" Show some results, and stop checking a buffer.
|
||||
" To clear results or cancel checking a buffer, an empty List can be given.
|
||||
function! ale#other_source#ShowResults(buffer, linter_name, loclist) abort
|
||||
call ale#engine#InitBufferInfo(a:buffer)
|
||||
let l:info = g:ale_buffer_info[a:buffer]
|
||||
|
||||
" Remove this linter name from the active list.
|
||||
let l:list = l:info.active_other_sources_list
|
||||
call filter(l:list, 'v:val isnot# a:linter_name')
|
||||
|
||||
call ale#engine#HandleLoclist(a:linter_name, a:buffer, a:loclist, 1)
|
||||
endfunction
|
||||
@@ -46,14 +46,11 @@ function! ale#preview#ShowSelection(item_list) abort
|
||||
|
||||
" Create lines to display to users.
|
||||
for l:item in a:item_list
|
||||
let l:match = get(l:item, 'match', '')
|
||||
|
||||
call add(
|
||||
\ l:lines,
|
||||
\ l:item.filename
|
||||
\ . ':' . l:item.line
|
||||
\ . ':' . l:item.column
|
||||
\ . (!empty(l:match) ? ' ' . l:match : ''),
|
||||
\ . ':' . l:item.column,
|
||||
\)
|
||||
endfor
|
||||
|
||||
|
||||
@@ -1,109 +0,0 @@
|
||||
let s:symbol_map = {}
|
||||
|
||||
" Used to get the symbol map in tests.
|
||||
function! ale#symbol#GetMap() abort
|
||||
return deepcopy(s:symbol_map)
|
||||
endfunction
|
||||
|
||||
" Used to set the symbol map in tests.
|
||||
function! ale#symbol#SetMap(map) abort
|
||||
let s:symbol_map = a:map
|
||||
endfunction
|
||||
|
||||
function! ale#symbol#ClearLSPData() abort
|
||||
let s:symbol_map = {}
|
||||
endfunction
|
||||
|
||||
function! ale#symbol#HandleLSPResponse(conn_id, response) abort
|
||||
if has_key(a:response, 'id')
|
||||
\&& has_key(s:symbol_map, a:response.id)
|
||||
let l:options = remove(s:symbol_map, a:response.id)
|
||||
|
||||
let l:result = get(a:response, 'result', v:null)
|
||||
let l:item_list = []
|
||||
|
||||
if type(l:result) is v:t_list
|
||||
" Each item looks like this:
|
||||
" {
|
||||
" 'name': 'foo',
|
||||
" 'kind': 123,
|
||||
" 'deprecated': v:false,
|
||||
" 'location': {
|
||||
" 'uri': 'file://...',
|
||||
" 'range': {
|
||||
" 'start': {'line': 0, 'character': 0},
|
||||
" 'end': {'line': 0, 'character': 0},
|
||||
" },
|
||||
" },
|
||||
" 'containerName': 'SomeContainer',
|
||||
" }
|
||||
for l:response_item in l:result
|
||||
let l:location = l:response_item.location
|
||||
|
||||
call add(l:item_list, {
|
||||
\ 'filename': ale#path#FromURI(l:location.uri),
|
||||
\ 'line': l:location.range.start.line + 1,
|
||||
\ 'column': l:location.range.start.character + 1,
|
||||
\ 'match': l:response_item.name,
|
||||
\})
|
||||
endfor
|
||||
endif
|
||||
|
||||
if empty(l:item_list)
|
||||
call ale#util#Execute('echom ''No symbols found.''')
|
||||
else
|
||||
call ale#preview#ShowSelection(l:item_list)
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:OnReady(linter, lsp_details, query, ...) abort
|
||||
let l:buffer = a:lsp_details.buffer
|
||||
|
||||
" If we already made a request, stop here.
|
||||
if getbufvar(l:buffer, 'ale_symbol_request_made', 0)
|
||||
return
|
||||
endif
|
||||
|
||||
let l:id = a:lsp_details.connection_id
|
||||
|
||||
let l:Callback = function('ale#symbol#HandleLSPResponse')
|
||||
call ale#lsp#RegisterCallback(l:id, l:Callback)
|
||||
|
||||
let l:message = ale#lsp#message#Symbol(a:query)
|
||||
let l:request_id = ale#lsp#Send(l:id, l:message)
|
||||
|
||||
call setbufvar(l:buffer, 'ale_symbol_request_made', 1)
|
||||
let s:symbol_map[l:request_id] = {
|
||||
\ 'buffer': l:buffer,
|
||||
\}
|
||||
endfunction
|
||||
|
||||
function! s:Search(linter, buffer, query) abort
|
||||
let l:lsp_details = ale#lsp_linter#StartLSP(a:buffer, a:linter)
|
||||
|
||||
if !empty(l:lsp_details)
|
||||
call ale#lsp#WaitForCapability(
|
||||
\ l:lsp_details.connection_id,
|
||||
\ 'symbol_search',
|
||||
\ function('s:OnReady', [a:linter, l:lsp_details, a:query]),
|
||||
\)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale#symbol#Search(query) abort
|
||||
if type(a:query) isnot v:t_string || empty(a:query)
|
||||
throw 'A non-empty string must be provided!'
|
||||
endif
|
||||
|
||||
let l:buffer = bufnr('')
|
||||
|
||||
" Set a flag so we only make one request.
|
||||
call setbufvar(l:buffer, 'ale_symbol_request_made', 0)
|
||||
|
||||
for l:linter in ale#linter#Get(getbufvar(l:buffer, '&filetype'))
|
||||
if !empty(l:linter.lsp) && l:linter.lsp isnot# 'tsserver'
|
||||
call s:Search(l:linter, l:buffer, a:query)
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
@@ -452,14 +452,3 @@ function! ale#util#Col(str, chr) abort
|
||||
|
||||
return strlen(join(split(a:str, '\zs')[0:a:chr - 2], '')) + 1
|
||||
endfunction
|
||||
|
||||
function! ale#util#FindItemAtCursor(buffer) abort
|
||||
let l:info = get(g:ale_buffer_info, a:buffer, {})
|
||||
let l:loclist = get(l:info, 'loclist', [])
|
||||
let l:pos = getcurpos()
|
||||
let l:index = ale#util#BinarySearch(l:loclist, a:buffer, l:pos[1], l:pos[2])
|
||||
let l:loc = l:index >= 0 ? l:loclist[l:index] : {}
|
||||
|
||||
return [l:info, l:loc]
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,136 +0,0 @@
|
||||
scriptencoding utf-8
|
||||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" Author: Luan Santos <cfcluan@gmail.com>
|
||||
" Description: Shows lint message for the current line as virtualtext, if any
|
||||
|
||||
" Controls the milliseconds delay before showing a message.
|
||||
let g:ale_virtualtext_delay = get(g:, 'ale_virtualtext_delay', 10)
|
||||
let s:cursor_timer = -1
|
||||
let s:last_pos = [0, 0, 0]
|
||||
|
||||
if has('nvim-0.3.2')
|
||||
let s:ns_id = nvim_create_namespace('ale')
|
||||
endif
|
||||
|
||||
if !hlexists('ALEVirtualTextError')
|
||||
highlight link ALEVirtualTextError ALEError
|
||||
endif
|
||||
|
||||
if !hlexists('ALEVirtualTextStyleError')
|
||||
highlight link ALEVirtualTextStyleError ALEVirtualTextError
|
||||
endif
|
||||
|
||||
if !hlexists('ALEVirtualTextWarning')
|
||||
highlight link ALEVirtualTextWarning ALEWarning
|
||||
endif
|
||||
|
||||
if !hlexists('ALEVirtualTextStyleWarning')
|
||||
highlight link ALEVirtualTextStyleWarning ALEVirtualTextWarning
|
||||
endif
|
||||
|
||||
if !hlexists('ALEVirtualTextInfo')
|
||||
highlight link ALEVirtualTextInfo ALEVirtualTextWarning
|
||||
endif
|
||||
|
||||
function! ale#virtualtext#Clear() abort
|
||||
if !has('nvim-0.3.2')
|
||||
return
|
||||
endif
|
||||
|
||||
let l:buffer = bufnr('')
|
||||
|
||||
call nvim_buf_clear_highlight(l:buffer, s:ns_id, 0, -1)
|
||||
endfunction
|
||||
|
||||
function! ale#virtualtext#ShowMessage(message, hl_group) abort
|
||||
if !has('nvim-0.3.2')
|
||||
return
|
||||
endif
|
||||
|
||||
let l:cursor_position = getcurpos()
|
||||
let l:line = line('.')
|
||||
let l:buffer = bufnr('')
|
||||
let l:prefix = get(g:, 'ale_virtualtext_prefix', '> ')
|
||||
|
||||
call nvim_buf_set_virtual_text(l:buffer, s:ns_id, l:line-1, [[l:prefix.a:message, a:hl_group]], {})
|
||||
endfunction
|
||||
|
||||
function! s:StopCursorTimer() abort
|
||||
if s:cursor_timer != -1
|
||||
call timer_stop(s:cursor_timer)
|
||||
let s:cursor_timer = -1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale#virtualtext#ShowCursorWarning(...) abort
|
||||
if !g:ale_virtualtext_cursor
|
||||
return
|
||||
endif
|
||||
|
||||
let l:buffer = bufnr('')
|
||||
|
||||
if mode(1) isnot# 'n'
|
||||
return
|
||||
endif
|
||||
|
||||
if ale#ShouldDoNothing(l:buffer)
|
||||
return
|
||||
endif
|
||||
|
||||
let [l:info, l:loc] = ale#util#FindItemAtCursor(l:buffer)
|
||||
|
||||
call ale#virtualtext#Clear()
|
||||
|
||||
if !empty(l:loc)
|
||||
let l:msg = get(l:loc, 'detail', l:loc.text)
|
||||
let l:hl_group = 'ALEVirtualTextInfo'
|
||||
let l:type = get(l:loc, 'type', 'E')
|
||||
|
||||
if l:type is# 'E'
|
||||
if get(l:loc, 'sub_type', '') is# 'style'
|
||||
let l:hl_group = 'ALEVirtualTextStyleError'
|
||||
else
|
||||
let l:hl_group = 'ALEVirtualTextError'
|
||||
endif
|
||||
elseif l:type is# 'W'
|
||||
if get(l:loc, 'sub_type', '') is# 'style'
|
||||
let l:hl_group = 'ALEVirtualTextStyleWarning'
|
||||
else
|
||||
let l:hl_group = 'ALEVirtualTextWarning'
|
||||
endif
|
||||
endif
|
||||
|
||||
call ale#virtualtext#ShowMessage(l:msg, l:hl_group)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale#virtualtext#ShowCursorWarningWithDelay() abort
|
||||
let l:buffer = bufnr('')
|
||||
|
||||
if !g:ale_virtualtext_cursor
|
||||
return
|
||||
endif
|
||||
|
||||
if mode(1) isnot# 'n'
|
||||
return
|
||||
endif
|
||||
|
||||
call s:StopCursorTimer()
|
||||
|
||||
let l:pos = getcurpos()[0:2]
|
||||
|
||||
" Check the current buffer, line, and column number against the last
|
||||
" recorded position. If the position has actually changed, *then*
|
||||
" we should show something. Otherwise we can end up doing processing
|
||||
" the show message far too frequently.
|
||||
if l:pos != s:last_pos
|
||||
let l:delay = ale#Var(l:buffer, 'virtualtext_delay')
|
||||
|
||||
let s:last_pos = l:pos
|
||||
let s:cursor_timer = timer_start(
|
||||
\ l:delay,
|
||||
\ function('ale#virtualtext#ShowCursorWarning')
|
||||
\)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
===============================================================================
|
||||
ALE Ada Integration *ale-ada-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
gcc *ale-ada-gcc*
|
||||
|
||||
g:ale_ada_gcc_executable *g:ale_ada_gcc_executable*
|
||||
*b:ale_ada_gcc_executable*
|
||||
Type: |String|
|
||||
Default: `'gcc'`
|
||||
|
||||
This variable can be changed to use a different executable for gcc.
|
||||
|
||||
|
||||
g:ale_ada_gcc_options *g:ale_ada_gcc_options*
|
||||
*b:ale_ada_gcc_options*
|
||||
Type: |String|
|
||||
Default: `'-gnatwa -gnatq'`
|
||||
|
||||
This variable can be set to pass additional options to gcc.
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
@@ -1,16 +0,0 @@
|
||||
===============================================================================
|
||||
ALE Ansible Integration *ale-ansible-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
ansible-lint *ale-ansible-ansible-lint*
|
||||
|
||||
g:ale_ansible_ansible_lint_executable *g:ale_ansible_ansible_lint_executable*
|
||||
*b:ale_ansible_ansible_lint_executable*
|
||||
Type: |String|
|
||||
Default: `'ansible-lint'`
|
||||
|
||||
This variable can be changed to modify the executable used for ansible-lint.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
@@ -130,7 +130,7 @@ overrides |g:ale_c_build_dir_names|.
|
||||
g:ale_c_clangtidy_checks *g:ale_c_clangtidy_checks*
|
||||
*b:ale_c_clangtidy_checks*
|
||||
Type: |List|
|
||||
Default: `[]`
|
||||
Default: `['*']`
|
||||
|
||||
The checks to enable for clang-tidy with the `-checks` argument.
|
||||
|
||||
@@ -281,36 +281,5 @@ g:ale_c_uncrustify_options *g:ale_c_uncrustify_options*
|
||||
This variable can be change to modify flags given to uncrustify.
|
||||
|
||||
|
||||
===============================================================================
|
||||
ccls *ale-c-ccls*
|
||||
|
||||
g:ale_c_ccls_executable *g:ale_c_ccls_executable*
|
||||
*b:ale_c_ccls_executable*
|
||||
Type: |String|
|
||||
Default: `'ccls'`
|
||||
|
||||
This variable can be changed to use a different executable for ccls.
|
||||
|
||||
|
||||
g:ale_c_ccls_init_options *g:ale_c_ccls_init_options*
|
||||
*b:ale_c_ccls_init_options*
|
||||
Type: |Dictionary|
|
||||
Default: `{}`
|
||||
|
||||
This variable can be changed to customize ccls initialization options.
|
||||
Example: >
|
||||
{
|
||||
\ 'cacheDirectory': '/tmp/ccls',
|
||||
\ 'cacheFormat': 'binary',
|
||||
\ 'diagnostics': {
|
||||
\ 'onOpen': 0,
|
||||
\ 'opChange': 1000,
|
||||
\ },
|
||||
\ }
|
||||
<
|
||||
Visit https://github.com/MaskRay/ccls/wiki/Initialization-options for all
|
||||
available options and explanations.
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
||||
@@ -103,7 +103,7 @@ overrides |g:ale_c_build_dir_names|.
|
||||
g:ale_cpp_clangtidy_checks *g:ale_cpp_clangtidy_checks*
|
||||
*b:ale_cpp_clangtidy_checks*
|
||||
Type: |List|
|
||||
Default: `[]`
|
||||
Default: `['*']`
|
||||
|
||||
The checks to enable for clang-tidy with the `-checks` argument.
|
||||
|
||||
@@ -279,36 +279,5 @@ uncrustify *ale-cpp-uncrustify*
|
||||
See |ale-c-uncrustify| for information about the available options.
|
||||
|
||||
|
||||
===============================================================================
|
||||
ccls *ale-cpp-ccls*
|
||||
|
||||
g:ale_cpp_ccls_executable *g:ale_cpp_ccls_executable*
|
||||
*b:ale_cpp_ccls_executable*
|
||||
Type: |String|
|
||||
Default: `'ccls'`
|
||||
|
||||
This variable can be changed to use a different executable for ccls.
|
||||
|
||||
|
||||
g:ale_cpp_ccls_init_options *g:ale_cpp_ccls_init_options*
|
||||
*b:ale_cpp_ccls_init_options*
|
||||
Type: |Dictionary|
|
||||
Default: `{}`
|
||||
|
||||
This variable can be changed to customize ccls initialization options.
|
||||
Example: >
|
||||
{
|
||||
\ 'cacheDirectory': '/tmp/ccls',
|
||||
\ 'cacheFormat': 'binary',
|
||||
\ 'diagnostics': {
|
||||
\ 'onOpen': 0,
|
||||
\ 'opChange': 1000,
|
||||
\ },
|
||||
\ }
|
||||
<
|
||||
Visit https://github.com/MaskRay/ccls/wiki/Initialization-options for all
|
||||
available options and explanations.
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
ALE C# Integration *ale-cs-options*
|
||||
|
||||
|
||||
In addition to the linters that are provided with ALE, C# code can be checked
|
||||
with the OmniSharp plugin. See here: https://github.com/OmniSharp/omnisharp-vim
|
||||
|
||||
|
||||
===============================================================================
|
||||
mcs *ale-cs-mcs*
|
||||
|
||||
|
||||
@@ -2,17 +2,6 @@
|
||||
ALE D Integration *ale-d-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
dls *ale-d-dls*
|
||||
|
||||
g:ale_d_dls_executable *g:ale_d_dls_executable*
|
||||
*b:ale_d_dls_executable*
|
||||
Type: |String|
|
||||
Default: `dls`
|
||||
|
||||
See |ale-integrations-local-executables|
|
||||
|
||||
|
||||
===============================================================================
|
||||
uncrustify *ale-d-uncrustify*
|
||||
|
||||
|
||||
@@ -306,7 +306,6 @@ given the above setup are as follows.
|
||||
`AssertLinterNotExecuted` - Check that linters will not be executed.
|
||||
`AssertLSPLanguage language` - Check the language given to an LSP server.
|
||||
`AssertLSPOptions options_dict` - Check the options given to an LSP server.
|
||||
`AssertLSPConfig config_dict` - Check the config given to an LSP server.
|
||||
`AssertLSPProject project_root` - Check the root given to an LSP server.
|
||||
`AssertLSPAddress address` - Check the address to an LSP server.
|
||||
|
||||
|
||||
@@ -2,29 +2,6 @@
|
||||
ALE Dockerfile Integration *ale-dockerfile-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
dockerfile_lint *ale-dockerfile-dockerfile_lint*
|
||||
|
||||
g:ale_dockerfile_dockerfile_lint_executable
|
||||
*g:ale_dockerfile_dockerfile_lint_executable*
|
||||
*b:ale_dockerfile_dockerfile_lint_executable*
|
||||
Type: |String|
|
||||
Default: `'dockerfile_lint'`
|
||||
|
||||
This variable can be changed to specify the executable used to run
|
||||
dockerfile_lint.
|
||||
|
||||
|
||||
g:ale_dockerfile_dockerfile_lint_options
|
||||
*g:ale_dockerfile_dockerfile_lint_options*
|
||||
*b:ale_dockerfile_dockerfile_lint_options*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be changed to add additional command-line arguments to
|
||||
the dockerfile lint invocation - like custom rule file definitions.
|
||||
|
||||
|
||||
===============================================================================
|
||||
hadolint *ale-dockerfile-hadolint*
|
||||
|
||||
|
||||
@@ -5,11 +5,6 @@ ALE Elixir Integration *ale-elixir-options*
|
||||
===============================================================================
|
||||
mix *ale-elixir-mix*
|
||||
|
||||
|
||||
The `mix` linter is disabled by default, as it can bee too expensive to run.
|
||||
See `:help g:ale_linters`
|
||||
|
||||
|
||||
g:ale_elixir_mix_options *g:ale_elixir_mix_options*
|
||||
*b:ale_elixir_mix_options*
|
||||
Type: |String|
|
||||
@@ -45,33 +40,5 @@ configured on your project's `mix.exs`.
|
||||
See https://github.com/jeremyjh/dialyxir#with-explaining-stuff for more
|
||||
information.
|
||||
|
||||
===============================================================================
|
||||
elixir-ls *ale-elixir-elixir-ls*
|
||||
|
||||
Elixir Language Server (https://github.com/JakeBecker/elixir-ls)
|
||||
|
||||
g:ale_elixir_elixir_ls_release *g:ale_elixir_elixir_ls_release*
|
||||
*b:ale_elixir_elixir_ls_release*
|
||||
Type: |String|
|
||||
Default: `'elixir-ls'`
|
||||
|
||||
Location of the elixir-ls release directory. This directory must contain
|
||||
the language server scripts (language_server.sh and language_server.bat).
|
||||
|
||||
g:ale_elixir_elixir_ls_config *g:ale_elixir_elixir_ls_config*
|
||||
*b:ale_elixir_elixir_ls_config*
|
||||
Type: |Dictionary|
|
||||
Default: `{}`
|
||||
|
||||
Dictionary containing configuration settings that will be passed to the
|
||||
language server. For example, to disable Dialyzer: >
|
||||
{
|
||||
\ 'elixirLS': {
|
||||
\ 'dialyzerEnabled': v:false,
|
||||
\ },
|
||||
\ }
|
||||
<
|
||||
Consult the ElixirLS documentation for more information about settings.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
||||
@@ -1,37 +1,15 @@
|
||||
===============================================================================
|
||||
ALE Eruby Integration *ale-eruby-options*
|
||||
|
||||
There are four linters for `eruby` files:
|
||||
There are three linters for `eruby` files:
|
||||
|
||||
- `erb`
|
||||
- `erubis`
|
||||
- `erubi`
|
||||
- `ruumba`
|
||||
|
||||
`erb` is in the Ruby standard library and is mostly universal. `erubis` is the
|
||||
default parser in Rails between 3.0 and 5.1. `erubi` is the default in Rails
|
||||
5.1 and later. `ruumba` can extract Ruby from eruby files and run rubocop on
|
||||
the result. To selectively enable a subset, see |g:ale_linters|.
|
||||
|
||||
===============================================================================
|
||||
ruumba *ale-eruby-ruumba*
|
||||
|
||||
g:ale_eruby_ruumba_executable *g:ale_eruby_ruumba_executable*
|
||||
*b:ale_eruby_ruumba_executable*
|
||||
Type: String
|
||||
Default: `'ruumba`
|
||||
|
||||
Override the invoked ruumba binary. This is useful for running ruumba
|
||||
from binstubs or a bundle.
|
||||
|
||||
|
||||
g:ale_eruby_ruumba_options *g:ale_ruby_ruumba_options*
|
||||
*b:ale_ruby_ruumba_options*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be change to modify flags given to ruumba.
|
||||
|
||||
5.1 and later. To selectively enable a subset, see |g:ale_linters|.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
||||
@@ -27,7 +27,7 @@ g:ale_go_go_executable *g:ale_go_go_options*
|
||||
Default: `'go'`
|
||||
|
||||
The executable that will be run for the `gobuild` and `govet` linters, and
|
||||
the `gomod` fixer.
|
||||
the gomod` fixer.
|
||||
|
||||
|
||||
===============================================================================
|
||||
@@ -53,25 +53,6 @@ g:ale_go_gofmt_options *g:ale_go_gofmt_options*
|
||||
This variable can be set to pass additional options to the gofmt fixer.
|
||||
|
||||
|
||||
===============================================================================
|
||||
golint *ale-go-golint*
|
||||
|
||||
g:ale_go_golint_executable *g:ale_go_golint_executable*
|
||||
*b:ale_go_golint_executable*
|
||||
Type: |String|
|
||||
Default: `'golint'`
|
||||
|
||||
This variable can be set to change the golint executable path.
|
||||
|
||||
|
||||
g:ale_go_golint_options *g:ale_go_golint_options*
|
||||
*b:ale_go_golint_options*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be set to pass additional options to the golint linter.
|
||||
|
||||
|
||||
===============================================================================
|
||||
govet *ale-go-govet*
|
||||
|
||||
|
||||
@@ -22,16 +22,6 @@ g:ale_haskell_ghc_options *g:ale_haskell_ghc_options*
|
||||
|
||||
This variable can be changed to modify flags given to ghc.
|
||||
|
||||
===============================================================================
|
||||
ghc-mod *ale-haskell-ghc-mod*
|
||||
|
||||
g:ale_haskell_ghc_mod_executable *g:ale_haskell_ghc_mod_executable*
|
||||
*b:ale_haskell_ghc_mod_executable*
|
||||
Type: |String|
|
||||
Default: `'ghc-mod'`
|
||||
|
||||
This variable can be changed to use a different executable for ghc-mod.
|
||||
|
||||
===============================================================================
|
||||
cabal-ghc *ale-haskell-cabal-ghc*
|
||||
|
||||
@@ -87,15 +77,6 @@ g:ale_haskell_hlint_executable *g:ale_haskell_hlint_executable*
|
||||
|
||||
This variable can be changed to use a different executable for hlint.
|
||||
|
||||
|
||||
g:ale_haskell_hlint_options g:ale_haskell_hlint_options
|
||||
b:ale_haskell_hlint_options
|
||||
Type: String
|
||||
Default: ''
|
||||
|
||||
This variable can be used to pass extra options to the underlying hlint
|
||||
executable.
|
||||
|
||||
===============================================================================
|
||||
stack-build *ale-haskell-stack-build*
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
===============================================================================
|
||||
ALE HCL Integration *ale-hcl-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
terraform-fmt *ale-hcl-terraform-fmt*
|
||||
|
||||
See |ale-terraform-fmt| for information about the available options.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
@@ -79,12 +79,6 @@ g:ale_html_tidy_use_global *g:html_tidy_use_global*
|
||||
See |ale-integrations-local-executables|
|
||||
|
||||
|
||||
===============================================================================
|
||||
prettier *ale-html-prettier*
|
||||
|
||||
See |ale-javascript-prettier| for information about the available options.
|
||||
|
||||
|
||||
===============================================================================
|
||||
stylelint *ale-html-stylelint*
|
||||
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
===============================================================================
|
||||
ALE ISPC Integration *ale-ispc-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
ispc *ale-ispc-ispc*
|
||||
|
||||
g:ale_ispc_ispc_executable *g:ale_ispc_ispc_executable*
|
||||
*b:ale_ispc_ispc_executable*
|
||||
Type: |String|
|
||||
Default: `'ispc'`
|
||||
|
||||
This variable can be changed to use a different executable for ispc.
|
||||
|
||||
|
||||
g:ale_ispc_ispc_options *g:ale_ispc_ispc_options*
|
||||
*b:ale_ispc_ispc_options*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be changed to modify flags given to ispc.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
@@ -73,13 +73,6 @@ g:ale_json_jq_options *g:ale_json_jq_options*
|
||||
|
||||
This option can be changed to pass extra options to `jq`.
|
||||
|
||||
g:ale_json_jq_filters *g:ale_json_jq_filters*
|
||||
*b:ale_json_jq_filters*
|
||||
Type: |String|
|
||||
Default: `'.'`
|
||||
|
||||
This option can be changed to pass custom filters to `jq`.
|
||||
|
||||
|
||||
===============================================================================
|
||||
prettier *ale-json-prettier*
|
||||
|
||||
@@ -38,36 +38,5 @@ uncrustify *ale-objc-uncrustify*
|
||||
See |ale-c-uncrustify| for information about the available options.
|
||||
|
||||
|
||||
===============================================================================
|
||||
ccls *ale-objc-ccls*
|
||||
|
||||
g:ale_objc_ccls_executable *g:ale_objc_ccls_executable*
|
||||
*b:ale_objc_ccls_executable*
|
||||
Type: |String|
|
||||
Default: `'ccls'`
|
||||
|
||||
This variable can be changed to use a different executable for ccls.
|
||||
|
||||
|
||||
g:ale_objc_ccls_init_options *g:ale_objc_ccls_init_options*
|
||||
*b:ale_objc_ccls_init_options*
|
||||
Type: |Dictionary|
|
||||
Default: `{}`
|
||||
|
||||
This variable can be changed to customize ccls initialization options.
|
||||
Example: >
|
||||
{
|
||||
\ 'cacheDirectory': '/tmp/ccls',
|
||||
\ 'cacheFormat': 'binary',
|
||||
\ 'diagnostics': {
|
||||
\ 'onOpen': 0,
|
||||
\ 'opChange': 1000,
|
||||
\ },
|
||||
\ }
|
||||
<
|
||||
Visit https://github.com/MaskRay/ccls/wiki/Initialization-options for all
|
||||
available options and explanations.
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
===============================================================================
|
||||
ALE Perl6 Integration *ale-perl6-options*
|
||||
|
||||
Checking code with `perl6` is disabled by default, as `perl6` code cannot be
|
||||
checked without executing it. Specifically, we use the `-c` flag to see if
|
||||
`perl6` code compiles. This does not execute all of the code in a file, but it
|
||||
does run `BEGIN` and `CHECK` blocks. See `perl6 --help`
|
||||
|
||||
Full support requires a perl6 implementation that supports the
|
||||
PERL6_EXCEPTIONS_HANDLER environment variable and JSON error output,
|
||||
which was specified in 6.d. Rakudo version 2018.08 is the first rakudo release
|
||||
that supports this. See `perl6 --version` and
|
||||
https://docs.perl6.org/programs/03-environment-variables.
|
||||
|
||||
Without this variable, errors and warnings will appear at line 1, and can be
|
||||
viewed with ALEDetail. This also serves as a fallback for errors and warnings
|
||||
that do not trigger JSON output.
|
||||
|
||||
See |g:ale_linters|.
|
||||
|
||||
|
||||
===============================================================================
|
||||
perl6 *ale-perl6-perl6*
|
||||
|
||||
g:ale_perl6_perl6_executable *g:ale_perl6_perl6_executable*
|
||||
*b:ale_perl6_perl6_executable*
|
||||
Type: |String|
|
||||
Default: `'perl6'`
|
||||
|
||||
This variable can be changed to modify the executable used for linting
|
||||
perl6.
|
||||
|
||||
|
||||
g:ale_perl6_perl6_options *g:ale_perl6_perl6_options*
|
||||
*b:ale_perl6_perl6_options*
|
||||
Type: |String|
|
||||
Default: `'-c -Ilib'`
|
||||
|
||||
This variable can be changed to alter the command-line arguments to the
|
||||
perl6 invocation.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
@@ -169,16 +169,6 @@ g:ale_php_phpstan_configuration *g:ale_php_phpstan_configuration*
|
||||
This variable sets path to phpstan configuration file.
|
||||
|
||||
|
||||
===============================================================================
|
||||
psalm *ale-php-psalm*
|
||||
|
||||
g:ale_php_psalm_executable *g:ale_php_psalm_executable*
|
||||
*b:ale_php_psalm_executable*
|
||||
Type: |String|
|
||||
Default: `'psalm'`
|
||||
|
||||
This variable sets the executable used for psalm.
|
||||
|
||||
===============================================================================
|
||||
php-cs-fixer *ale-php-php-cs-fixer*
|
||||
|
||||
@@ -203,15 +193,5 @@ g:ale_php_cs_fixer_options *g:ale_php_cs_fixer_options*
|
||||
|
||||
This variable can be set to pass additional options to php-cs-fixer.
|
||||
|
||||
===============================================================================
|
||||
php *ale-php-php*
|
||||
|
||||
g:ale_php_php_executable *g:ale_php_php_executable*
|
||||
*b:ale_php_php_executable*
|
||||
Type: |String|
|
||||
Default: `'php'`
|
||||
|
||||
This variable sets the executable used for php.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
===============================================================================
|
||||
ALE Prolog Integration *ale-prolog-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
swipl *ale-prolog-swipl*
|
||||
|
||||
g:ale_prolog_swipl_executable *g:ale_prolog_swipl_executable*
|
||||
*b:ale_prolog_swipl_executable*
|
||||
Type: |String|
|
||||
Default: `'swipl'`
|
||||
|
||||
The executable that will be run for the `swipl` linter.
|
||||
|
||||
g:ale_prolog_swipl_load *g:ale_prolog_swipl_load*
|
||||
*b:ale_prolog_swipl_load*
|
||||
Type: |String|
|
||||
Default: `'current_prolog_flag(argv, [File]), load_files(File, [sandboxed(true)]), halt.'`
|
||||
|
||||
The prolog goals that will be passed to |g:ale_prolog_swipl_executable| with `-g` option.
|
||||
|
||||
It does:
|
||||
1. Takes the first command argument (current file path)
|
||||
2. Checks (syntactic / semantic) problems and output to stderr
|
||||
|
||||
NOTE: `sandboxed(true)` prohibits executing some directives such as 'initialization main'.
|
||||
|
||||
g:ale_prolog_swipl_timeout *g:ale_prolog_swipl_timeout*
|
||||
*b:ale_prolog_swipl_timeout*
|
||||
Type: |Number|
|
||||
Default: `3`
|
||||
|
||||
Timeout seconds to detect long-running linter.
|
||||
It is done by setting SIGALRM.
|
||||
See |g:ale_prolog_swipl_alarm| and |g:ale_prolog_swipl_alarm_handler|.
|
||||
|
||||
g:ale_prolog_swipl_alarm *g:ale_prolog_swipl_alarm*
|
||||
*b:ale_prolog_swipl_alarm*
|
||||
Type: |String|
|
||||
Default: `'alarm(%t, (%h), _, [])'`
|
||||
|
||||
The prolog goals to be expected to set SIGALRM.
|
||||
`%t` is replaced by |g:ale_prolog_swipl_timeout|.
|
||||
`%h` is replaced by |g:ale_prolog_swipl_alarm_handler|.
|
||||
|
||||
g:ale_prolog_swipl_alarm_handler *g:ale_prolog_swipl_alarm_handler*
|
||||
*b:ale_prolog_swipl_alarm_handler*
|
||||
Type: |String|
|
||||
Default: `'writeln(user_error, "ERROR: Exceeded %t seconds, Please change g:prolog_swipl_timeout to modify the limit."), halt(1)'`
|
||||
|
||||
The prolog goals to be expected that will be run on SIGALRM.
|
||||
`%t` is replaced by |g:ale_prolog_swipl_timeout|.
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
@@ -109,7 +109,6 @@ g:ale_rust_cargo_include_features *g:ale_rust_cargo_include_features*
|
||||
When defined, ALE will set the `--features` option when invoking `cargo` to
|
||||
perform the lint check. See |g:ale_rust_cargo_default_feature_behavior|.
|
||||
|
||||
|
||||
g:ale_rust_cargo_avoid_whole_workspace *g:ale_rust_cargo_avoid_whole_workspace*
|
||||
*b:ale_rust_cargo_avoid_whole_workspace*
|
||||
Type: |Number|
|
||||
@@ -120,36 +119,6 @@ g:ale_rust_cargo_avoid_whole_workspace *g:ale_rust_cargo_avoid_whole_workspace*
|
||||
in the crate's directory. Otherwise, behave as usual.
|
||||
|
||||
|
||||
g:ale_rust_cargo_use_clippy
|
||||
*g:ale_rust_cargo_use_clippy*
|
||||
*b:ale_rust_cargo_use_clippy*
|
||||
Type: |Number|
|
||||
Default: `0`
|
||||
|
||||
When set to 1, `cargo clippy` will be used instead of `cargo check` or
|
||||
`cargo build` as linter.
|
||||
For details of `cargo clippy`, please visit the following link:
|
||||
|
||||
https://github.com/rust-lang-nursery/rust-clippy
|
||||
|
||||
Since `cargo clippy` is optional toolchain, it's safer to check whether
|
||||
`cargo-clippy` is executable as follows:
|
||||
>
|
||||
let g:ale_rust_cargo_use_clippy = executable('cargo-clippy')
|
||||
<
|
||||
|
||||
g:ale_rust_cargo_clippy_options
|
||||
*g:ale_rust_cargo_clippy_options*
|
||||
*b:ale_rust_cargo_clippy_options*
|
||||
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
When `cargo clippy` is used, this value will be added to a command line to run
|
||||
it. This variable is useful when you want to add some extra options which
|
||||
only `cargo clippy` supports (e.g. `--deny`).
|
||||
|
||||
|
||||
===============================================================================
|
||||
rls *ale-rust-rls*
|
||||
|
||||
@@ -198,22 +167,6 @@ g:ale_rust_ignore_error_codes *g:ale_rust_ignore_error_codes*
|
||||
>
|
||||
let g:ale_rust_ignore_error_codes = ['E0432', 'E0433']
|
||||
|
||||
g:ale_rust_ignore_secondary_spans *g:ale_rust_ignore_secondary_spans*
|
||||
*b:ale_rust_ignore_secondary_spans*
|
||||
Type: Number
|
||||
Default: 0
|
||||
|
||||
When set to 1, instructs the Rust error repporting to ignore secondary
|
||||
spans. The problem with secondary spans is that they sometimes appear in
|
||||
error messages before the main cause of the error, for example: >
|
||||
|
||||
1 src/main.rs|98 col 5 error| this function takes 4 parameters but 5
|
||||
parameters were supplied: defined here
|
||||
2 src/main.rs|430 col 32 error| this function takes 4 parameters but 5
|
||||
parameters were supplied: expected 4 parameters
|
||||
<
|
||||
This is due to the sorting by line numbers. With this option set to 1,
|
||||
the 'defined here' span will not be presented.
|
||||
|
||||
===============================================================================
|
||||
rustfmt *ale-rust-rustfmt*
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user