* pass --stdio flag to expert lsp server
expert requires --stdio to use stdio transport but the linter
definition launched it without the flag, so the server never
entered lsp mode
* handle client/registerCapability requests from lsp servers
some lsp servers like expert send a client/registerCapability
request after initialization to dynamically register capabilities,
if ale does not respond the server blocks and never processes
further messages like textDocument/didOpen
* Add support for PerlNavigator
* fixup! Add support for PerlNavigator
* fixup! fixup! Add support for PerlNavigator
* fixup! fixup! fixup! Add support for PerlNavigator
---------
Co-authored-by: cos <cos>
- Use ale#Set() to set the ale_c_build_dir_names variable.
- Ensure SetUpLinterTest() is called before any Save commands in tests.
- Add c.vim to runtime before non-linter tests are executed.
- Remove workarounds in c.vim.
* Initial plan
* Fix FindCompileCommands to handle absolute paths in c_build_dir_names
Use ale#path#GetAbsPath to resolve build directory paths, which correctly
handles both absolute and relative paths. When the dirname is absolute,
derive the project root from the parent of the build directory.
Co-authored-by: w0rp <3518142+w0rp@users.noreply.github.com>
* Improve comment clarity in FindCompileCommands
Co-authored-by: w0rp <3518142+w0rp@users.noreply.github.com>
* Add defensive ale#Set for c_build_dir_names in FindCompileCommands
Mirror the existing s:CanParseMakefile pattern to ensure the
g:ale_c_build_dir_names variable always exists when ale#Var is
called, even if test Save/Restore cycles delete it.
Co-authored-by: w0rp <3518142+w0rp@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: w0rp <3518142+w0rp@users.noreply.github.com>
* Utilizing -fzf for tsserver responses along with regular lsp responses
* Refactoring FormatResponseItem in references.vim to accept response item config
* test: Add failing tests for markdownlint 0.47.0 output format
Add two new test cases to verify the markdownlint handler's ability to
parse output from version 0.47.0, which includes severity keywords
("error" or "warning"). These tests will fail with the current
implementation, demonstrating the need for a fix to handle the new
output format.
The tests specifically verify:
- Parsing of error severity keyword
- Parsing of warning severity keyword
- Correct mapping of severity to ALE type (E/W)
Backward compatibility with version 0.46.0 is already verified by
the existing ests.
* fix: Update markdownlint handler for version 0.47.0 output format
Update the markdownlint handler to support the new output format
introduced in version 0.47.0, which includes severity keywords ("error"
and "warning") after the column number.
Changes:
- Updated regex pattern to capture optional severity keyword
- Added type mapping logic (error → 'E', warning → 'W')
- Adjusted match indices for rule ID and description text
- Maintained backward compatibility with version 0.46.0
All tests now pass, including the new tests for 0.47.0 format.
* style: Fix vint linting errors in markdownlint handler
- Add blank line before if statement for better readability
- Replace `==#` with `is#` for case-sensitive comparison
* references: add ALEFindReferences -fzf option
Allows using -fzf to show previews using fzf.vim. Includes:
- add support for opening in bufers, splits, tabs and for adding matches quickfix
- add support for -relative
- add fzf preview `--highlight-line` option
- add fzf.vim autoload module
* tests: fix references tests for fzf support update
* Adding --no-color flag to sass stylelint
* Adding --no-color to all stylelint args
* Adding --no-color expectation to stylelint tests
* Properly handling SyntaxError for stylelint; adding corresponding test
* Fixing CSS stylelint parameters and adding regression test
* Add --editor-mode flag when invoking rubocop
Since RuboCop 1.61.0 (released in February 2024), RuboCop accepts an
`--editor-mode` flag which improves editor integrations like ale.
Some of RuboCop's auto-corrections can be surprising or annoying to run
on save. When RuboCop is running via an LSP or when the `--editor-mode`
flag is passed, it will understand that it is running in an editor, and
it will hold off on making changes that might be surprising or annoying.
For example, if I write
```ruby
def call
results = some_process
end
```
This has an unused variable, and RuboCop will remove the unused variable
when you run it. However, if you're in the middle of editing, you may
not want it to remove that unused variable, because you may be about to
add a usage of it.
More context:
- PR which introduced it: https://github.com/rubocop/rubocop/pull/12682
- Release notes for 1.61: https://github.com/rubocop/rubocop/releases/tag/v1.61.0
- Docs: https://docs.rubocop.org/rubocop/1.80/configuration.html#contextual
This will be a breaking change for anyone who is running an old version
of RuboCop, because the flag will not exist for them. If they would like
to opt out of this change, they can set an option to omit the flag. I
think this ought to be enabled by default so that people will get this
benefit out of the box.
In the meantime, I am opting into this behavior by setting this option:
```vim
let g:ale_ruby_rubocop_options = "--editor-mode"
```
So I appreciate that this seam was already introduced.
* Make this a non-breaking change
This will detect the current rubocop version and auto-enable
--editor-mode for newer version of rubocop without affecting users of
older versions of rubocop.
* test: rename `FindNearestFile` test file
It matches the API name better and now lives beside the test file for
`FindNearestDirectory`.
* ale: add `FindNearestFileOrDirectory` function
Some anchor paths can be files or directories (e.g., `.git` is a
directory normally, but a file for worktrees). Add a function that finds
either type of path and returns the nearest.
Redpen linter previously had hardcoded command-line options and duplicated
linter definitions across all supported file types (asciidoc, markdown,
review, rst, tex, text). This refactoring centralizes the linter definition
and adds support for user-configurable options via g:ale_redpen_options.
Key changes:
- Created ale#handlers#redpen#DefineLinter() to eliminate code duplication
- Added ale#handlers#redpen#GetCommand() to support configurable options
- All file types now use shared configuration and command building
- Added comprehensive test coverage for option handling
- Updated documentation for all affected file types
This allows users to customize redpen behavior with additional command-line
options while maintaining backward compatibility and reducing maintenance
overhead.
* Updates `ale#lsp#response#ReadDiagnostics` to always store the full, unaltered diagnostic message from the LSP in question. The current process is to replace all newline characters with whitespace (' '), which then leads to broken formatting when viewing complex output from an LSP with `:ALEDetail` and other commands.
* Updates `ale#cursor#TruncatedEcho` to replace newline characters with a space ' ' instead of an empty string '' to retain the previous style of formatting for echoed messages.
Fixes: #2356Fixes: #3068Fixes: #2301
* Some abs paths are not recognized for win32
Paths like "c:/abc/def.cpp" were not recognized as absolute on Windows.
* Fix test for mypy_handler
mypy handler not just simplifies path, but tries to convert path to
absolute.
This breaks detecting the project root when editing tests with a nested
pytest.ini file where other project files are available. The other files
are so common we can just removes this entirely and test that we
ignore it in one case.
Some linters will expand the paths of symlinked tempfiles when
reporting them back to ALE. This ensures that if they do, the filename
is still flagged appropriately as being temporary.
File local variables in Emacs are used in a way similar to Vim
modelines. For example, at the end of the file you might find something
like the following:
%% Local Variables:
%% erlang-indent-level: 2
%% something-weird: t
%% End:
The `erlang-indent-level' variable in this list instructs the Erlang
mode to use two columns per indentation level. But since the
`something-weird' variable is likely unknown, both may be ignored.
By default, Emacs in batch mode ignores all variable/value pairs if it
encounters at least one that is not known to be safe. Setting
`enable-local-variables' to `:safe' tells Emacs to use only safe values
and ignore the rest.
Implement the diagnostics pull model with the LSP Neovim client. We
must handle messages a little different and tweak client capabilities
for pull diagnostics to work through the Neovim client.
Implement pull diagnostics in the VimL implementation so ALE is able
to track when servers are busy checking files. Only servers that
support this feature will return diagnostics these ways.
Ensure that basic ALE functions `ale.var`, `ale.escape`, and `ale.env`
are available in Lua. Cover all Lua code so far with busted tests,
fixing bugs where ALE variables can be set with Boolean values instead
of numbers. Document all functionality so far.
1. Add ale.setup and ale.setup.buffer for pure Lua configuration.
2. Update many global settings to use Booleans instead of numbers to
make types easiert to work with in Lua.
3. Radically reformat documentation and fix errors to make
documentation more usable for Neovim users.
Support TCP connections to language servers through Neovim's built in
client. In all but what is currently the nightly builds of Neovim
connections via a hostname will fail, but connections via an IP address
should function. We will still enable the built in Neovim client by
default anyway, as LSP clients very rarely connect over TCP.