donkirkby / live-py-plugin

Live coding in Python with PyCharm, Emacs, Sublime Text, or even a browser
https://donkirkby.github.io/live-py-plugin
MIT License
290 stars 57 forks source link

Override-only API usage #550

Open donkirkby opened 1 year ago

donkirkby commented 1 year ago

The runPluginVerifier gradle task reports three violations against the newest release of IDEA:

Plugin io.github.donkirkby.livepycharm:4.10.2 against IC-232.6095.10: Compatible. 3 override-only API usage violations
Override-only API usages (3): 
    #Invocation of override-only method com.intellij.openapi.fileEditor.AsyncFileEditorProvider.Builder.build()
        Override-only method com.intellij.openapi.fileEditor.AsyncFileEditorProvider.Builder.build() is invoked in io.github.donkirkby.livepycharm.SplitFileEditorProvider$1.build() : FileEditor. This method is marked with @org.jetbrains.annotations.ApiStatus.OverrideOnly annotation, which indicates that the method must be only overridden but not invoked by client code. See documentation of the @ApiStatus.OverrideOnly for more info.
        Override-only method com.intellij.openapi.fileEditor.AsyncFileEditorProvider.Builder.build() is invoked in io.github.donkirkby.livepycharm.SplitFileEditorProvider.createEditor(Project, VirtualFile) : FileEditor. This method is marked with @org.jetbrains.annotations.ApiStatus.OverrideOnly annotation, which indicates that the method must be only overridden but not invoked by client code. See documentation of the @ApiStatus.OverrideOnly for more info.
    #Invocation of override-only method com.intellij.openapi.fileEditor.AsyncFileEditorProvider.createEditorAsync(Project, VirtualFile)
        Override-only method com.intellij.openapi.fileEditor.AsyncFileEditorProvider.createEditorAsync(Project, VirtualFile) is invoked in io.github.donkirkby.livepycharm.SplitFileEditorProvider.getBuilderFromEditorProvider(FileEditorProvider, Project, VirtualFile) : AsyncFileEditorProvider.Builder. This method is marked with @org.jetbrains.annotations.ApiStatus.OverrideOnly annotation, which indicates that the method must be only overridden but not invoked by client code. See documentation of the @ApiStatus.OverrideOnly for more info.
    Plugin can probably be enabled or disabled without IDE restart

If you look in the IDEA source code, you can see the annotation, but no hint as to how to avoid calling it directly. I think I must have based my provider class on the markdown split editor. I wonder if I could subclass that somehow.