`ModeChanged` looks like a more reliable way to detect an "exit insert mode" event and is a lot simpler (doesn't need a timer). Also, it can detect some other transitions like `\<C-o\>` in insert mode.
The `ModeChanged` event is available in:
* [Vim 8.2.3430](f1e8876fa2)
* [NeoVim 0.7.0](69bd1e4e36)
---------
Co-authored-by: Dmitry Zolotukhin <zlogic@gmail.com>
* Add support for the [djlinter](https://www.djlint.com/)
* Add documentation and tests.
* Fix the name of the variable for the executable name.
* Correct the name of the handler in the test.
* Correct the test adding the value of vcol.
* Format djlint.vim according to formatting rules.
Sometimes `s:HandleExit` can execute a deferred linter callback, which
ends up setting the `l:loclist` that's passed into
`ale#engine#HandleLoclist` at the end of `s:HandleExit` to a dictionary.
This dictionary cannot be iterated over, and thus errors out.
Guard against trying to iterate over values that don't make sense.
Co-authored-by: Alexander Huynh <git@e.sc>
* Fixed the issue with Black ignoring files is being processed. (#3406)
Add test for stdin-filename on test/fixers/test_ruff_format_fixer_callback.vader
* Fixed the issue with Black ignoring files is being processed. (#3406)
Fixed the problem on Windows's tests.
* Fixed the issue with Black ignoring config file to tell it which file is being processed. Trailing whitespace removed
Resolves#4314.
Add a fixer that's built into python for json formatting. Include a
couple arguments in docs to make these features more discoverable.
Uses stdin-based fixing so you don't need to save the file to fix.
In the vein of commit ea72d66b "Verilator current file search path (#3500)"
This includes the directory of the current file in the library
search path. From `man iverilog`:
-ylibdir
Append the directory to the library module search
path. When the compiler finds an undefined module, it
looks in these directories for files with the right name.
This might only be a problem for newer phpstan versions (2.1.1 here).
If you try to run `phpstan` the way ale will when it builds the option, you will get something like:
```
The "--memory-limit" option requires a value.
```
It wants you to use `--memory-limit=-1` instead.
The current xmllint fixer reads and formats the file that a buffer is
associated with from disk instead of accepting input from stdin. This
has the side effect that if the filename is changed in the buffer, but
not saved yet, the fixer discards all the pending changes and replaces
the buffer contents with the formatted text from the file contents on
disk.
* Add support for c3-lsp linter
Add support for c3-lang with the c3-lsp language server.
Link: http://github.com/pherrymason/c3-lsp
Link: http://c3-lang.org
* fix linter error
* fix: consistent use of the executable name
Consistently use the executable name 'c3lsp' instead of the project name
'c3-lsp'.
* c3lsp: add command line arguments to executable
* Add erlfmt fixer to the registry
Without this, the fixer will not appear in the list of suggested tools
and cannot be used without additional configuration.
* Handle stdin in the erlfmt fixer command
Previously, the full path to the file being edited was used, which
resulted in the loss of unsaved changes.
* Add executable selection tests for erlfmt fixer
Users can set the DOCKER environnement variable to select Docker or
Podman to run the tests.
Co-authored-by: L'HOSPITAL Logan <lhospitallogan@gmail.com>
* Added jq support
Cleaned up yq.vim file
* Updated docs
* Updated supported-tools.md
* Added yq tests
* Fix python linting/formatting error when in virtual environment (#4865)
Python fixers and linters were failing when vim is running in a virtual
environment that's located in a path containing text `poetry`. The cause
of this was the regular expression `poetry\|pipenv\|uv$` which matches
`poetry` and `pipenv` if they appear anywhere in the virtualenv path.
* Add cljfmt fixer for clojure files (#4860)
* When using `actionlint` look for & use a config file (#4858)
Actionlint supports a config file and it lives in a very searchable
path, as the only files it acts on are in the `.github` directory
already.
Look for an `actionlint.yml` and `.yaml` in that path, and use the
config if its there.
* Fix linting with jq (#4765) (#4862)
With the 1.6 version of jq the error message start with "parse error".
With the last version of jq the error message start with "jq: parse error".
Fix it by using a regular expression that works in both cases.
* Properly handle optional end_line_no/end_line_pos in sqlfluff (#4867)
end_line_no/end_line_pos are optional. Example SQL:
`SELECT NULL FROM {{ a_jinja_templated_table }};`
`sqlfluff lint --dialect ansi --format json` gives the following error
among others:
```
{"start_line_no": 1, "start_line_pos": 21, "code": "TMP", "description":
"Undefined jinja template variable: 'a_jinja_templated_table'", "name":
"", "warning": false}
```
As one can see there is no end_line_no/end_line_pos.
* Add golangci-lint fixer (#4853)
Closes#4616
* Fixed copy-paste misstakes and added filter to docs
* Added test vader file for yq
* Fixed and updated the test case
---------
Co-authored-by: Walter Kaunda <14844142+kwalter94@users.noreply.github.com>
Co-authored-by: rudolf ordoyne <49649789+casens5@users.noreply.github.com>
Co-authored-by: Bea Hughes <108035665+beahues@users.noreply.github.com>
Co-authored-by: benjos1234 <legrimlvl24@gmail.com>
Co-authored-by: Coacher <Coacher@users.noreply.github.com>
Co-authored-by: Ian Stapleton Cordasco <graffatcolmingov@gmail.com>
* fix ale_python_auto_virtualenv to correctly set virtualenv env vars
According to the documentation, `ale_python_auto_virtualenv` should automatically set environment variables for commands, but previously the variables were not set completely or correctly.
Before:
`PATH` variable was expanded to include `/path/to/venv`
After:
`PATH` variable is expanded to include `/path/to/venv/bin`
`VIRTUAL_ENV` variable is set to `path/to/venv`
This mimics exactly what the `activate` scripts do, and allows the configuration knob to work as expected.
For example, after this change, `jedi-language-server` can be installed globally (instead of inside every venv), and it will "just work" (e.g. find references to dependencies in the venv) when editing a file in a project that uses a venv, because the correct variables are set.
* fix test_python_virtualenv.vader test to expect output with both virtualenv vars
* remove unnecessary non-escape in test_python_virtualenv.vader
* fix accidentally removed space in windows test_python_virtualenv.vader
In addition to errors Zeek's parsing can also expose warning messages,
e.g., for the following code
```zeek
event http_stats(c: connection, stats: http_stats_rec) {
c$removal_hooks;
}
```
a warning is emitted
```
warning in /tmp/foo.zeek, line 2: expression value ignored (c$removal_hooks)
```
This patch adds parsing and propagation of these warning messages.
end_line_no/end_line_pos are optional. Example SQL:
`SELECT NULL FROM {{ a_jinja_templated_table }};`
`sqlfluff lint --dialect ansi --format json` gives the following error
among others:
```
{"start_line_no": 1, "start_line_pos": 21, "code": "TMP", "description":
"Undefined jinja template variable: 'a_jinja_templated_table'", "name":
"", "warning": false}
```
As one can see there is no end_line_no/end_line_pos.
With the 1.6 version of jq the error message start with "parse error".
With the last version of jq the error message start with "jq: parse error".
Fix it by using a regular expression that works in both cases.
Actionlint supports a config file and it lives in a very searchable
path, as the only files it acts on are in the `.github` directory
already.
Look for an `actionlint.yml` and `.yaml` in that path, and use the
config if its there.
Python fixers and linters were failing when vim is running in a virtual
environment that's located in a path containing text `poetry`. The cause
of this was the regular expression `poetry\|pipenv\|uv$` which matches
`poetry` and `pipenv` if they appear anywhere in the virtualenv path.
This fixer performs indentation with the Erlang mode for Emacs.
The Erlang mode is maintained in the Erlang/OTP source tree. It indents
some things differently than the Vim indent plugin, and provides more
customization options.
* Prefix user-defined commands with colons
This is consistent with Vim's own :help pages.
* Remove dot hack
Now that we have `:ALEInfo` and `ALEInfo`, we don't need `ALEInfo.` any
more to disambiguate them.
* Use colons in references
* Use angle brackets for command arguments
* Use `:Command` for command references
* Use a non-command reference for tsserver
* Prefix highlight references with hl-
* Fix some references into Vim's own :help
E.g. location-list or +features
* Misc hotlink improvements
* Undo previous changes to tsserver
Just leave it in backticks - even though I don't like it.
* Use bars for a command for consistency
* Append hotlinks to hl-groups
Remove minuses to make tables look more like in Vim's own :help
* Prefix features with +
* Provide full hotlink to ale.txt
* Fix double pipe typo
* Capitalize Error highlight
There seems to be no hotlink in Vim's own documentation for this.
I would have expected *hl-Error* - no such thing :-(
* Right align tags to col 79
Make ale#floating_preview#Show more similar to popup_create and return
the id of the window so it's easy to set the filetype of the resulting
buffer.
Update test stub version of Show() to return a win id (the current window
since it's not actually creating a window).
Test
* both tests still pass
The only option available to biome's `lsp-proxy` command used for
linting is `--config-path`. However, we are using ALE to find and set
the project root, and have a way to manually override, so that is no
longer necessary.
The LSP proxy also used the `g:ale_biome_options` config, which is
shared with the fixer's `check` command, but `lsp-proxy` will throw an
error if unknown options are included, making it so that option is only
useful to set the project root.
BREAKING CHANGE: We are no longer passing options to the biome LSP
proxy, but we can still set the project root with
`g:ale_biome_lsp_project_root`.
Since biome supports either `biome.json` or `biome.jsonc` config files,
we need to look for both when searching for the LSP project root. We can
also look for a package.json or .git folder to use. This uses mostly the
same logic as deno.
* Add Ruby linter with Steep
Fixes#3254
* Run steep instead of using language server
LSP presents a few issues and this works around those.
* Work around Steep path issue
See https://github.com/soutaro/steep/pull/975
* Add simple tests for steep
* Add steep to supported tools
* Pass linter
* Add a comment regarding Steep's column counting
* Make lnum an integer
* Add Steep handler test
* Fix separator for Windows
* Escape Windows path separators for substitute()
* Use ALEInfo (I) group
* Use fnameescape instead of quotes
* Skip linting for files not under steep root
* Add and pass tests covering proper steep root lookup
* Fix separator discrepancy
* Use strict operators (match case)
* Fix ordering
* Use `is#` instead of `==#`
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
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
* Update dart analysis_server command
In 2021 the dart team added a new sub-command `language-server` to
replace the original `./snapshots/analysis_server.dart.snapshot --lsp`
convention for starting the language server.
c224cc2e0d
* Add ale_dart_analysis_server_enable_language_server option
This allows users to opt-in to the new `dart language-server` command.
* Enable ale_dart_analysis_server_enable_language_server option by default
* Update doc/ale-dart.txt
Include the dart version number where the `dart language-server` command
was added.