Commit Graph

4278 Commits

Author SHA1 Message Date
Horacio Sanson
cbf7045eee
Fix 4324 - add neovim 0.8 test (#4325)
* Fix 4324 - add neovim 0.8 test
* Update vim testbed image
* Update documentation

Co-authored-by: w0rp <w0rp@users.noreply.github.com>
2022-11-25 12:55:31 +00:00
Horacio Sanson
2cfbebdd59
4242 update tests with vim 9 (#4366)
* Replace Vim 8.2 with Vim 9.0 in CI
* Keep Windows tests on Vim 8.0 for now

Co-authored-by: w0rp <w0rp@users.noreply.github.com>
2022-11-25 12:34:40 +00:00
Carl Smedstad
590352304e
Fix bug in sqlfluff implementation & implement fixer support (#4365)
* Account for no sqlfluff output

Avoid crashes when there isn't any output from sqlfluff.

* Add supplort for sqlfluff as a fixer
2022-11-23 19:58:49 +09:00
Joey Buiteweg
0b25d712b7
Add rustfmt executable variable to rust docs (#4360) 2022-11-22 10:28:39 +09:00
Carl Smedstad
6c4be47437
Implement support for SQL linter sqlfluff (#4361) 2022-11-21 19:50:45 +09:00
Götz Christ
ca355f4cb4
Markdown: allow passing custom executable for markdownlint (#4358) 2022-11-21 19:47:05 +09:00
Jeremy Cantrell
4b433e5693
Add raco_fmt fixer for Racket files (#4354)
* Add raco_fmt fixer for Racket files

* Fix command and add test

* Fix quoting
2022-11-07 22:20:25 +09:00
Yining
edffffac25
add: support config option for checkmake linter (#4351)
`checkmake` by default checks config file "in the same folder it's
executed in" unless `--config` option is set.

This commit allows setting the `--config` option with an option
variable (with documentation updated).
2022-11-06 09:32:51 +09:00
D. Ben Knoble
07bd24d0fd
omni: racket should complete at end of keywords (#4352)
Consider a file like
```
 #lang racket
(require racket/gui)
```
Type `Go(eventspace-`.

Pressing <C-x><C-o> to trigger omnicomplete should suggest
```
eventspace-handler-thread
eventspace-shutdown?
eventspace-event-evt
```

It does not (instead producing "top-level" completions, as if
`(eventspace-` wasn't even there).

Debugging, place the cursor on a space _after_. Now
`ale#completion#OmniFunc(1, '')` correctly returns `1`, but when given
`(0, 'eventspace-')` it returns either the empty list or generic
completion results as described above. I'm not entirely sure of the
mechanism, but it seems that `b:ale_completion_info.prefix` is the key,
and that this is set by `ale#completion#GetPrefix`. Calling
`ale#completion#GetPrefix('racket', line('.'), col('.'))` returned `''`!

Now, it returns `eventspace-` and the completions work correctly again.

Ref #4293, #4186, #3870
2022-11-05 16:47:59 +09:00
Matthew Armand
121fbefeae
Add 'dockerfile_hadolint_options' config setting (#4353)
- Add this option so command line arguments can be supplied to hadolint
- This will be respected when running in docker and via the executable
- Preserve the --no-color and - flags, and add these to the list
- Add to docs and tests
2022-11-04 17:07:56 +09:00
Yining
483d056528
add: support for ruff as a Python linter and fixer (#4347)
this commit adds ruff as both a Python linter and fixer, together with
some tests and documentation.

ruff repo: https://github.com/charliermarsh/ruff
2022-10-31 21:55:14 +09:00
Dmitri Vereshchagin
06efbdd25a
Add erlang_ls linter for Erlang files (#4346) 2022-10-29 20:58:30 +09:00
Ben Boeckel
d02e58b404
Doc style fixes (#4344)
* ale.txt: fix indentation

* ale.txt: fix Type and Default markup

* ale.txt: use `not set` instead of `undefined`

This matches the way the variables are referenced in prose about
existence state.
2022-10-29 20:56:47 +09:00
Ben Boeckel
28cff80652
codespell: fix spelling errors picked out by codespell (#4343) 2022-10-29 20:56:09 +09:00
D. Ben Knoble
e4b2054408
test: ensure helptags runs (#4336)
Close #4328
2022-10-14 09:36:43 +09:00
Nicolas Pauss
951a668b14
cc: fix using '-x c*-header' for header files with GCC. (#4334)
Gcc does not support `x c*-header` when using `-` as input filename,
which is what ALE does.

Rework the feature to only use `-x c*-header` flag when using Clang and
not GCC.

The feature is now also controlled with the variable
`g:ale_c_cc_use_header_lang_flag` and
`g:ale_cpp_cc_use_header_lang_flag`.
2022-10-12 07:05:37 +09:00
koka
f085227504
fix: wrong config name (#4326) 2022-10-05 08:39:45 +09:00
koka
14d2b261ce
Add support for tfsec Terraform linter (#4323) 2022-10-04 11:47:00 +09:00
Horacio Sanson
4094426c70
Add vim 9.0 and remove 8.0 (#4271)
* Add vim 9.0 and remove 8.0

* Remove vim 8.2 and keep 8.0
2022-10-04 09:38:07 +09:00
Matheus Gabriel Werny de Lima
a33960eb51
Add fixer "css-beautify". Adjust "html-beautify." (#4319)
* Add fixer "css-beautify". Adjust "html-beautify."

* Error fixes.

* Added chars.
2022-09-30 19:24:32 +09:00
Matheus Gabriel Werny de Lima
7dd13afc6c
Added file types for dprint. (#4320) 2022-09-30 12:58:44 +09:00
Andreas Doll
915dc415f3
Add pyright config files to project root files list (#4321)
Add configuration files for pyright (JSON and TOML) to list of files
which identify a project root directory. Update documentation
accordingly.

Co-authored-by: Andreas Doll <andreas.doll@posteo.de>
2022-09-30 11:21:09 +09:00
Nicolas Pauss
78942df284
cc: use '-x c*-header' for header files for C and C++ linters. (#4318)
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-25 09:02:43 +09:00
Christoph Frick
a56d51ec1c
Pass input via stdin and filename as arg to clj-kondo (#4315)
This allows using linters like `:namespace-name-mismatch`.

This replaces: https://github.com/dense-analysis/ale/pull/4109
2022-09-22 07:24:01 +09:00
Carl Smedstad
e73f0f5cb3
bicep: Lint files on disk instead of buffer (#4311)
I discovered that references to other Bicep files (modules) will be
broken if running on a temporary file in a different location. I've
found no way of providing an alternate path when invoking the command.
2022-09-21 22:44:22 +09:00
Carl Smedstad
8e03ceecdc
Add support for Microsoft's DSL Bicep (#4310)
* Add support for Microsoft's DSL Bicep

The compilation command 'bicep build' catches compilation errors as well
as providing some lint warnings.

Repository for Bicep: https://github.com/Azure/bicep

* Different null file on Windows & hardcode commands
2022-09-14 08:13:41 +09:00
BBOOXX
77fcf9b2c2
chore(volar): update volar executable name (#4308)
see: johnsoncodehk/volar#876
see: johnsoncodehk/volar/blob/master/packages/vue-language-server/package.json#L11
2022-09-11 11:07:01 +09:00
Dirk Jonker
1458b8749c
Deno: find project root using deno.json/deno.jsonc (#4306)
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-11 10:57:03 +09:00
Horacio Sanson
a51fd9daba
Add gitlablint support (#3042) 2022-09-11 10:53:33 +09:00
Horacio Sanson
9e8920b336
Fix 4155 - Show error when project root not found (#4207) 2022-09-11 10:51:27 +09:00
Guangqing Chen
477ad3fdd2
Allow to pass options to the buf linter and fix callback. (#4300)
* Allow to pass options to the buf linter

* Fix the callback of buf linter
2022-09-08 17:04:17 +09:00
D. Ben Knoble
e99f262c2f
omni: find last racket keyword for completion (#4293)
Otherwise it finds the first keyword, which is usually not relevant to the
cursor position, and incorrectly calculates the completion position.
2022-09-08 16:57:43 +09:00
Nate Pinsky
a83a3659ac
Fix typo in plug mapping for ale_go_to_implementation_in_vsplit (#4304) 2022-09-08 16:53:42 +09:00
Magnus Groß
9feba1148c
Implement buffer-wide virtual text support (#4289)
* 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-07 19:38:01 +09:00
Magnus Groß
4943b7d39f
Fix virtual text for vim 8.2 (#4291)
Regression was introduced in d93bc2baf7

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-09-06 19:35:13 +09:00
Shaun Duncan
6996d1c14d
Allow callbacks for floating preview popups (#4247)
* 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-23 20:22:52 +09:00
Magnus Groß
d93bc2baf7
Use native virtual-text for vim9 (#4281)
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 708e810414).
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-23 20:22:14 +09:00
Erik Westrup
992476982a
Put :ALEInfo in collapsible for bug reports (#4286)
To make the bug reports a bit more readable. See an example of usage
here: https://github.com/dense-analysis/ale/issues/4285
2022-08-18 06:51:01 +09:00
Hongbo Liu
7889983f89
fix #4276: honor b:ale_enabled for hover at cursor (#4277)
* fix #4276: honor b:ale_enabled for hover at cursor

* fix indention
2022-08-18 06:34:34 +09:00
Mo Lawson
233b681029
Add support for syntax_tree fixer (#4268)
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-09 21:11:20 +09:00
Nathan Henrie
5063804d44
Add openscad and sca2d support (#4205) 2022-08-07 16:27:17 +09:00
Tomáš Janoušek
e10fcf22dc
Prevent buffering of job output and excessive polling (#4259)
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: b42153eb17 ("Fix #4098 - Clear LSP data when servers crash")
2022-07-26 17:56:12 +09:00
Albert Peschar
854d606333
Add support for Dune (#4263)
* Add support for dune

* Add test

* Undo reformatting of Markdown file

* Refer to ale-ocaml-dune from ale.txt
2022-07-26 17:55:22 +09:00
0xHyoga
0ea53870b6
cairo support (#4256)
* cairo support

* supported languages txt

* add cairo to ale.txt
2022-07-22 13:05:08 +09:00
Horacio Sanson
5ef26c32da
Fix 4249 - Revert change to stop compl menu. (#4250)
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-14 07:25:42 +09:00
Michael Dyrynda
ad2f75e4b2
Add support for Laravel Pint (#4238)
* 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-07 21:42:21 +09:00
Marios S
a918f8c7bc
Improve struct and pointer autocompletion in C (#4231)
* 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-04 22:00:29 +09:00
Henrique Barcelos
d6f3d4976d
Allow shfmt fixer to use .editorconfig (#4244)
* 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-07-02 22:05:03 +09:00
Horacio Sanson
16cca1413f
Update tests to use latest neovim 0.7 (#4180)
* Update tests to use latest neovim 0.7

* Update CI to use neovim 0.7

* Fix conflict
2022-06-29 13:17:00 +09:00
Steven Leiva
39d1a10589
Update ale-haskell.txt (#4241)
Change `b:ale_haskell_his_executable` to `b:ale_haskell_hls_executable`.
2022-06-26 16:04:59 +09:00