Commit Graph

1612 Commits

Author SHA1 Message Date
w0rp
14350dbb0d Close #3368 - Supercharge :ALEInfo
Make a series of sweeping changes to make :ALEInfo more useful.

1. Deprecate :ALEInfoToClipboard and support :ALEInfo -clipboard
2. Permit :ALEInfo -clip as a shorthand for :ALEInfo -clipboard
3. Support :ALEInfo -preview to render in the preview window
4. Support :ALEInfo -echo for the classic :ALEInfo mode
5. Change the default mode to 'preview', and make it configurable
6. Add syntax highlighting for ALEInfo in preview mode
7. Add a convenience to look up documentatation that explains itself
8. Don't show an empty 'Linter Variables' section
2023-09-06 00:21:58 +01:00
w0rp
551fbcfb09 Add an option to save hidden buffers
When commands are run, it can be useful to just save the hidden buffers
so language servers immediately get updated with changes to files
without you having to manually save each file. You can now enable this
by setting `g:ale_save_hidden` to `1`.
2023-09-06 00:17:27 +01:00
w0rp
8ba7ae818c Close #4461 - Use rust-analyzer by default
Use rust-analyzer by default instead of rls, as rls has been deprecated.
2023-09-05 21:45:34 +01:00
Henrique Barcelos
64ddf457e1 Feature: add forge fmt as a fixer for Solidity files (#4598)
* feat: add `forge fmt` as a fixer for Solidity
2023-09-05 18:34:39 +01:00
Magnus Groß
59e455b4d8 Improve ALEFix performance for neovim (#3974)
* Avoid performance problems with setbufline() and Treesitter

Call nvim_buf_set_lines() instead.

Since this is a performance problem only in Neovim (Treesitter is only
available there), it doesn't matter that this API is unavailable in Vim.

Note: nvim_buf_set_lines() returns E5555, when set nomodifiable is on.

Fixes #3669

* Avoid sign flickering

The signs flickered because nvim_buf_set_lines() removes all signs from
lines that it touches, which will immediately be readded by Ale (causing
the brief flicker). This is intended behaviour in neovim [0].

Neovim itself faced this problem in their own LSP formatting sync,
although they had the problem with marks instead of signs [1].
Similar to how neovim fixed it by storing and restoring the marks [2],
we can do the same thing with signs.

In fact it is easier with signs, because sign_placelist() will just
ignore and skip invalid line numbers, so we don't need to filter signs
that are not valid anymore.

[0] https://github.com/neovim/neovim/issues/10880#issuecomment-526466042
[1] https://github.com/neovim/neovim/issues/14307
[2] https://github.com/neovim/neovim/pull/14630
2023-09-05 14:36:17 +01:00
Peter Benjamin
3bedafc29a fix(yaml): make actionlint respect config (#4584)
* fix(yaml): make actionlint respect config
* docs: update actionlint docs
* chore: update author & add description
* test: move actionlint test to test/linter/
2023-09-05 14:33:41 +01:00
jiz4oh
115ad17ace Support format xml file which haven't yet persisted at the disk (#4585)
Support format xml file which haven't yet persisted at the disk
2023-08-20 10:43:31 +01:00
Tomáš Janoušek
fe38101db7 Fix error loading "text" syntax for hover (#4574)
rust-analyzer sometimes returns a hover result with language being
"text", but there's no syntax/text.vim, so this would fail with:

    Error detected while processing function <SNR>150_VimOutputCallback[6]..<lambda>8[1]..ale#lsp#HandleMessage[30]..ale#hover#HandleLSPResponse[42]..ale#floating_preview#Show[13]..<SNR>161_VimShow:
    line   13:
    E484: Cannot open file syntax/text.vim

Only including the file when it actually exists fixes this.
2023-08-15 11:20:47 +01:00
Matheus Werny
951b280bd5 yamlfmt (#4587)
* Added the fixer, wrote tests and tested it
2023-08-15 10:15:06 +01:00
Rodrigo Mesquita
15cbc0e912 Close #4579 - Support numhl highlights for vim >= 8.2.3874
In #2637, support for numhl highlights was added for nvim.

In the meantime, vim added support for numhl highlights in patch 8.2.3874.

This patch allows numhl highlights to be enabled in ALE for vim >= 8.2.3874 too.
2023-08-05 18:10:03 +01:00
Oskar Haarklou Veileborg
af42e0b510 floatwin: use win_execute in NeoVim for commands when it exists (#4532) 2023-08-01 21:30:23 +01:00
Amadeus Demarzi
1174b3b81e Don't echom if not in normal mode (#4560) 2023-07-31 08:39:30 +01:00
Wooter
b216892f0c Communicate support for markdown to the lsp server (#4450) (#4453) 2023-07-25 10:43:57 +01:00
Arash Mousavi
93a4f70414 Add erb-formatter support (#4546) 2023-07-24 21:38:52 +09:00
Craig Rodrigues
f34016a552 feat: enable golangci-lint by default (#4536)
This replaces golint and gometalinter which are both deprecated
2023-07-24 21:30:00 +09:00
LittleKey
969f7b080f Add end_col of matched forbidden word (#4556) 2023-07-24 10:37:49 +09:00
Craig Rodrigues
29e5ffe35a Remove golint supported-tools (#4535)
golint has been deprecated and was archived in 2019
2023-06-27 18:52:50 +09:00
lucas-str
9fe9f11521 Add support for npm-groovy-lint (#4495)
* Add support for npm-groovy-lint

* Add doc and tests for npm-groovy-lint

* Use ale#util#FuzzyJSONDecode instead of json_decode
2023-05-06 09:02:07 +09:00
Pat Brisbin
61248e1453 Add fourmolu fixer (#4501)
* Add fourmolu fixer

Fourmolu is aversion of Ormolu that supports configuration. This fixer
was modeled after the Ormolu one, but using the "stack executable"
approach of the Brittany and Stylish Haskell fixers.

* Sort supported-tools.md
2023-04-22 22:05:50 +09:00
David le Blanc
41e12fd640 Added column alignment for errors (#4473) 2023-03-31 10:50:48 +09:00
Guillermo R. Roig Carralero
7dbd3c96ac Add support for rustywind fixer (#4477) 2023-03-26 15:38:24 +09:00
Wilson E. Alvarez
e1a0781f9d Fix ale#util#GetBufferContents and propagate use (#4457)
* Use newline characters instead in ale#util#GetBufferContents
* Propagate use of ale#util#GetBufferContents
* Add ale#util#GetContentBuffer test
2023-03-14 20:55:28 +00:00
Daniel Harding
007c5b1152 Clear virtualtext no matter how enabled (#4475)
When toggling ALE off, clear the virtualtext even when g:ale_virtualtext_cursor is 'all'.
2023-03-08 14:47:58 +00:00
w0rp
bb691d6dee #2172 - Expand PATH in the shell for automatic virtualenv 2023-03-07 01:59:11 +00:00
Albert Peschar
6ae26df22b Add deadnix linter (#4443) 2023-03-07 01:31:14 +00:00
Oskar Haarklou Veileborg
c8e9146049 Fix #3616, #3903 - Use proper floating window borders in neovim (#4417)
* Fix #3616, #3903 - Use proper floating window borders in neovim

* Compatibility w. length 6/7 ale_floating_window_border values
2023-02-21 18:25:10 +09:00
w0rp
ae2d47ba83 Attempt to fix auto virtualenv on Windows 2023-02-08 09:44:25 +00:00
w0rp
4c162877e2 #2172 Auto PATH with ale_python_auto_virtualenv
Automatically set `PATH` for some Python linters that seem to need it
when g:ale_python_auto_virtualenv or b:ale_python_auto_virtualenv is
`1`.
2023-02-08 09:11:31 +00:00
w0rp
f2a21c960a Add support for lua-language-server 2023-02-08 01:14:47 +00:00
Nathan Henrie
e1ae009bac Add alejandra for nix (#4435)
- Fixes https://github.com/dense-analysis/ale/issues/4434
2023-02-07 17:24:52 +09:00
Ben Boeckel
116d713f63 diagnostics: support sending ALE output to Neovim's diagnostics API (#4345)
Support replacing ALE's display of problems with sending problems to the Neovim diagnostics API.

:help g:ale_use_neovim_diagnostics_api

Co-authored-by: David Balatero <dbalatero@users.noreply.github.com>
Co-authored-by: Georgi Angelchev <angelchev@live.co.uk>
Co-authored-by: w0rp <devw0rp@gmail.com>
2023-01-29 17:25:09 +00:00
Sean Enck
0af4899605 Add gopls format as a Go fixer 2023-01-28 00:20:29 -07:00
Yining
b6f6d84c25 add: pycln as a python linter and fixer (#4415)
this commit adds pycln as a Python linter and fixer, together with some
tests and documentation. It addresses #4340

pycln repo: https://github.com/hadialqattan/pycln
2023-01-27 10:24:18 +09:00
w0rp
69c1dc8b5f Fix #4413 - Avoid errors for invalid buffers in ale#virtualtext#Clear 2023-01-06 19:02:35 +00:00
w0rp
0f51c3b01b Fix #4410 - Ignore prop_add errors 2023-01-04 15:13:21 +00:00
Leon
1ee863002a Fix #4408 - Trigger floating preview autocommand on BufWinLeave and WinScrolled (#4409) 2022-12-30 18:47:43 +00:00
w0rp
457e0a50f1 Fix #4331 - Shift line 0 errors to line 1 for virtual-text 2022-12-27 23:40:49 +00:00
w0rp
a18472cc58 Close #4401 - Use subtle defaults for virtual-text
Default virtual-text to the Comment highlight group and prefix
virtual-text messages with comment text for each language by default.

Messages can now be formatted with `%type%` to print the error type.

The Vim 9.0 version has been updated in the Docker image to add test
coverage for virtual-text.
2022-12-27 23:11:53 +00:00
w0rp
98b2ef438e #4400 - Remove virtual-text defaults from highlight.vim 2022-12-27 16:24:10 +00:00
w0rp
fe61e00040 Fix #4400 - Separate virtual text highlight groups to avoid errors 2022-12-27 15:36:35 +00:00
w0rp
3cb4f33a9a Fix #4399 - Manage virtual-text state better 2022-12-26 15:56:34 +00:00
w0rp
31010ad1d1 Update ALE to v3.3.0 2022-12-25 20:30:21 +00:00
w0rp
300ea232de Close #4397 - Add human-readable values for g:ale_virtualtext_cursor 2022-12-25 19:29:16 +00:00
w0rp
2ae04b310a Enable ruff for Python by default 2022-12-25 15:13:10 +00:00
Yining
1e398202b9 fix: ruff not registered as fixer (#4393)
this commit fixes the issue reported at:
https://github.com/dense-analysis/ale/issues/4301#issuecomment-1359289391

it also had some code refactored and
tests added for ruff as fixer (missed in PR #4347).
2022-12-22 09:53:01 +09:00
Matheus
5ce2bf84ca Added support for more file types for clang-format. (#4367) 2022-11-25 13:16:16 +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
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
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
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