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

Register quickfixes via extension point #566

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

Bananeweizen
Copy link
Collaborator

  • Remove old quickfixprovider extension point. It's entirely useless to register an OSGi plugin as extender of another plugin. OSGi will deal with that kind of class loading anyway.
  • Instead have a new quickfix extension point, which registers a class implementing the quickfix related interface and the module that can be fixed this way.
  • Completely avoids loading Checkstyle metadata for looking up quickfixes of existing problem markers.
  • Fix ExplicitInitializationQuickfix throwing exceptions during the check whether it's applicable.

Fixes #315.
Fixes #561.

See the icons with the light bulb overlay here for violations with quickfixes available:
grafik

* Remove old quickfixprovider extension point. It's entirely useless to
register an OSGi plugin as extender of another plugin. OSGi will deal
with that kind of class loading anyway.
* Instead have a new quickfix extension point, which registers a class
implementing the quickfix related interface and the module that can be
fixed this way.
* Completely avoids loading Checkstyle metadata for looking up
quickfixes of existing problem markers.
* Fix ExplicitInitializationQuickfix throwing exceptions during the
check whether it's applicable.

Fixes checkstyle#315.
Fixes checkstyle#561.
@rnveach
Copy link
Member

rnveach commented Sep 17, 2023

@Bananeweizen Just a question, does eclipse-cs have support for 3rd party (like sevntu) quick fixes where the code is in the other library? The way you add quickfixes here make me think that is a no, but I wanted to ask.

@Bananeweizen
Copy link
Collaborator Author

Of course that works. As long as the quickfix is in a plugin, it will be found that way. Us registering our quickfixes is the same as someone else registering theirs. We only query the registered quickfixes, we don't have to deal with anything beyond that (class loading etc.). That's the reason for having the extension point mechanism in the first place, to NOT deal with classloading on your own.

@Calixte Calixte merged commit e1c5bf5 into checkstyle:master Jan 24, 2024
6 checks passed
@Bananeweizen Bananeweizen deleted the quickfix branch January 24, 2024 17:56
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.

performance issue when expanding checkstyle markers NeedBracesCheck: Quickfix is broken since 8.36.1
3 participants