DiffIgnoredRangeProvider extension sometimes not listed in dropdown

Answered

I created a plugin with only a no-op DiffIgnoredRangeProvider and it sometimes doesn't show up in the dropdown. I'm at a loss for debugging this.

Here are repro steps:

  1. Create a blank new plugin project
  2. Add NullRangeIgnoreProvider class (listed below)
  3. Register it in plugin.xml (listed below)
  4. Build and run the plugin
  5. Open a project
  6. Perform a diff, e.g. by right-clicking in the project tree and using Git, Compare with Branch
  7. Click the dropdown saying Do not ignore
  8. Sometimes the newly added no-op provider doesn't show up in the drop down.

The annoying thing is most of the time is just works, until suddenly it doesn't. I haven't been able to correlate it with e.g. diff size but it does appear to happen more often with an otherwise more complicated plugin (more extension points, tool windows, etc.).

---

NullIgnoreRangeProvider class:

class NullIgnoreProvider : DiffIgnoredRangeProvider {
    override fun getDescription(): String {
        return "Ignore nothing (no-op provider)";
    }

    override fun accepts(project: Project?, content: DiffContent): Boolean {
        return true;
    }

    override fun getIgnoredRanges(project: Project?, text: CharSequence, content: DiffContent): MutableList<TextRange> {
        return ArrayList();
    }
}

 plugin.xml snippet:

    <extensions defaultExtensionNs="com.intellij">
        <diff.lang.DiffIgnoredRangeProvider implementation="com.example.nullignoreplugin.NullIgnoreProvider" />
    </extensions>

 

 

0
2 comments

Hi Sijmen,

It looks like a bug, as the implementation doesn't have any suspicious logic.

Please create an issue on https://youtrack.jetbrains.com/issues/IDEA

Subsystem: Editor. Diff and Merge.

Please also attach logs and IDE details (copied from the About IntelliJ IDEA window).

Thanks.

0

Please sign in to leave a comment.