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
Diagnostics rework #754
Diagnostics rework #754
Conversation
plugin/diagnostics.py
Outdated
self.invoke_each(lambda w: w.begin()) | ||
|
||
if diagnostics_by_file is not None: | ||
if diagnostics_by_file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the double if for diagnostics_by_file
? :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, should have left a TODO there. The old update_diagnostics_panel
had both checks and did nothing at all if diagnostics_by_file
was None
- I think that case can't happen anymore, so I'll remove the check!
Since this PR is a "rework" of diagnostics, would you consider adding unicode symbols, as such: |
@AmjadHD this PR is more about refactoring code instead of UI polish - if we can do something that looks good in all fonts then I'd like to see an example. |
Removes a use of global_events. Encapsulate state instead of storing it on the module.
Cursor listener should include from entire line Filter on lsp range/point instead of sublime position Also set status on active view
Thought about implementing F8 toggle a-la-VSCode, but can do that later.
cc9665e
to
b10d054
Compare
The "Show diagnostics panel after saving" investigation (#748) showed the functionality could be "tacked" on, but would work better if components were set up in proper relations instead of querying global state.
In this PR, a DiagnosticsPresenter is introduced which gets access to DocumentHandler's events.
Clean ups:
show_diagnostics_phantoms
feature (as discussed in Remove show_view_status setting? #722)Desired fixes:
Stop using global_events for pushing diagnostics updates to ui
Remove duplication of looping logic over diagnostics after an update:
update_diagnostics_in_status_bar
,update_diagnostics_panel
,window_has_relevant_diagnostics
,update_view_diagnostics
(trying a strategy to update many things in a single walk through)Remove duplication querying diagnostics at a point:
point_diagnostics_by_config
vsget_line_diagnostics
(perhaps share a cache if cursor listener and bulb listener both want diagnostics?)Try to remove the need for
get_window_diagnostics
/get_view_diagnostics
- it should be easy to access the DiagnosticsStorage, and it should expose useful functions for accessing/filtering data.