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

Declare supported IntelliJ IDEA versions in plugin metadata #217

Closed
snicoll opened this issue Aug 25, 2020 · 8 comments
Closed

Declare supported IntelliJ IDEA versions in plugin metadata #217

snicoll opened this issue Aug 25, 2020 · 8 comments
Assignees

Comments

@snicoll
Copy link
Contributor

snicoll commented Aug 25, 2020

Given that we have to release the plugin quite often as they are breaking change in a lower-level API we have to use, it would be better to actually document the versions that are compatible.

The plugin metadata can use build number ranges for this.

@snicoll
Copy link
Contributor Author

snicoll commented Aug 25, 2020

There is actually a since-build in there but it is outdated.

@snicoll snicoll self-assigned this Aug 26, 2020
@snicoll snicoll added this to the 0.0.26 milestone Aug 26, 2020
@snicoll
Copy link
Contributor Author

snicoll commented Aug 26, 2020

I am tempted to go with <idea-version since-build="201" until-build="202.*"/> that would enable the plugin for IJ
2020.1 and 2020.2. I've tested on both and it works fine.

The plugin will disable itself when 2020.3 is released but we have a chance to test the EAP and have an extra release beforehand. The other option is to not put a until-build and process the feedback if any.

paging @YannCebron for insights

@YannCebron
Copy link

"it depends" if a plugin uses only small parts/very "stable" part of APIs, then usually omitting until-build will work
we recommend using Plugin Verifier to check binary compatibility against all supported versions https://jetbrains.org/intellij/sdk/docs/reference_guide/api_changes_list.html#plugin-verifier

@philwebb
Copy link
Contributor

Most of the compatibility issues appear in our DelegatingCodeStyleManager class. I guess com.intellij.psi.codeStyle.CodeStyleManager is somewhat internal, so it's not that surprising. We only need to override the reformat... methods, and those generally don't change much. More often than not it's just methods added in CodeStyleManager that we need to add to the delegate.

I seem to remember finding a few other IntelliJ plugins that have similar problems. Perhaps if there was a DelegatingCodeStyleManager API already provided by IntelliJ it would help a little?

@YannCebron
Copy link

Unfortunately there exists no (stable) API yet for delegating code formatting. Please follow https://youtrack.jetbrains.com/issue/IDEA-203568 for progress.

@philwebb philwebb modified the milestones: 0.0.26, 0.0.x Dec 3, 2020
@krasa
Copy link

krasa commented Jan 3, 2021

Using cglib proxy is much better than extending CodeStyleManager - you will break the IDE pretty much with every API change while the proxy will always work.

https://github.com/krasa/EclipseCodeFormatter/blob/master/src/java/krasa/formatter/plugin/ProxyUtils.java
https://github.com/krasa/EclipseCodeFormatter/blob/master/src/java/krasa/formatter/plugin/ProxyCodeStyleManagerDelegator.java

@philwebb
Copy link
Contributor

philwebb commented Jan 6, 2021

Thanks for the suggestion @krasa. I've opened #255 to investigate.

@philwebb
Copy link
Contributor

philwebb commented Feb 8, 2023

With #359 we've switched to use the DocumentFormattingService which should be a more stable API.

@philwebb philwebb closed this as not planned Won't fix, can't repro, duplicate, stale Feb 8, 2023
@philwebb philwebb removed this from the 0.0.x milestone Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants