Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an API for displaying results from other sources #2017

Closed
w0rp opened this issue Oct 25, 2018 · 1 comment
Closed

Add an API for displaying results from other sources #2017

w0rp opened this issue Oct 25, 2018 · 1 comment

Comments

@w0rp
Copy link
Member

w0rp commented Oct 25, 2018

There can be other plugins which might parse errors and warnings from other sources, such as language servers or custom scripts. A few issues have been opened in the past for integrating ALE with language server plugins or other tools, but ALE connecting to other plugins doesn't solve the problem. The problem is that some users want to display results from other sources as well ALE displays them, and they want to combine lint results from ALE with results from other sources.

To solve this problem, I believe the best solution is to provide an API in ALE for making ALE display results, given a List of problems in ALE's loclist format. Other plugins can then be configured to display results alongside ALE results by calling the functions available in ALE. Here are some important considerations.

  • Displaying of problems should be controlled entirely by the other sources. ALE can ask other sources for more results, but they do not have to respond, and could add results at any time.
  • The other sources must tell ALE when results are being collected, and when parsing is complete, so ALE knows when to signal events like ALELintPost. Results should still be shown is other sources to not tell ALE when parsing begins and ends, but issues should be expected should they fail to tell ALE if they are busy or not.
  • ALE should signal a new event before ALELintPre which other plugins can optionally listen for, and signalling that they are checking the buffer after this event is signalled should lead to ALE emitting ALELintPre and later ALELintPost events when other plugins signal that they have finished checking a buffer.

The following functions should be added to form a public API.

  • ale#engine#ShowResults(buffer, linter_name, results)
  • ale#engine#StartChecking(buffer, linter_name)
  • ale#engine#StopChecking(buffer, linter_name)

An ALEWantResults event should be added for asking for more results.

@w0rp
Copy link
Member Author

w0rp commented Oct 29, 2018

An API like this has now been implemented. See :help ale-lint-other-sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant