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

feat(diagnostic): classify ALE items by their source #1287

Merged
merged 1 commit into from
Oct 23, 2019

Conversation

yous
Copy link
Contributor

@yous yous commented Oct 21, 2019

With coc-python extension, pylint and flake8 enabled and displayByAle is on, say we have this file:

def foo():
    print('foo')

def bar():
    print('bar')


var = baz

Then there are error messages:

test.py|4 col 1 error| [python] E302: expected 2 blank lines, found 1
test.py|8 col 7 error| [python] F821: undefined name 'baz'
test.py|8 col 7 error| [python] E0602: Undefined variable 'baz' (undefined-variable)

Note that they all have [python] header. This patch changes this to:

test.py|4 col 1 error| [flake8] E302: expected 2 blank lines, found 1
test.py|8 col 7 error| [flake8] F821: undefined name 'baz'
test.py|8 col 7 error| [pylint] E0602: Undefined variable 'baz' (undefined-variable)

And this behavior is more similar to ALE's one.

@fannheyward fannheyward merged commit 94ce039 into neoclide:master Oct 23, 2019
@yous yous deleted the display-by-ale branch October 23, 2019 02:28
chemzqm added a commit that referenced this pull request Oct 23, 2019
chemzqm added a commit that referenced this pull request Oct 23, 2019
@yous
Copy link
Contributor Author

yous commented Oct 24, 2019

Ah, it seems that ale#other_source#ShowResults should be called for each source even when it's empty, according to #1296.

@chemzqm
Copy link
Member

chemzqm commented Oct 24, 2019

The problem is you wouldn't have source name when such kind of diagnostic item doesn't exists any more.

@yous
Copy link
Contributor Author

yous commented Oct 24, 2019

Is there a way to get available/enabled sources for each collection?

@chemzqm
Copy link
Member

chemzqm commented Oct 24, 2019

coc-python could add source name to diagnostic message.
Or make your ale support add diagnostics with different source names.

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

Successfully merging this pull request may close these issues.

3 participants