Commit Graph

1551 Commits

Author SHA1 Message Date
Dalius Dobravolskas d0b5909fd8
#3442 Fix code fix clangd issue 2020-11-21 01:27:27 +00:00
w0rp 7c04ee5c20
Close #1466 - Add GVIM refactor menu support
Code actions and ALERename now appear in the right click context menu
for GVim by default.
2020-11-21 01:18:27 +00:00
Nathan Herald b74827de99
Look for node packages in .yarn/sdks as well 2020-11-17 17:12:04 +01:00
w0rp e9140c740b
cmp forwards, and reverse the code actions 2020-11-14 10:17:02 +00:00
Dalius Dobravolskas 01800a23ad
Support for LSP/tsserver Code Actions (#3437)
* Added tsserver and LSP code action support.
* tsserver refactors support added.
* Handling special case when new text is added after new line symbol.
* ale#code_action#ApplyChanges simplified.
* Initial attempt on LSP Code Actions.
* workspace/executeCommand added.
* Some null checks added.
* Add last column to LSP Code Action message.
* Pass diagnostics to LSP code action.

Previously ApplyChanges code was applied from top-to-bottom that required 
extra parameters to track progress and there was bug. I have changed code
to bottom-to-top approach as that does not require those extra parameters
and solved the bug.

Tested with typescript-language-server and it is working.
2020-11-14 10:15:17 +00:00
toastal 42e4b14861
Merge branch 'master' of github.com:dense-analysis/ale into dhall 2020-11-14 15:03:26 +07:00
Manoel Brunnen 96d8415946 Add -imacros to C flags 2020-11-03 23:10:15 +01:00
Jason Franklin 31b7a2de41
Move the test for buffer-local variables
The "ale#handlers#sh#GetShellType()" function currently falls back
to the file type without checking for buffer-local variables first.
This causes the function to return "sh" even when a script is known
by Vim to be a script of a more specific type (e.g., "bash").

The "ale#handlers#shellcheck#GetDialectArgument()" function then
erroneously uses this type even though a more fitting type should be
used instead.  Files without a "#!" line will be of type "sh" even
though they may have a ".bash" suffix.

This commit fixes the problem by checking for buffer-local shell
type variables (set by Vim) before falling back to the file type.
2020-11-02 10:59:16 -05:00
Jason Franklin 73632312c2
Use the proper term for the "#!" line 2020-11-02 10:46:56 -05:00
Jason Franklin 6c22936303
Remove a noise comment 2020-11-02 10:46:28 -05:00
cyy a49f664aea chang fishindent to fish_indent 2020-10-31 14:01:08 +08:00
cyy 9d1a71a5cb add doc and test 2020-10-31 14:01:08 +08:00
cyy 983c7e8805 add fish_indent fixer 2020-10-31 14:01:08 +08:00
Lyz 513e6ee972
feat: add autoimport fixer 2020-10-23 18:53:38 +02:00
David Wood b496c4b164
Add ormolu fixer.
This commit adds a fixer for the Haskell language, ormolu
(https://github.com/tweag/ormolu).

Signed-off-by: David Wood <david@davidtw.co>
2020-10-23 11:48:21 +01:00
StephenWithPH af5a8e1abf
add sbt as a suggested filetype for scalafmt fixer 2020-10-19 09:47:54 -07:00
w0rp 477eb89793
#3332 Implement :ALERename! for ignoring errors
:ALERename! now ignores errors for files that cannot be modified, and
modifies all other files.
2020-10-15 21:56:21 +01:00
ecly f125c11faa Update FindProjectRootIni with poetry.lock and pyproject.toml 2020-10-15 13:35:47 +02:00
Andrey Popp 96ec33e6d6 Use stdin/stdout to communicate with gofmt 2020-10-03 18:44:19 +03:00
fenuks 7186b0437f Add maven helper file; use maven wrapper if available instead of global 'mvn' executable 2020-09-30 00:11:57 +02:00
toastal 48cbf1cb36
dhall alias 2020-09-25 08:26:17 +07:00
Łukasz Woźniak 6bebdcfa30 Improves fixer performance for large buffers 2020-09-18 12:59:27 +02:00
Raphael Nepomuceno 9769565f88 Collapse spaces and lines in the completion menu. 2020-09-14 12:11:16 -03:00
toastal ed47008710
addressing missing docs + cleaning up older Dhall files 2020-09-14 10:13:11 +07:00
toastal b32954a46c
Merge branch 'master' into dhall 2020-09-14 08:54:07 +07:00
w0rp 08295ce174
Bump the ALE version to 3.0.0 2020-09-09 22:06:38 +01:00
w0rp 4ddf742643
Close #2522 - Check pylint on the fly
Newer versions of pylint will now check your code as you type. Older
versions will still only check the file on disk.

Co-authored-by: Oliver Wiegers <oliver.wiegers@gmail.com>
2020-09-09 21:45:15 +01:00
Christian Keil d1f48e5ede Remove unnecessary length check. 2020-09-09 17:49:21 +02:00
Christian Keil d3932c0242 Fix format linting error. 2020-09-09 17:44:09 +02:00
Christian Keil 20f6bebdf2 Fix handling of ranges at file end. 2020-09-09 17:30:41 +02:00
w0rp 6a367e44aa
Close #3003 - Show ignored linters in :ALEInfo 2020-09-08 22:19:13 +01:00
w0rp 7d90ff56d9
Close #3333 - Add an ALECompletePost event
Add an `ALECompletePost` event along with everything needed to make it
useful for its primary purpose: fixing code after inserting completions.

* `ALEFix` can now be called with a bang (`!`) to suppress errors.
* A new `ALELintStop` command lets you stop linting, and start it later.
2020-09-08 21:40:10 +01:00
toastal f07ecbc579
merge master -- apparently someone else added dhall? 2020-09-08 10:08:00 +07:00
w0rp b4b75126f9
Fix a completion error 2020-09-07 10:01:18 +01:00
w0rp c36053d4cc
Close #3268 - Implement :ALEImport
A new command, `:ALEImport`, has been added, which lets you import words
at your cursor if a completion provider can provide a completion for
that word which includes some additional text changes.
2020-09-06 22:37:37 +01:00
w0rp 5bc49d2047
Fix #3183 - Escape filename characters from LSP/tsserver 2020-09-05 21:46:39 +01:00
w0rp 844febb9fb
Fix #3322 - Apply rename changes correctly 2020-09-04 09:37:33 +01:00
w0rp 4a91f92f28
Merge pull request #3078 from jgehrig/jg-issue2958
Issue 2958: Addtional ^M characters on Windows
2020-08-31 08:31:44 +01:00
w0rp 25b572b3bf
Close #3205 - Avoid inserting completions by default 2020-08-29 17:36:25 +01:00
w0rp 6e2e51b154
Fix #2971 - Disable automatic completion while 'paste' is active 2020-08-29 17:27:53 +01:00
w0rp 7e0cdb53ec
Fix #3247 - Use --always-make for make -n by default 2020-08-29 16:05:49 +01:00
w0rp bc3a843e10
Add a missing `augroup END` line 2020-08-29 14:23:58 +01:00
Kimplul d9a7d6bc23 Improved macro handling in gcc 2020-08-29 15:17:20 +03:00
w0rp dd9ad9b5be
#3319 - Try to modify buffers later for ALEFix 2020-08-29 12:33:17 +01:00
w0rp 7d4ce4e6aa
Close #3325 - Apply new formatting where possible 2020-08-28 19:50:36 +01:00
w0rp 3d5a2690ce
#3325 - ale#path#BufferCdString now generates %s:h 2020-08-28 17:46:43 +01:00
w0rp 34e409ea21
Close #3285 - lint_file is now dynamic
`lint_file` can now be computed dynamically with a callback function,
which can return a deferred result, as per `ale#command#Run`. This
allows linters to dynamically switch between checking files on disk,
or checking code on the fly.

Some tests have been fixed on Windows.
2020-08-28 14:02:05 +01:00
w0rp b8c0ac2e61
Close #3309 - Add b:ale_lint_delay 2020-08-28 09:54:43 +01:00
w0rp 6874120405
Fix #3323 - Set default for g:ale_filename_mappings 2020-08-28 09:33:09 +01:00
w0rp 369e3876f0
#3324 - Enable rls by default 2020-08-28 08:23:10 +01:00
Sorin Iclanzan 80bd2e18d6
Set prettier working directory to where .prettierignore is (#3101)
Prettier does not use `.prettierignore` unless the current directory is the root where the `.prettierignore` file resides.

* Update Prettier tests
* Look for prettierignore to determine project root
2020-08-28 08:14:50 +01:00
w0rp ecd7abecc0
Fix #3319 - Force modifications to buffers 2020-08-27 21:29:13 +01:00
w0rp 7545b18ba1
Fix #3318 - Escape macros when parsing C flags 2020-08-27 21:17:24 +01:00
w0rp 6d843715f3
Fix C flag parsing and tests on Windows 2020-08-27 20:18:13 +01:00
w0rp af177d7825
#3318 Refactor C flag parsing to set up for quoting arguments 2020-08-27 19:33:43 +01:00
w0rp 719f3c62b0
#3266 - Catch echo visual selection errors 2020-08-27 13:57:20 +01:00
w0rp 5d3d33626c
Merge pull request #3310 from pbrisbin/master
Add dhall-format as a Fixer
2020-08-27 13:39:30 +01:00
w0rp 17605777d6
Fix #3317 - Parse -include from C flags 2020-08-27 13:05:50 +01:00
w0rp 66ff00c420
Fix #3316 - Repeat -relative for ALERepeatSelection 2020-08-27 12:41:07 +01:00
w0rp f5aa0e8457
Fix #3307 - Handle compile_commands paths better
ALE now converts paths from compile_commands.json files into absolute
paths and prefers matching against absolute file and directory names for
determining which flags to use for files. As a result, parsing
compile_commands.json to determine flags should work for a lot more C
and C++ projects.
2020-08-27 11:44:35 +01:00
w0rp a955f5dfa8
#3312 - Just check if additionalTextEdits is non-empty 2020-08-27 08:57:12 +01:00
w0rp 396fba7cca
Fix #3312 - Fix a false positive for auto imports
ALE was incorrectly detecting completion results from servers such as
rust-analyzer as wanting to add import lines when additionalTextEdits
was present, but empty.

Now ALE only filters out completion results if the autoimport setting is
off, and one of the additionalTextEdits starts on some line other than
the current line. If any additionalTextEdits happen to be identical to
the change from completion anyway, ALE will skip them.
2020-08-27 08:44:43 +01:00
patrick brisbin 447aea4af0
Add dhall-format as a Fixer
https://github.com/dhall-lang/dhall-lang
2020-08-25 09:34:34 -04:00
w0rp 3e2abe3f25
#2556 - Support modifiers for formatted filenames 2020-08-24 09:33:07 +01:00
Horacio Sanson 1a7366067a
Merge pull request #3302 from khaveesh/master
latexindent: Run fixer from stdin instead of a temporary file
2020-08-24 09:16:35 +09:00
w0rp ba3dd0d027
Close #2556 - Support filename mapping
ALE now supports mapping files between different systems for running
linters and fixers with Docker, in virtual machines, in servers, etc.
2020-08-23 19:55:42 +01:00
Khaveesh N 4bece27bd4
refactor(Fixer): Change latexindent to read from stdin instead of temporary file
This is a better strategy as it avoids creating temporary files and the delay that follows
2020-08-21 17:19:22 +05:30
awang 4d42ebc160
Keep -iframework if present in parsed C/C++ flags (#3057)
* Keep -iframework if present in parsed C/C++ flags
* Add test to make sure -iframework is parsed

Co-authored-by: Alex Wang <ts826848@gmail.com>
2020-08-20 00:09:02 +01:00
w0rp 90abb7e7ef
Try to fix Windows tests again 2020-08-19 01:22:43 +01:00
w0rp de7b0567b1
Try to fix tests on Windows 2020-08-19 01:10:33 +01:00
w0rp 361027eac6
Fix #3200 - Do not use -fstack-usage from parsed flags 2020-08-19 01:04:08 +01:00
w0rp e27d4377b5
Merge pull request #3178 from sudobash1/expand_at
Fixes #3092 - Implement loading `@file` c arguments
2020-08-19 00:15:34 +01:00
w0rp 5eda1df0a9
Remove features deprecated in previous versions 2020-08-18 23:03:43 +01:00
w0rp 4df352eee5
Fix #3294 - Fix hover off by 1, handle LSP server crashes 2020-08-18 01:48:07 +01:00
w0rp ac56574b55
Merge pull request #3046 from hsanson/2816-fix-standard-fix-doesnt-work
Fix 2816 - Standard fix does not work.
2020-08-17 21:44:19 +01:00
w0rp eb864730e2
Merge pull request #2906 from elebow/shelldetect-fall-back-to-filetype-if-no-hashbang
ShellDetect falls back to filetype if no hashbang (fixes #2886)
2020-08-17 21:29:16 +01:00
blyoa d5c1d84230
Add remark-lint for a markdown fixer (#2836) 2020-08-17 10:14:38 +01:00
w0rp 5a4fad6172
Fix #2899 - Handle tsserver default import completion 2020-08-14 01:55:54 +01:00
w0rp 2b2403a20d
Merge pull request #3144 from jamescdavis/dont_append_newline_when_noeol
don't append a newline to temp file when buffer is noeol and nofixeol is set
2020-08-14 00:32:28 +01:00
w0rp 8151e3e8fa
Merge pull request #2920 from ConradIrwin/prettier-standard-stdin
Fix prettier_standard to respect the configuration file
2020-08-14 00:27:41 +01:00
toastal f1080a2bbe
Dhall language support (fixes #2820) 2020-08-14 00:31:47 +07:00
w0rp 0b77766337
Merge pull request #3010 from kevinoid/ps1-powershell
Alias ps1 filetype to powershell
2020-08-13 13:45:49 +01:00
Horacio Sanson 8e6c7bff9a
Fix 1695 - Change rubocop fixer to use stdin (#3230)
* Fix 1695 - Change rubocop fixer to use stdin
* Update test_rubocop_fixer_callback.vader

Co-authored-by: Horacio Sanson <horacio@allm.inc>
Co-authored-by: w0rp <w0rp@users.noreply.github.com>
2020-08-13 11:25:07 +01:00
w0rp 64d4c951ae
Fix #3281 - Stop CursorHold flickering 2020-08-13 02:22:21 +01:00
w0rp 7c4b1d8444
Close #3274 - Handle basic LSP markdown formatting 2020-08-12 22:11:45 +01:00
Nihad Abbasov d5912b53dd
Restore old behavior of ALEFix command for Rubocop (#3237)
* Restore old behavior of ALEFix command for Rubocop

Since RuboCop 0.60 ALEFix command stopped to fix all found offenses. This change restores the 
previous behavior by allowing rubocop to fix all detected offenses.

* Fix tests
* Allow to configure auto-correct option for Rubocop
2020-08-12 14:04:54 +01:00
w0rp 2237f9b462
#2919 Use compile_commands.json for headers 2020-08-10 02:14:23 +01:00
w0rp 05210846e4
Fix #3278 - Handle UTF-8 in URI encoding/decoding 2020-08-10 02:03:41 +01:00
w0rp 9e1f511003
#3276 - Disable make -n by default again 2020-08-09 20:08:42 +01:00
w0rp affeed7a87
Enable C flag parsing by default
The options for parsing `make -n` and `compile_commands.json` flags
are now enabled by default, so people can start getting better flags
for their files by default.

`compile_commands.json` flags are now preferred over `make -n` results,
to make the options work better by default.
2020-08-09 04:23:32 +01:00
w0rp 6d502233d8
Close #3267 - Add a general autoimport setting 2020-08-09 02:32:47 +01:00
w0rp 8bfb5c6407
Merge pull request #2849 from DonnieWest/excludeTsserverWarnings
Allow the user to remove warnings from completions
2020-08-09 01:32:27 +01:00
w0rp 2d174db5b2
Merge pull request #3107 from daliusd/tslintfix
Fix tslint fixer not working issue (temporary file not found)
2020-08-07 19:52:18 +01:00
w0rp f741245f11
Fix #3273 - Handle missing keys in hover information 2020-08-07 12:34:45 +01:00
w0rp 19229e8e27
Close #2472 - Add support for pyright 2020-08-07 12:16:13 +01:00
w0rp 9bdabce8df
Fix #2907 - Handle dictionaries for capabilities 2020-08-07 10:54:38 +01:00
w0rp 667618b399
Merge pull request #3191 from mostfunkyduck/master
Fixes govet linter for go 1.13+, with tests
2020-08-07 08:54:17 +01:00
tsjordan-eng f17b74679f
fix cppcheck for 1.89+, and add column support (#3030)
* fix cppcheck for 1.89+, and add column support

In cppcheck 1.89 the output changed to be more like GCC. This commit
forces any version of cppcheck to output in that same format. This also
allows for ALE to pick up the linter's column information

* Add parameters to tests. Vader passes.

* Fix c cppcheck for v1.89
2020-08-06 20:50:44 +01:00
Andre Souto 5b3da60cea
Adds hdl_checker LSP support (#2804)
* Added hdl_checker support
* Added hdl_checker tests

HDL Checker searches for files when no config file is found, which could lead to very long searches when the user is not really on a project setting
2020-08-06 13:20:54 +01:00
w0rp 711c90c523
Merge pull request #3123 from liskin/ccls-build-dir
ccls: Detect build dir and set compilationDatabaseDirectory
2020-08-06 13:12:56 +01:00
w0rp cdd8d38e2f
Fix #3266 Part 2: Fix Harder 2020-08-06 09:36:00 +01:00
w0rp fa3a927ca3
Fix #3266 - Truncate hover messages for LSP too 2020-08-05 13:46:08 +01:00
w0rp 1bd7b3e4ad
Merge pull request #3196 from jeremija/autoimport-langserver-pr
Add autoimport and rename support for langservers
2020-08-05 13:35:48 +01:00
w0rp acf892c4d1
#1532 - Display hover information on CursorHold 2020-08-04 20:11:49 +01:00
Horacio Sanson 316c7c7372
Merge pull request #3259 from sblask/support-markdownlint-rules-with-multiple-slashes
Support markdownlint rules with multiple slashes
2020-08-01 13:22:22 +09:00
Sebastian Blask fbfeae0587 Support markdownlint rules with multiple slashes 2020-07-31 11:15:13 +12:00
jhlink 84a413350c fix: Replace hardcoded quotes with ale#Escape 2020-07-30 10:07:53 -04:00
jhlink d49b06e030 fix: Find proj_options in same dir for astyle 2020-07-30 09:29:33 -04:00
Sebastian Blask 7cada95683 Support markdownlint 0.19.0 and 0.22.0
Fixes #2965
2020-07-30 09:57:46 +12:00
Horacio Sanson 5338dbf680
Merge pull request #3231 from jhlink/add-astyle-for-c-formatting
Add astyle for C/C++ formatting
2020-07-29 22:08:46 +09:00
jhlink cef64424ce style: Resolve lint issue 2020-07-29 01:52:36 -04:00
jhlink 428c5f94da fix: Use ALE to reliably find project options 2020-07-29 01:36:45 -04:00
jhlink 5377272d20 fix: Change _options to _project_options 2020-07-28 19:48:27 -04:00
jhlink 0e6578cf65 fix: Remove explicit calls to file path in astyle 2020-07-26 22:05:14 -04:00
jhlink 75723e4522 doc: Add C++ desc in astyle entry in registry 2020-07-26 22:05:10 -04:00
jhlink 78295024e1 feat: Add project option file support for astyle 2020-07-26 21:11:37 -04:00
jhlink b25bb64a4d feat: Use stdin/redirection for astyle 2020-07-26 20:51:41 -04:00
jhlink 488df0fa41 feat: Add cpp to registry.vim 2020-07-25 20:22:10 -04:00
jhlink 076f9efbd9 feat: Add cpp support to astyle fixer 2020-07-25 20:20:47 -04:00
w0rp 70ab831001
Merge pull request #3119 from hsanson/2269-ktlint-stdin-support
Fix 2269 - use ktlint stdin.
2020-07-21 12:45:26 +01:00
Horacio Sanson ddf4e7e9ba Enable ktlint fixer for kotlin files. 2020-07-12 20:49:04 +09:00
jhlink d0b7a6e71f doc: Remove c++ from astyle 2020-07-10 19:06:22 -04:00
jhlink 6c58164094 feat: Add astyle to fix/register.vim 2020-07-10 17:47:01 -04:00
jhlink 7f881f66a8 feat: Add ALE fixer for astyle 2020-07-10 17:46:01 -04:00
Kevin Locke 106c27644b
eslint: Use cwd from executable location to fix nested projects (#3222)
* Split FindNearestExecutable from FindExecutable

The path searching in ale#node#FindExecutable() will be useful for
eslint.  Refactor it into a separate function so it can be used without
regard for the state of the _use_global and _executable variables.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>

* eslint: Set project root from local executable

Using the nearest directory with node_modules does not work correctly
for nested projects where the eslint dependencies are in the outer
project.  For example:
https://github.com/dense-analysis/ale/issues/3143#issuecomment-652452362

Adopt the behavior of SublimeLinter, which runs from project_root
determined by the presence of the eslint executable in node_modules/.bin
(or eslint in dependencies/devDependencies of package.json, which we can
add later as necessary).  See [NodeLinter#find_local_executable].

[NodeLinter#find_local_executable]: https://github.com/SublimeLinter/SublimeLinter/blob/056e6f6/lint/base_linter/node_linter.py#L109

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2020-07-08 14:42:01 +01:00
Kevin Locke b3c6db173a
Run ESLint fixer from project root, where possible (#3096)
* Split eslint#GetCdString from eslint#GetCommand

Move the code for finding the project root and building the cd string
into a separate function so that it can be reused in the eslint fixer.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>

* Run ESLint fixer from project root dir

To match the ESLint linter, as changed in 9ee57d43 (which I forgot to
apply to the fixer, whoops).

Fixes: #3094
Closes: #3095

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2020-07-01 17:00:21 +01:00
w0rp 1428c7b29e
Update the internal ALE version to 2.7.0 2020-06-11 19:21:17 +01:00
Jerko Steiner b29e9867e8 Add test for LSP autoimport 2020-05-31 11:46:10 +02:00
Jerko Steiner b339a8bfa0 Add support for rename (documentChanges) 2020-05-31 11:00:53 +02:00
Jerko Steiner 4062b05669 Fix completion with langserver (autoimport in go) 2020-05-31 11:00:53 +02:00
mostfunkyduck 35c7c297b6 Fixes govet linter for go 1.13+, with tests 2020-05-25 11:46:16 -04:00
Stephen Robinson b209315714 Fixes #3092 - Implement loading `@file` c arguments 2020-05-20 18:15:52 -07:00
Ian2020 ca97f32258 Use a function to define shellcheck linters and vars needed, fixes tests 2020-05-08 12:55:54 +01:00
James C. Davis 15d590ee5e
fix: don't append newline when buffer is noeol and nofixeol 2020-04-30 15:00:10 -04:00
Ian2020 716f9a9bbb Fix linting issue - indentation incorrect 2020-04-28 20:53:42 +01:00
Ian2020 d4e1c57026 Moved common code to ale handlers, updated bats doc 2020-04-28 17:46:15 +01:00
Tomas Janousek 4fbfcc9dec ccls: Detect build dir and set compilationDatabaseDirectory
Fixes #2621
2020-04-18 13:57:57 +02:00
Yuto 93a13d7353
Broken message in pycodestyle (or any other Linters whose name include 'code') (#3114)
* Swap substitution order for echoed message

This prevents 'code' string in liter_name to be substituted by accident.
Linters including pycodestyle have been affected by this problem.

* Add test for linter whose name contains 'code'

Test for c525db8cb4088d02448c5ddcf4a80ffa028c3181
2020-04-18 11:59:26 +01:00
Horacio Sanson 5035281cb9 Fix 2269 - use ktlint stdin.
Use stdin flag instead of temporary files. This allows ktlint to work
with .editorconfig files.
2020-04-18 15:27:11 +09:00
w0rp dc054f30c8
Merge pull request #2823 from jeremija/do-not-save-on-autoimport
Do not save after ALERename and ALEOrganizeImports
2020-04-17 17:32:36 +01:00
Horacio Sanson 16cd59805b
Merge pull request #3050 from StarryLeo/fix-vim-sign-priority-patch-check
Fix vim sign priority patch check
2020-04-17 22:22:03 +09:00
w0rp 82f734a7c2
Closes #3019 - Implement default navigation
Default navigation for commands that jump to new locations has been
implemented with the `ale_default_navigation` variable, and all commands
that jump to locations now support `-tab`, `-split`, or `-vsplit`
arguments for overriding the default navigation behavior.
2020-04-15 16:50:13 +01:00
Dalius Dobravolskas 891852de71
Fix tslint fixer not working issue (temporary file not found) 2020-04-15 17:30:19 +03:00
John Gehrig 1c6b9354a8 Issue 2598: Addtional ^M characters on Windows
Windows may insert carriage return line endings, which ALE does not handle
well. These characters should not be displayed.

Adds a line to remove these characters for all messages.
2020-03-26 09:25:18 -04:00
StarryLeo 302ce71931 Fix vim sign priority patch check
With Vim 8.2 released, the previous check method is not accurate enough.
2020-03-15 14:58:38 +08:00
Horacio Sanson c207d6a550 Fix 2816 - Standard fix does not work.
The standard linter --fix fails if the file being input is not relative
to the project root (https://github.com/standard/standard/issues/1384).

This MR attempts to fix this by changing the command so the input file
is relative to the project root and the output is to a temporary file.

Preliminary tests with toy javascript projects seem to indicate this
works fine.
2020-03-12 16:29:46 +09:00
w0rp bbe5153fcb
Fixes #2982 - Implement g:ale_exclude_highlights
Particular highlights can now be excluded by providing Lists of regular
expressions.
2020-03-11 12:52:41 -04:00
w0rp 8f7ccdc5e9
Refactor the "s:LoadArgCount()" function (#3025)
* Refactor the "s:LoadArgCount()" function

Previously, this function would always set "v:errmsg" on the first
call with a given function.  This is because autoloaded functions
are not defined on the first call.

A number of improvements have been made:
 - a useless local function ("l:Function") is removed
 - the "execute()" builtin captures the output, instead of ":redir"
 - a ":try" block handles the case where a function is not defined
 - a useless ":if" is removed since ":redir" always defines the var
 - confusing quoting is re-written (remove double "'" chars)

Fixes: #3021
2020-03-04 20:56:22 +00:00
Kevin Locke 8c0b0f085f Alias ps1 filetype to powershell
Rather than requiring users to alias ps1 to powershell themselves,
include it in s:default_ale_linter_aliases.  Since [vim-ps1] is a
popular (the only?) PowerShell ftplugin and there do not appear to be
any other uses of ft=ps1 on vim.org, this seems like a safe and
reasonable default.

[vim-ps1]: http://www.vim.org/scripts/script.php?script_id=1327

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2020-02-16 14:03:41 -07:00
Andrew Lee 07ee4d39c5
misc: change email address for @ndrewtl
This is kind of a peculiar reason for a PR, but I no longer control the email listed. I want to change it to avoid people getting the wrong email for me. Also, I still control the domain, but if at any point I don't, I want to put down in writing that if you get an email from this, it's not from me.
2020-01-28 10:47:37 -08:00
Jerko Steiner 0cb432cb82 Add TypeScript autoimport support for deoplete (#2779)
* Add autoimport support for deoplete

* Fix test_deoplete_source.py

* Use callback instead of is_async for deoplete

Shuogo, the author of Deoplete, does not recommend using the `is_async`
option:

> I think is_async is not recommended. It is not so useful and broken.
> You should use callback system instead.

Link: https://github.com/Shougo/deoplete.nvim/issues/1006#issuecomment-526797857

Incidentally, the same thread mentiones an issue started by w0rp:
https://github.com/Shougo/deoplete.nvim/issues/976

The deoplete docs also say is_async is deprecated:

> is_async        (Bool)
>     If the gather is asynchronous, the source must set
>     it to "True". A typical strategy for an asynchronous
>     gather_candidates method to use this flag is to
>     set is_async flag to True while results are being
>     produced in the background (optionally, returning them
>     as they become ready). Once background processing
>     has completed, is_async flag should be set to False
>     indicating that this is the last portion of the
>     candidates.
>
>     Note: The feature is deprecated and not recommended.
>     You should use callback system by
>     |deoplete#auto_complete()| instead.

Link: https://github.com/Shougo/deoplete.nvim/blob/master/doc/deoplete.txt

Co-authored-by: w0rp <w0rp@users.noreply.github.com>
2020-01-01 19:00:41 +00:00
w0rp 7a4f5cefba
Merge pull request #2942 from PsiPhire/master
Allow popup to be used instead of preview in completeopt
2020-01-01 18:43:53 +00:00
w0rp 6ad8836c68
Merge pull request #2937 from kevinoid/eslint-run-from-project-root
Run ESLint from project root dir where possible
2020-01-01 18:30:01 +00:00
w0rp 25e457595a
Merge pull request #2828 from akhilman/hover-to-preview
Add option to show hover messages in preview.
2020-01-01 18:21:00 +00:00
Jerko Steiner 493705336c Add old check for bufline api 2019-12-29 15:08:22 +01:00
Zander Lee 4cbe16197c
Allow popup to be used instead of preview in completeopt 2019-12-22 09:35:29 +01:00
Kevin Locke 9ee57d4362 Run ESLint from project root dir where possible
ESLint 6 loads all plugins/configs/parsers relative to the project root
which, by default, is the directory in which ESLint is invoked, as
described in [ESLint RFC 2018-simplified-package-loading].

Therefore, ALE should run ESLint from the project root, when possible,
so that dependencies will load.  This commit does so.

[ESLint RFC 2018-simplified-package-loading]: https://github.com/eslint/rfcs/blob/master/designs/2018-simplified-package-loading/README.md

Fixes: #2787

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2019-12-17 12:25:44 -07:00
Conrad Irwin efe120ce9a Fix prettier_standard to respect the configuration file
Before this change, prettier_standard would run and ignore any
.prettierrc, now it will respect the configuration of the file being
linted.

This change relies on prettier-standard 16.1.0 for the --stdin-filepath
flag, but is backward compatible: older versions of prettier-standard
will ignore the unknown flag and continue to run with no configuration
file.
2019-12-04 23:15:41 -08:00
Horacio Sanson 5f95d032ee Fix 2891 - eslint not showing errors.
ESLint errors are contained in an array that can contain different
stuff other than JSON error messages. This patch iterates over the whole
array ignoring any non-json data.
2019-11-26 13:37:25 +09:00
Eddie Lebow 1997a8f7e2
ShellDetect: fall back to filetype if no hashbang
Some files lack a hashbang line but still have an unambiguous filetype.
For example, the file `.zshrc` has the filetype `zsh`.

Augment ale#handlers#sh#GetShellType to fall back to the filetype if
no hashbang line can be found.
2019-11-23 00:34:40 -05:00
w0rp b91d82bfaa
Merge pull request #2847 from DonnieWest/allowUserToCustomizeItems
Allow user to customize items
2019-11-15 09:34:24 +00:00
w0rp 9005a62dc2
Clean up the nimpretty code 2019-11-14 14:50:21 +00:00
w0rp 7665559d0e
Merge pull request #2660 from YPCrumble/master
Add StandardJS linter for TypeScript
2019-11-14 14:47:19 +00:00
Bùi Thành Nhân abad8e474b add nimpretty fixer 2019-11-09 16:28:49 +07:00
Donnie West e6ee613e00
Switch variables to dictionary key 2019-11-08 16:44:04 -06:00
Donnie West 6637de46c2
Add scriptencoding to `completion.vim` 2019-11-08 16:44:03 -06:00
Donnie West 0b5fcbad1f
Allow the user to set their own completion values 2019-11-08 16:44:00 -06:00
Donnie West 4bdde36661
Check kind safely 2019-11-08 16:41:38 -06:00
Donnie West db5fe5659f
Allow the user to remove warnings from completions 2019-11-08 16:41:37 -06:00
Thibault Vatter db6b1b5ecc Switch from style to transformers (#2838)
* Switch to transformers for styler
* Adapt unit test too
2019-11-07 18:22:57 +00:00
w0rp 2d9380d75c
Merge pull request #2690 from iclanzan/purty
Add purty fixer for PureScript
2019-10-29 17:37:18 +00:00
w0rp 9a0b604a99
Fix the test issues with html-beautify 2019-10-28 13:45:25 +00:00
Hugo Osvaldo Barrera 47eb3dd0c0 Add support for html-beautify (#2788)
* Add support for html-beautify
* Add html-beautify to the list of supported tools
* Update docs
2019-10-28 13:25:36 +00:00
Charlie Johnson af8c8516d1 fixers/stylelint: enhance `stylelint` fixer (#2745)
* Refactor stylelint fixer test
* Support additional stylelint fixer options
* Support changing working directory for stylelint fixer
* Force css syntax for stylelint fixer
2019-10-28 13:23:02 +00:00
Jerko Steiner 463deedc29 Merge branch 'master' into do-not-save-on-autoimport 2019-10-22 16:40:27 -05:00
Jerko Steiner 40890cfcf3 Rename ale#fix#SetBufferContents to ale#util#SetBufferContents 2019-10-22 16:39:43 -05:00
Ian Campbell ea91209a66 Allow the use of StandardX for StandardJS linting and fixing.
See https://github.com/standard/standardx
2019-10-21 20:46:54 -04:00
Ian Campbell cf5120ba75 Remove standardts fixer in favor of allowing standard.vim fixer to handle JavaScript or TypeScript options. 2019-10-21 20:46:54 -04:00
Ian Campbell 9017d3ef9c Add StandardJS for TypeScript linting and fixing. 2019-10-21 18:20:43 -04:00
w0rp 67d0ccc398
Fix #2835 - Bump up the sign group version check for NeoVim 2019-10-21 09:35:23 +01:00
w0rp c06467438d
Mention the disabled option for message severity 2019-10-18 16:22:17 +01:00
Andre Souto 5e69aaf4c2 Adding support for LSP `window/showMessage` method (#2652)
* Added base handling for window/showMessage
* Ignoring severity log
* Code formatting
* Added user configurable severity
* Preferring ale#util#ShowMessage over echo'ing directly
* Using format similar to ale_echo_msg_format for consistency
* Updating docs
* Added LSP log config string; improved tests
* Use warning as fallback for incorrect user config
2019-10-18 16:17:54 +01:00
w0rp 9125ec8739
Merge pull request #2845 from DonnieWest/fixItemDetailsOnEmptySource
Fix tsserver not returning details for items with empty source
2019-10-18 15:16:54 +01:00
Donnie West 8698c44e2a
Fix tsserver not returning details for items with empty source 2019-10-17 23:26:24 -05:00
Donnie West b27df1b169
Allow code actions to work on callback based sources 2019-10-17 23:22:31 -05:00
w0rp b24fd13423
Bump the ALE version 2019-10-16 17:23:31 +01:00
Ildar Akhmetgaleev 31d6f72abf Add option to show hover messages in preview.
Add new option 'ale_hover_to_preview' to show hover messages
in preview window.
2019-10-12 16:45:12 +07:00
Jerko Steiner c8c142b881 Do not save for ALERename and ALEOrganizeImports 2019-10-09 20:54:47 -05:00
w0rp 3fe2223a48
Fix #2800 - Ignore completion user data which is not a dictionary 2019-10-09 10:12:31 +01:00
w0rp d3a3f4011b
Merge pull request #2676 from davidtwco/nixfmt-fixer
Add nixpkgs-fmt fixer.
2019-10-07 19:22:01 +01:00
Horacio Sanson 7c2f5e83ab Fix sign parser to be language independent. 2019-10-04 21:58:44 +09:00
Horacio Sanson 41ff80dc9e 569 support vim sign group and priority (#2786)
* Use sign-group only on supported vim versions.

The sign-group feature is only available in nvim 0.4.0 and vim 8.1.614.

* Add priority to ALE signs.

This allows users to set a priority to ALE signs to take precedence over
other plugin signs.
2019-09-25 09:15:16 +01:00
w0rp e6946de98a
Merge pull request #2736 from zoonfafer/doc-typos
doc: Fix typos
2019-09-20 20:50:58 +01:00
w0rp d93512fe60
Fix #2744 - Make ALEFix work when only casing is changed 2019-09-20 19:02:21 +01:00
Jerko Steiner f5e44415e8 Show description of autoimport action for tsserver 2019-09-20 13:11:16 +07:00
w0rp e3784c4c4e
Close #2764 - Support the new React filetypes with aliases 2019-09-19 20:48:37 +01:00
w0rp dd6bd6f0fe
Fix #2711 - Fix writing to files on save 2019-09-19 20:32:33 +01:00
Mo Zhonghua b8949aaac3 `arguments` needs to be handled for `compile_commands.json` in addition to `command` (#2123)
* c linter: compatible with compile_commands.json without command field
2019-09-19 20:20:37 +01:00
statquant 34431d885b Adding linting for rmd filetype (duplicate of rmarkdown) 2019-09-14 15:55:04 +01:00
Cluas a6c59faa0f feat: support sqlformat. (#2702)
* feat: support sqlformat.
2019-09-12 22:48:27 +01:00
Jerko Steiner 3e8c8d3ccb Add ALERename (tsserver & LSP), ALEOrganizeImports (tsserver) and auto import support (tsserver) (#2709)
This commit adds support for renaming symbols in tsserver and with LSP tools, and for organising imports with tsserver. Completion results for symbols that can be imported are now suggested if enabled for tsserver completion done via ALE.
2019-09-12 21:53:23 +01:00
w0rp b66d202c1d
Merge pull request #2695 from elebow/move-ruby-escape-executable
Move ale#handlers#ruby#EscapeExecutable to ale#ruby#EscapeExecutable
2019-09-12 21:29:41 +01:00
Samuel Roeca 05ba522c9a languagetools: stop auto-appending --autoDetect (#2616)
Options are now configurable for languagetools, and `--autoDetect` can be removed by changing the options.
2019-09-12 21:22:47 +01:00
w0rp cda46636f4
Fix #2760 - Ignore all errors for adding NeoVim highlights 2019-09-11 16:49:25 +01:00
theoremoon 2e323b529d dfmt support (#2662)
* Add support for `dfmt`
2019-09-10 20:54:14 +01:00
BlahGeek 9f814a8ce9 Add g:ale_sign_highlight_linenr (#2678)
* add g:ale_sign_highlight_linenr
* Fix tests. Change option default value
* Rename ale_sign_highlight_linenr to ale_sign_highlight_linenrs
* Default ale_sign_highlight_linenrs to 0
2019-09-01 14:03:54 +01:00
w0rp 7d7ddf22d3
Merge pull request #2638 from frangio/nvim-highlight
Use Neovim API for highlights when available
2019-09-01 10:47:28 +01:00
Jeffrey Lau da262f40dd doc: Fix typos 2019-08-28 00:28:58 +08:00
David Wood 6aeb462171
Add nixpkgs-fmt fixer.
This commit adds a fixer for the Nix language, nixpkgs-fmt
(https://github.com/nix-community/nixpkgs-fmt).
2019-08-26 19:21:07 +01:00
w0rp 73812c3e41
Merge remote-tracking branch 'AlexeiDrake/master' into bugfix/c-lsp-build-dir-settings 2019-08-18 18:29:59 +01:00
richyfish c4bdf165ca Black fixer should include --pyi for files with .pyi extension (#2705)
* black fixer should include --pyi for files with .pyi extension
2019-08-18 15:45:15 +01:00
w0rp ddb559b3be
Merge pull request #2631 from timlag1305/feat/ada-gnatpp
Add gnatpp fixer for Ada
2019-08-18 15:37:51 +01:00
Andre Souto 219fb5873c Keep cursor position on screen when opening/closing lists (#2632)
* Trying to keep win view from bouncing
* Adjusting when views are saved and restored
* Also restore view when closing quickfix
* Don't restore view when opening list vertically
2019-08-17 19:14:21 +01:00
fx-carton b62e306222 Fix cflags parsing (#2510, #2265) (#2590)
* Parse CFLAGS that can be passed using a whitelist

I went through GCC's man page and selected flags that can safely be
passed to GCC and that can be useful to syntax checking. These include:

- -I/-i* include flags
- preprocessor flags such as -D
- -W* warning flags
- -O* optimization flags
- most -f options
- -m arch dependent options

* Fix CFLAGS tests: -Idir is now parsed to -I dir
* Added two tests for flags we want or don't want to pass.
* Also check for / in addition to s:sep
2019-08-17 19:08:14 +01:00
Donnie West 5388ff1d54 Add asyncomplete.vim Support (#2627) 2019-08-17 18:40:05 +01:00
Eddie Lebow 58e8d32d79
Move ale#handlers#ruby#EscapeExecutable to ale#ruby#EscapeExecutable
This function is generally applicable to Ruby, not just handling linter
output.
2019-08-13 01:52:13 -04:00
Sorin Iclanzan f89b49a014 Add purty fixer. 2019-08-12 11:49:19 -04:00
richyfish 28c93ab185 aleinfo global options (#2686)
* added omitted global variables which was breaking this test when run standalone
* invert logic for s:GetLinterVariables excluding disabled linters, so that linter global options can appear in output
* additional tests for s:GetLinterVariables for linter global options
2019-08-12 16:29:28 +01:00
w0rp 3ae01ba249
Merge pull request #2430 from eliath/master
Support $GO111MODULE with Go tooling
2019-07-30 21:17:20 +01:00
w0rp 8f5ecf0120
Merge pull request #2646 from paulreimer/fixer-clangformat-use-assume-filename
Set --assume-filename for clangformat fixer
2019-07-30 08:21:21 +01:00
JINNOUCHI Yasushi d1c56769b7 Add setting for numhl highlights (#2637)
* Add setting for numhl highlights
* Add doc for numhl feature
2019-07-29 22:08:33 +01:00
Paul Reimer d25711a516
Set --assume-filename for clangformat fixer 2019-07-19 07:57:10 -07:00
w0rp 36a50111b9
Merge pull request #2601 from delphinus/feature/better-completion-for-deoplete
Show more candidates for Deoplete completion
2019-07-14 10:29:03 +01:00
Matthew Lanigan abb38955d3 Add Sorbet ruby linter and fixer (#2614) 2019-07-13 17:37:48 +01:00
Francisco Giordano 6e6ad2e430 Try to mock nvim api functions 2019-07-10 01:20:22 -03:00
Francisco Giordano 79dde5f0e5 Implement highlights using neovim API 2019-07-09 23:23:27 -03:00
Pete Beardmore a5240009ba Fix incorrect re-selection (#2630)
ALE now only resets selections when needed, to prevent side effects.
2019-07-02 08:31:24 +01:00
ObserverOfTime 8700586890 Add clangtidy fixer (#2548)
* Add clangtidy fixer
* Add extra_options to clangtidy fixer
* Also, use cpp variables in cpp filetypes
2019-07-02 08:11:10 +01:00
Tim Lagnese 221aceb6db Add gnatpp fixer for Ada 2019-07-01 20:50:02 -04:00
Elias Martinez Cohen 49db8210f6 Support $GO111MODULE with Go tooling
Allows the user to override $GO111MODULE environment variable through
ale options. This gives control over the default behavior of Go module
resolution.

Golang documentation:
https://github.com/golang/go/wiki/Modules#how-to-use-modules

Add `ale#Go#EnvString()` function to make it easy to add similar Go
environment variables in the future.

Use the new `EnvString` function in all available Go tools callbacks
& update tests

Also add test of linter command callback for `gofmt`
2019-07-01 11:04:33 -04:00
delphinus a3521de64e Use input_patterns & add comments for updating it 2019-06-25 18:04:04 +09:00
delphinus e0f8304860 Add separated func for deoplete
Deoplete needs `get_complete_position` method and it has a different
signature. It already fetches the input string and attempts to detect
the position with `\k*` regexp patterns.
2019-06-19 15:08:24 +09:00
Parker Snell c5a4bbf8b0 Enable C++ autocompletion on '::' and '->' 2019-06-18 18:02:44 -07:00
w0rp 6e28eec243
Merge pull request #2563 from dcyriller/fixer-prettier-glimmer
prettier: Support experimental languages (Handlebars)
2019-06-13 11:08:21 +01:00
Cyrille David 86205967ea Refactor to be less verbose 2019-06-13 10:36:51 +02:00
w0rp 80ab12c7b6
Bump the ALE version 2019-06-10 23:53:42 +01:00
w0rp ce91972c94
Fix #1727 - Replace previoulsy defined linters with matching names 2019-06-10 22:41:20 +01:00
w0rp 168768b326
Lint on InsertLeave, not in insert mode by default
b:ale_lint_on_insert_leave is now supported as tests need it.

These defaults are saner and cause fewer issues for users by default.
2019-06-10 20:54:38 +01:00
w0rp 8b46fa3ee7
Merge pull request #2567 from theevocater/add_reorder_python_imports
Add support for reorder-python-imports fixer
2019-06-10 19:33:00 +01:00
Thibault Vatter 22e7a6f6c2 Make rmarkdown files work with styler and lintr (#2564)
* add R markdown as filetype for styler
* Add rmarkdown as an alias for R
2019-06-10 19:27:42 +01:00
Jake Kaufman 56641e0230 Add support for reorder-python-imports fixer
isort is great, but I've come to prefer reorder-python-imports. The tool
has a focus on smaller diffs than isort. reorder-python-imports is also
a little smarter than isort which is nice.
2019-06-08 19:22:50 -04:00
w0rp 59829bc194
Merge pull request #2253 from jj-kim/master
Improve location list behavior on split windows of same buffer.
2019-06-08 23:25:02 +01:00
w0rp d9931b9891
Merge pull request #2559 from nerdrew/rust-cargo-rendered-detail
show rendered cargo error in detail for clippy errors
2019-06-08 23:20:18 +01:00
w0rp 3aa58ca179
Merge pull request #2565 from Tharre/master
Run xml linters on xsd and xslt files
2019-06-08 23:09:09 +01:00
w0rp 5826b4927c
Merge pull request #2551 from laino/eslint-json
Use JSON output for ESLint and fix tsserver column
2019-06-08 23:05:35 +01:00
Tharre 3b8fb39b4a Run xml linters on xsd and xslt files
Both xsd and xslt are by definition written in XML, and thus the same
linter(s) can be run to check them for well-formedness.
2019-06-06 23:46:43 +02:00
Cyrille David 3e4b8ea466 prettier: Support experimental languages
Such as handlebars
2019-06-06 22:04:32 +02:00
w0rp 7b78f2b846
Fix #2525 - Convert Windows paths in a Unix environment 2019-06-05 14:16:43 +01:00
Andrew Lazarus e7317e05ea show rendered cargo error in detail 2019-06-04 22:20:57 -07:00
w0rp 381fff0e4c
Make ale_lint_on_save work with b:ale_fix_on_save = 1 2019-06-04 21:51:53 +01:00