Commit Graph

1551 Commits

Author SHA1 Message Date
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
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
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
D. Ben Knoble 0e99519500
racket: start completion in a full keyword (#4186)
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-23 09:13:28 +09:00
infokiller 91e8422d6d
Add pyflyby fixer (using its tidy-imports script) (#4219)
* add pyflyby fixer

updates

* pyflyby: add docs

updates

* add tests to pyflyby fixer
2022-06-16 22:41:57 +09:00
Isman Firmansyah 876140832c
Add support for actionlint options (#4216)
* Add support for actionlint options

* fix misaligned doc tags
2022-05-29 22:23:47 +09:00
Devin J. Pohly ae44f05600
Allow customization of all floating window borders (#4215)
* 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-27 13:41:06 +09:00
Arash Mousavi 3d7b3a6541
Add zig fmt support (#4198)
* Add zig fmt support

* Review changes

* Fix linter errors
2022-05-17 07:38:54 +09:00
Zhuoyun Wei 429f5a1447
Add support for Packer (#4192)
* 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-16 21:15:52 +09:00
Reza J. Bavaghoush 75d2413425
add rego support (#4199)
* add opa fmt fixer for rego files

* add opa linter

* add basic tests for linter and fixer

* add cspell to the docs
2022-05-16 21:14:11 +09:00
Fionn Fitzmaurice e6ca599e87
Look for .mypy.ini when finding project root (#4202)
We already check for mypy.ini, but the fallback .mypy.ini was ignored.
2022-05-15 12:20:16 +09:00
w0rp 044a6c956b
Close #4201 - Run vimls from Vader by default 2022-05-13 18:00:19 +01:00
Horacio Sanson 204e6294cf
Fix 4177 set default yaml linters (#4178)
* Fix 4177 set default yaml linters

* Fix 4177 set default yaml linters
2022-05-03 10:34:52 +09:00
bretello c694a24188
add yaml actionlint support (github actions) (#4173)
Co-authored-by: bretello <bretello@distruzione.org>
2022-05-03 10:03:05 +09:00
Dalius Dobravolskas 34892186e4
vscode-json-languageserver support (#4164)
* 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-30 12:33:48 +09:00
godbless d484347fb5
Add ALEGoToImplementation (#4160)
* Add go to implementation

* Add test cases for GoToImplementation

* Add documentation for GoToImplementation
2022-04-30 12:28:26 +09:00
godbless 3348222abc
Add CodeAction codeActionLiteralSupport Feature (#4163)
* 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-29 22:17:29 +09:00
Alex McKinney 607f33a1b0
Add buf linter and fixer (#4128)
* 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-06 17:00:59 +09:00
lykmast 1e997580fd
Handle ghc panic in haskell (#4145)
* Add primitive handling of ghc panic.

* PascalCase in function.

* Add simple test.
2022-04-06 16:59:50 +09:00
James Cherti 6c1f616c59
Add the buffer-local options 'b:ale_shell' and 'b:ale_shell_arguments'. (#4146) 2022-04-06 14:32:11 +09:00
Horacio Sanson c984daa0ec
Fix 4141 - Stop press enter prompt on long diagnostic messages (#4144)
* Fix 4141 - Stop press enter prompt on long diagnostic messages

* Fix 4139 - Check for array before join truncated_echo
2022-04-06 10:51:07 +09:00
w0rp d3df00b898
Fix test for echoing messages
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-01 14:35:07 +01:00
Amadeus Demarzi b3d1d6eecf
Use echon over echom for cursor echo (#3888)
* Problem messages no longer clutter `:messages`
* Messages are truncated better
2022-04-01 13:54:23 +01:00
João Costa bc406a846e
Set default value for insertTextFormat (#4124)
Co-authored-by: w0rp <devw0rp@gmail.com>
2022-04-01 12:41:05 +00:00
Horacio Sanson 0f55d371e9
Add neovim 0.6 to run-tests (#3998)
* 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-01 13:17:15 +01:00
Felix Maurer e81f005c78
Fix end line number when it exceeds the file (#4130)
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-04-01 17:13:27 +09:00
yoshi1123 c42fee3da5
Fix :ALEImport column position
Fix :ALEImport column position so it works with more language servers.

Co-authored-by: w0rp <devw0rp@gmail.com>
2022-03-20 13:20:33 +00:00
w0rp 560e6340ce
Bump ALE to v3.2.0 2022-03-05 01:24:43 +00:00
w0rp e5492e124d
Document default linter selections again 2022-03-05 00:43:56 +00:00
w0rp 87ade74b4d
Fix an argument name 2022-03-04 19:51:24 +00:00
Horacio Sanson c173b6243d
Enable autoimport by default (#4102) 2022-03-04 19:05:41 +00:00
yoshi1123 e490e87a60
Add eclipselsp jdt:// support for textDocument/definition (#4030)
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-04 19:03:27 +00:00
w0rp b42153eb17
Fix #4098 - Clear LSP data when servers crash 2022-03-02 16:51:50 +00:00
Horacio Sanson 47470eddc2
Sometimes end_lnum and end_col are not present (#4062) 2022-02-09 23:25:52 +09:00
Jerko Steiner 4a4516e3bf
Dispatch textDocument/didChange after rename (2) (#4049)
* 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-08 20:07:39 +09:00
Dalius Dobravolskas 0c276aac90
Allows to use quickfix for references. (#4033)
* 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.
2022-02-05 21:54:26 +09:00
nospam2998 a58b7b5efb
Treat ale_open_list integer values as thresholds (#4050)
Only open list window if the number of warnings or errors equals to or
exceeds the value of ale_open_list. No change when set to `1`.

Co-authored-by: cos <cos>
2022-02-04 17:56:48 +00:00
David Briscoe 5856c06775
Add ALEPopulateQuickfix and ALEPopulateLocList (#3761)
Closes #1810

Add ALEPopulateQuickfix and ALEPopulateLocList. They're not very useful
with ale's default auto-populate behaviour, so their useful configuration
is described in help.
2022-02-04 17:42:26 +00:00
Linda_pp 0d529d9b94
Add `naga` linter for WGSL support (#4047)
* Add WGSL support using `naga` command

* Add documents for wgsl

* Add test for `naga` linter

* Separate naga handler callback to hanlder/naga.vim
2022-02-04 16:29:28 +09:00
Horacio Sanson 5a5029b73d
Fix 4004 - Disable eslint by default for json. (#4023)
* Fix 4004 - Disable eslint by default for json.

This PR disables, or more correctly, excludes eslint from the list of
default linters for json files.

Also fixes elixir, go, json5, and jsonc files documentation and default
linters to make them consistent.

* Fix and improve tests
2022-01-05 22:33:00 +09:00
Nathan ac0495df6e
Add dprint fixer (#4024)
* Add dprint fixer

* Fix windows tests

* dd dprint documentation
2022-01-04 21:49:03 +09:00
Alex Piechowski 48f68598cb
Add auto-fixer for crystal (#4016) 2021-12-28 20:23:57 +09:00