Skip to content

✅ Solution for CodeCoverage and the initial error ✅ #39

@jorgecc

Description

@jorgecc
  1. This library uses a really old version of the jetbrains SDK, so it is not as simply as patch or update the plugins.

  2. It is a hacky solution:

Edited the file:
src/cc/takacs/php_codeverage_display/ApplicationPlugin.java

And it is the changes:

public class ApplicationPlugin implements ApplicationComponent {
    @Override
    public void initComponent() {
        ApplicationManager.getApplication().executeOnPooledThread(() -> {
            try {
                TimeUnit.SECONDS.sleep(30);
            } catch (InterruptedException e) {
            }
            AnAction toolbarButton = ActionManager.getInstance().getAction("cc.takacs.php_codeverage_display.toolbar.enable");
            final boolean enabled = PropertiesComponent.getInstance().getBoolean("cc.takacs.php_codeverage_display.enabled", true);
            new ToggleIconService().toggleIcon(toolbarButton.getTemplatePresentation(), enabled);

        });
    }
// and the rest of the code.

What it does?. It waits 30 seconds (async) and loads the library and apparently it works, however we must wait 30 seconds to call this plugins but who opens the ide and start a test with coverage in 30 seconds?

It doesn't delay the load of the IDE because it is asyncronous.

  1. The code (of the class in java is here)

https://gist.github.com/jorgecc/c9bec0c17bac4df51b2ac58bc3ff01b3

  1. And the plugins compiled is here <-- 😉 (tl/dr use this one)

https://github.com/jorgecc/phpunit_codecoverage_display/blob/master/phpunit_codecoverage_display.jar

How to install it?

In PHPStorm -> plugins -> (the wheel menu) -> Install Plugins from disk -> select the file and restart PHPStorm. It should replace the old plugins.

And what if it fails? Shrug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions