summaryrefslogtreecommitdiff
path: root/autoload
AgeCommit message (Collapse)Author
2022-09-25cc: use '-x c*-header' for header files for C and C++ linters. (#4318)Nicolas Pauss
When linting an header file in C or C++, `-x c-header` or `-x c++-header` should be used instead of `-x c` or `-x c++`. Using `-x c` or `-x c++` for headers files can lead to unused variables and functions marked as static inlined as seen in #4096. Using `-x c-header` or `-x c++-header` solve these issues. The list of file extensions that are considered as header files can be configured with the variables `g:ale_c_cc_header_exts` and `g:ale_cpp_cc_header_exts`.
2022-09-11Deno: find project root using deno.json/deno.jsonc (#4306)Dirk Jonker
Deno LSP automatically detects config files named deno.json or deno.jsonc since version 1.18. For Deno 1.18+ this means that ALE no longer needs to resolve the project root. However, removing the project root logic from ALE means breaking changes for people that are still using an older version. Adding deno.json to the list of looking files to look for will keep the behavior consistent and compatible with the Deno config file naming convention. See also: https://deno.com/blog/v1.18#auto-discovery-of-the-config-file
2022-09-11Fix 4155 - Show error when project root not found (#4207)Horacio Sanson
2022-09-08omni: find last racket keyword for completion (#4293)D. Ben Knoble
Otherwise it finds the first keyword, which is usually not relevant to the cursor position, and incorrectly calculates the completion position.
2022-09-07Implement buffer-wide virtual text support (#4289)Magnus Groß
* Remove virtual text via types-filter This is more robust and has the additional sideeffect that it will make it easier to implement showing virtual text for all warnings simultaneously. We definitely do not want to do a call to prop_remove() for every virtual text as that will cause noticeable lag when many warnings are present, thus we can use this to remove all virtual text lines with one call in the future. Fixes #4294 refs: https://github.com/vim/vim/pull/10945 * Allow virtual text to appear for all warnings of the buffer This can be enabled with: let g:ale_virtualtext_cursor = 2 It is implemented both for neovim and vim 9.0.0297. Note that sometimes it may appear like some warnings are displayed multiple times. This is not a bug in the virtual text implementation, but a sideeffect of multiple linters returning similar results. For example for Rust, the 'cargo' and 'rls' linters appear to be activated at the same time, but they sometimes return identical errors. This causes the virtual text to show the same warning twice. In the future we can mitigate this problem by removing duplicate errors from our internal location list. However users can also achieve cleaner warnings simply by activating only one linter for each language (or multiple unambiguous linters). For example for Rust, the problem could be solved with: let g:ale_linters = {'rust': ['analyzer']} Fixes #2962 Fixes #3666
2022-09-06Fix virtual text for vim 8.2 (#4291)Magnus Groß
Regression was introduced in d93bc2baf7532818e83bf2fac61fcd591beb6151 The problem was that we did not handle the edge case where there is no last popup to close, which caused old vim versions to enter code by accident that was only supposed to be run by vim 9. We fix this by guarding the if condition for vim 9. Fixes #4290
2022-08-23Allow callbacks for floating preview popups (#4247)Shaun Duncan
* Add extra config options for virtualtext * Undo virtualtext changes and move to floating preview * revert changes to pass hightlight group to floating preview * rename var * Document changes * Add updates based on feedback * Check for string type and attempt to call the function * Fix lint errors Co-authored-by: Shaun Duncan <shaun@speedscale.com>
2022-08-23Use native virtual-text for vim9 (#4281)Magnus Groß
Our current virtual text implementation for vim emulates it by abusing the textprop and popupwin feature from vim 8.2 (for more details see commit 708e810414d124b17b0c42e872b387a7a6c2ea85). This implementation sometimes is janky, for example the popups may leak into other vim windows next to the current window. Luckily, vim just got native virtual-text support as a proper subtype to the prop_add() function. By using the 'text' option, the text property automatically becomes virtual text that is appended to the current line if col is zero. Note that the prop_add() method now returns negative IDs for virtual text properties. This feature was added in vim 9.0.0067, but it got a lot of bugfixes which is why we only use this new API if vim has at least version 9.0.0214. However, there are still some minor bugs with vim's native virtual text, so we might have to bump the version check again in the future. Also see #3906. Now with proper virtual text support for both vim and neovim available, we can tackle #2962 in the future by simply tracking multiple virt-texts instead of just the last one. In the future we might also want to disable our virtual text emulation support for vim, as it is a total hack, but for now we should keep it for backwards compatibility.
2022-08-18fix #4276: honor b:ale_enabled for hover at cursor (#4277)Hongbo Liu
* fix #4276: honor b:ale_enabled for hover at cursor * fix indention
2022-08-09Add support for syntax_tree fixer (#4268)Mo Lawson
This is the library that now powers prettier/plugin-ruby but is also stands on its own: https://github.com/ruby-syntax-tree/syntax_tree
2022-08-07Add openscad and sca2d support (#4205)Nathan Henrie
2022-07-26Prevent buffering of job output and excessive polling (#4259)Tomáš Janoušek
When 'close_cb' is set for job_start(), but out_cb or err_cb isn't, vim buffers data instead of dropping it (in case someone wanted to read and process it in close_cb), and additionally polls for new data every 10 milliseconds, causing excessive wakeups and CPU usage. Since we don't read the data anywhere outside of out_cb/err_cb, any LSP that prints an error to stderr triggers this and vim keeps spinning until :ALEStopAllLSPs. Fix this by always setting both callbacks, thus dropping any data we're not interested in. See https://github.com/vim/vim/issues/10758 for an upstream report of the excessive polling. It's possible this is intentional, I dunno. Fixes: b42153eb1786 ("Fix #4098 - Clear LSP data when servers crash")
2022-07-26Add support for Dune (#4263)Albert Peschar
* Add support for dune * Add test * Undo reformatting of Markdown file * Refer to ale-ocaml-dune from ale.txt
2022-07-14Fix 4249 - Revert change to stop compl menu. (#4250)Horacio Sanson
In #4231 some code was added to stop the completion menu if any when opening a new one. This resulted in an issue in Vim that fills the buffer with Ctrl-Z characters when deleting to the end of a line in a position that triggers auto-completion. Since auto-completion seems to work fine on all my tests I am reverting this specific change.
2022-07-07Add support for Laravel Pint (#4238)Michael Dyrynda
* add support, docs, tests for Laravel Pint * fix php-cs-fixer link * add missing project-without-pint * fix indentation * fix pint executable in pint fixer test * fix variables, docs related to pint support
2022-07-04Improve struct and pointer autocompletion in C (#4231)Marios S
* Add explicit trigger characters for C (#4226) * Stop completion before issuing subsequent requests (#4226) Co-authored-by: Marios Sioutis <26476573+s-marios@users.noreply.github.com>
2022-07-02Allow `shfmt` fixer to use `.editorconfig` (#4244)Henrique Barcelos
* fix: added support for local solhint executable * feat: added support for matching parse errors * test: added test for solhint command callback and handler * chore: removed command callback test * refactor: made solhint handler structure closer to eslint * refactor(shfmt-fixer): remove derivation of default CLI arguments
2022-06-23racket: start completion in a full keyword (#4186)D. Ben Knoble
The default `omni_start_map` is too restrictive for Lisps and Schemes like Racket, which permit hyphens (among other special characters). As recorded in #3870, trying to complete `file-name-from-path` when typing `file-name<C-x><C-o>` would give completions like `namespace` because the hyphen is ignored to find the start of the word for completion. Now the racket filetype searches for the start using the keyword class `\k`, which is more precise.
2022-06-16Add pyflyby fixer (using its tidy-imports script) (#4219)infokiller
* add pyflyby fixer updates * pyflyby: add docs updates * add tests to pyflyby fixer
2022-05-29Add support for actionlint options (#4216)Isman Firmansyah
* Add support for actionlint options * fix misaligned doc tags
2022-05-27Allow customization of all floating window borders (#4215)Devin J. Pohly
* Allow customization of all floating window borders Users may not necessarily want the same border character for top+bottom or left+right, so allow all eight border characters to be configured in g:ale_floating_window_border. For backwards compatibility, the old rules are still applied if only six elements are given. * Reorder popup border array for compatibility
2022-05-17Add zig fmt support (#4198)Arash Mousavi
* Add zig fmt support * Review changes * Fix linter errors
2022-05-16Add support for Packer (#4192)Zhuoyun Wei
* Add support for HashiCorp Packer * Add test for packer fmt * Add doc for HCL/Packer * Add link to Packer doc * Also suggest packer fix for packer ft * Add more links to TOC
2022-05-16add rego support (#4199)Reza J. Bavaghoush
* add opa fmt fixer for rego files * add opa linter * add basic tests for linter and fixer * add cspell to the docs
2022-05-15Look for .mypy.ini when finding project root (#4202)Fionn Fitzmaurice
We already check for mypy.ini, but the fallback .mypy.ini was ignored.
2022-05-13Close #4201 - Run vimls from Vader by defaultw0rp
2022-05-03Fix 4177 set default yaml linters (#4178)Horacio Sanson
* Fix 4177 set default yaml linters * Fix 4177 set default yaml linters
2022-05-03add yaml actionlint support (github actions) (#4173)bretello
Co-authored-by: bretello <bretello@distruzione.org>
2022-04-30vscode-json-languageserver support (#4164)Dalius Dobravolskas
* vscode-json-languageserver-bin support VSCode JSON languageserver has schema support for linting and completions. I have enabled snippets support (`snippetSupport`) even if it is not fully supported. `label` that comes with completions response can be used as well. * Test fix. * vscode-json-languageserver instead of vscode-json-languageserver-bin vscode-json-languageserver is more up-to-date (about 1 year old), vscode-json-languageserver-bin is 4 years old. * Use git root. * Documentation update. * Trying to sort ordering issue. * One more attempt * One more attempt * Uppercase seems to win. * Clean-up * Clean-up 2 * Test removed.
2022-04-30Add ALEGoToImplementation (#4160)godbless
* Add go to implementation * Add test cases for GoToImplementation * Add documentation for GoToImplementation
2022-04-29Add CodeAction codeActionLiteralSupport Feature (#4163)godbless
* Advertise codeActionLiteralSupport to LSP server Without this, rust-analyzer doesn't return any code actions. With it, everything works properly. * linter fixes * test cases fixes * Fix underflow of column in position. Special values like for example -1 to denote the end of a line are not supported. [reference](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position) Co-authored-by: Brian Gernhardt <brian@gernhardtsoftware.com>
2022-04-06Add buf linter and fixer (#4128)Alex McKinney
* Add buf lint to linters * Add buf format to fixers * Fix test/linter/test_buf_lint.vader * Fix test/fixers/test_buf_format_fixer_callback.vader * Simplify test/test-files/proto/testfile.proto * Add buf-lint alias and rename linter
2022-04-06Handle ghc panic in haskell (#4145)lykmast
* Add primitive handling of ghc panic. * PascalCase in function. * Add simple test.
2022-04-06Add the buffer-local options 'b:ale_shell' and 'b:ale_shell_arguments'. (#4146)James Cherti
2022-04-06Fix 4141 - Stop press enter prompt on long diagnostic messages (#4144)Horacio Sanson
* Fix 4141 - Stop press enter prompt on long diagnostic messages * Fix 4139 - Check for array before join truncated_echo
2022-04-01Fix test for echoing messagesw0rp
The previous linter rule about stray echo lines has been restored, and now all problems for custom linting rules can be ignored by adding a comment above problem lines.
2022-04-01Use echon over echom for cursor echo (#3888)Amadeus Demarzi
* Problem messages no longer clutter `:messages` * Messages are truncated better
2022-04-01Set default value for insertTextFormat (#4124)João Costa
Co-authored-by: w0rp <devw0rp@gmail.com>
2022-04-01Add neovim 0.6 to run-tests (#3998)Horacio Sanson
* Update test scripts * Remove neovim 0.3 and 0.4 * Add neovim 0.6.1 Co-authored-by: Horacio Sanson <horacio@allm.inc> Co-authored-by: w0rp <devw0rp@gmail.com>
2022-04-01Fix end line number when it exceeds the file (#4130)Felix Maurer
If the end of the error exceeds the file, set it to the last line, similarly as it is done with the beginning of the error.
2022-03-20Fix :ALEImport column positionyoshi1123
Fix :ALEImport column position so it works with more language servers. Co-authored-by: w0rp <devw0rp@gmail.com>
2022-03-05Bump ALE to v3.2.0w0rp
2022-03-05Document default linter selections againw0rp
2022-03-04Fix an argument namew0rp
2022-03-04Enable autoimport by default (#4102)Horacio Sanson
2022-03-04Add eclipselsp jdt:// support for textDocument/definition (#4030)yoshi1123
This patch adds support for opening jdt:// links on "go to definition" requests returned by Java language servers. Co-authored-by: w0rp <devw0rp@gmail.com>
2022-03-02Fix #4098 - Clear LSP data when servers crashw0rp
2022-02-09Sometimes end_lnum and end_col are not present (#4062)Horacio Sanson
2022-02-08Dispatch textDocument/didChange after rename (2) (#4049)Jerko Steiner
* Dispatch textDocument/didChange after rename Previously whenever we renamed a symbol that was referenced from other files we'd just edit those files in the background, and the LSP wouldn't know about these changes. If we tried to rename the same symbol again, the renaming would fail. In some scenarios, the operation would just be wrong. Here is an attempt to fix this issue. I also noticed another bug when using Go with `gopls` LSP and the `gofmt` fixer. Whenever the file was saved, the `gofmt` would run and reformat the file. But it seems there was some kind of a race condition so I disabled saving for now, and all of the modified files will be unsaved, so the user should call `:wa` to save them. I personally like this even better because I can inspect exactly what changes happened, and I instantly see them in the other opened buffers, which was previously not the case. Fixes #3343, #3642, #3781. * Address PR comments * Remove mode tests in corner case tests * Address PR comments * Save after ALERename and ALEOrganizeImports Also provide options to disable automatic saving, as well as instructions to enable `set hidden` before doing that. * Fix broken test * Save only when !&hidden * Update doc * Update doc * Add silent
2022-02-05Allows to use quickfix for references. (#4033)Dalius Dobravolskas
* Allows to use quickfix for references. E.g. following mapping could be used to find references for item under cursor and put result into quickfix list: ``` nnoremap <leader>af :ALEFindReferences -quickfix<CR> ``` Fixes #1759 * Documentation update.