Commit Graph

1653 Commits

Author SHA1 Message Date
Braden Kelley 5606606b32
fix(biome): send correct language to lsp proxy (#4773)
Since Biome understands `typescriptreact` and `javascriptreact` as
languages, we can send the `filetype` to the LSP, rather than only
sending `typescript` for both `ts` and `tsx` files, or `javascript` for
`js` and `jsx` files.

fixes: #4752
2024-06-24 06:32:24 +01:00
Braden Kelley f2aef2f510
fix(biome): run all enabled biome fixers (#4763)
- based on biome config, will format, lint, and/or sort imports
- adds variable to apply unsafe fixes, disabled by default

fixes: #4754
2024-06-21 09:21:19 +09:00
Braden Kelley 0cd64c87bf
fix(biome): use temp file instead of stdin (#4775)
biome handles utf8 characters differently between files and stdin, and
in some cases can replace emojis with ascii characters when using stdin

refs: biomejs/biome#2604
2024-06-21 08:19:55 +09:00
w0rp c7c41e1574
Run actionlint by default on GitHub files
Detect paths containing .github as a directory for running actionlint
by default on YAML filetypes.
2024-06-02 19:07:06 +01:00
ghsang adaa7f6f62
Fix eslint cwd strategy (#4781)
Change eslint cwd to follow configuration file paths.
2024-05-31 09:30:37 +02:00
Bryan Garber 70eeae54fb
Implement listing all returned results for LSP textDocument/implements (#4755)
* Fix list of definitions
* Fix when LSP returns single response on definition/implementation
* Update tag stack on ShowSelection
2024-05-01 11:58:06 +01:00
Mathew Attlee adee52fba0
feat: detect ESLint flat config (#4753) 2024-04-20 19:14:48 +01:00
Arash Mousavi 7516e2e484
Add htmlbeautifier support (#4751) 2024-04-17 23:58:28 +09:00
Kevin Van Leer 6db58b3379
Added fix subcommand options (#4746)
php-cs-fixer command line options are ordered. Options that appear after the
main command are applied to the main command. Options that appear after the
subcommands are applied to the subcommands. This change enables a user to
specific fix options (like --config). This change also sets the plugin to
find the the configuraiton file in the current project tree. This matches
the default behavior of other linters like eslint.
2024-04-07 17:34:02 +09:00
Horacio Sanson 8f9197b79b
Fix 4740 - add hurlfmt linter (#4741)
* Fix 4740 - add hurlfmt linter

* Fix 4740 - add hurlfmt fixer

* Fix wrong comments

* Add end_col to qflist

* Fix test
2024-03-12 09:51:49 +09:00
Mathew Attlee 5a8287e676
Add support for .eslintrc.cjs (#4742) 2024-03-12 08:53:59 +09:00
David Dominguez 4d132b3ffa
Fix biome formatter (#4733)
* Fix biome formatter

Added escaped executable to the biome#Fix command

* Added fixer callback test
2024-03-02 16:05:47 +09:00
Horacio Sanson 8d199d8c10
Fix 4721 - force latex language id on cspell for tex filetype (#4724)
* Fix 4721 - force latex language id on cspell for tex filetype

* Fix tests
2024-02-27 08:54:45 +09:00
Filip Gospodinov 9cc8383fe9
Add full support for biome (#4705)
* Revert "Add biome support for javascript (#4701)"

This reverts commit 8922478a83.

* Add support for biome
2024-02-24 16:51:39 +09:00
Sam 5e8904cd3d
Add support for gjs template linting using embertemplate lint (#4653)
* super hacky way to get ember template lint to work on gjs files

* Clean up code so we use a handler which means we reuse all the config
also moves handler to the glimmer directory so it only fires
for gjs files

* fix tests
2024-02-23 13:30:12 +09:00
Brandon Maier 38c31302da
Add wiki link to ShellCheck linting (#4681)
The ShellCheck integrations wiki suggests providing users with more
info by linking back to the ShellCheck wiki.

https://www.shellcheck.net/wiki/Integration#linking-to-the-wiki
2024-02-22 11:11:56 +09:00
Oliver Albertini 506d392f6a
[hover] ParseLSPResult sets language 'text' for missing spec (#4699)
I have an LSP that is returning markdown code blocks on Hover with no
language specified, e.g.

````
```
Foobar
```
````

As a result, you get "```" in the message line which is not that useful.

I made the regex to catch the first code fence accept empty language as
well, and if it's empty, we set it to "text".

This makes it so that LSPs that return no language still produce legible
restuls on the message line.

Co-authored-by: Oliver Ruben Albertini <ora@fb.com>
2024-02-22 11:10:32 +09:00
Jonathan Palardy 1b24bd3f5f
Support 'gleam format' as Gleam fixer (#4710) 2024-02-06 10:16:25 +09:00
Akiomi Kamakura 8922478a83
Add biome support for javascript (#4701) 2024-01-14 21:11:14 +09:00
ohakutsu 531970533a
Add language id of cspell (#4700) 2024-01-14 21:05:38 +09:00
Yining 3dbf0b2202
add: support for `rubyfmt` as `ruby` fixer (#4678)
[rubyfmt](https://github.com/fables-tales/rubyfmt) is a formatter for
 `ruby` code.

This commit adds support for `rubyfmt` as a `ruby` fixer (#2991),
together with some tests and documentation.
2024-01-14 20:59:20 +09:00
Brandon Maier d63f5e6a77
Add end_col and end_lnum to ShellCheck (#4692)
* Add end_col and end_lnum to ShellCheck

ShellCheck supports a JSON format mode which includes an 'endLine' and
'endColumn' field.

We must use the newer 'json1' format as it properly treats tabs as a
single character. 'json1' was not supported until v0.7.0 in 2019[1], so
we maintain support for the older GCC based format.

[1] https://github.com/koalaman/shellcheck/blob/v0.9.0/CHANGELOG.md?plain=1#L121

* Add wiki link to ShellCheck json output
2024-01-14 20:47:42 +09:00
Ingo Meyer 562680e786
Use different group names for signs and virtual text (#4704)
Since Neovim commit c4afb9788c4f139eb2e3b7aa4d6a6a20b67ba156, the sign
API uses extmarks internally. Virtual text is already rendered using
extmarks. ALE uses the same group name for both signs and virtual text
and as a result, both are placed in the same extmark group. Since ALE
deletes all extmarks in the virtual text group after all signs have been
placed, no signs are ever shown. This commit fixes this by renaming the
sign group from `ale` to `ale_signs`.
2024-01-14 20:29:10 +09:00
MD 71718722b2
Add support for Scarb in `cairo` files (#4669)
* Add support for Scarb in `cairo` files
* specify if linter should run on saved
2023-12-08 22:13:37 +00:00
Yining 32ee7039d0
add: support for `nickel format` as `Nickel` fixer (#4665)
Nickel(https://nickel-lang.org/) is a configuration language, like
Jsonnet, Cue, Dhall.

`nickel`(https://github.com/tweag/nickel) is the main command to run,
export and also format Nickel code.

this commit adds `nickel format` as a Nickel fixer, together with some
tests and documentation.
2023-12-07 14:55:14 +00:00
Joseph Henrich 5cddc4c8e1
Adding support for ruff formatter (#4645) 2023-11-16 12:12:40 +00:00
w0rp 53b01d6a54
Fix #4499 - Fix solhint >= 3.4.0
Fix solhint for versions >= 3.4.0, while still supporting older
versions.

The solhint linter code has been moved out of the `handlers` directory
as it does not need to be shared between different filetypes. Code has
been simplified.

Co-authored-by: Henrique Barcelos <16565602+hbarcelos@users.noreply.github.com>
2023-09-17 17:24:23 +01:00
w0rp dca621b675
Fix #4505 - Handle spaces in markdown fences 2023-09-16 23:04:46 +01:00
w0rp e412fa34ff
Fix #3115 - Fix environment variable quoting on Windows 2023-09-16 22:33:59 +01:00
w0rp ae1d051504
#4454 Clean up more tests and code
* Remove some tests we no longer need
* Delete blocks of redundant code
* Compress some tests together to simplify them
* Remove a little code for ancient linter versions
* Escape more executables we didn't escape before
* Rename a deno option that didn't match our conventions
2023-09-16 22:23:30 +01:00
w0rp cf270a1ada
Stop supporting ale_lsp_root
We renamed the ale_lsp_root setting to ale_root long ago. Stop
supporting the old setting name.
2023-09-16 17:17:42 +01:00
w0rp 1799f8bec6
Close #4458 - Add an ALEStopLSP command
Add an ALEStopLSP command to stop all language servers that match a
given name. Completions are available for the command. This makes it
possible to keep other language servers running other than the one
you're interested in stopping.
2023-09-16 17:03:02 +01:00
w0rp be69af2705
#4607 No conflicts with nvim-lspconfig by default
Default `g:ale_disable_lsp` to a new mode `'auto'` by default. With this
setting applied, ALE will now check for the presence of nvim-lspconfig
and automatically turn off particular LSP linters if already configured
via nvim-lspconfig.

For users that do not use `nvim-lspconfig`, everything should work as
before.
2023-09-14 00:40:56 +01:00
w0rp 1bf445c6d5
Print the most severe problem with virtualtext
Fix the ordering of virtualtext so we print the most severe problem on a
line. If two problems are the most severe, we will print the left-most
problem.
2023-09-10 17:44:25 +01:00
w0rp 385dc4130c
Show a single virtualtext message by default
Show only a single virtualtext message per line by default. The setting
can be configured to whatever the user wants. This default prevents
several linters from spamming the editor with messages that run off into
the right margin.

Documentation now clarifies that problems have a predictable order, and
which message will come first.
2023-09-10 17:22:16 +01:00
w0rp 92267a14ba
Remove backwards compatibility with ancient setting names 2023-09-09 23:13:44 +01:00
w0rp 7b56ddc3f6
Close #4481 Try .venv first, drop ve-py3
.venv was going to be the officially recommended default virtualenv
directory name in PEP 704, which was not accepted. Still, poetry uses
this name by default, as do other projects. We can deem it the first
name we should try to search for.

ve-py3 was a directory name I can't find mentions of online, and was
used in my own projects during the days of migrating from Python 2 to 3.
We can just drop it, and people can update their settings if they still
need it.
2023-09-09 22:57:01 +01:00
w0rp 65f0fd0d6a
#4442 - Use the same default signs as Neovim diagnostics 2023-09-09 16:44:54 +01:00
w0rp dadc778451
#4605 Use a single time for InsertLeave emulation
Use a single timer for InsertLeave emulation to optimise it for many
buffers, and specifically lint the buffer we entered insert mode on.
2023-09-08 18:51:04 +01:00
w0rp dd3abf1ad9
Close #4605 - Emulate InsertLeave mode
Use a repeating timer to emulate InsertLeave mode for users who have not
rebound <C-c> to <Esc>, like many experienced Vim users do. This allows
ALE to start linting when you finish typing by default without having
to know about this quirk in Vim or Neovim.
2023-09-08 18:42:45 +01:00
w0rp bf55175b69
#4454 Clean up root test directory tests
Combine cases into smaller tests of tests and remove tests we no longer
need. Linter tests have been moved to where they should be.
2023-09-08 01:00:35 +01:00
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