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:
- Create a blank new plugin project
- Add NullRangeIgnoreProvider class (listed below)
- Register it in plugin.xml (listed below)
- Build and run the plugin
- Open a project
- Perform a diff, e.g. by right-clicking in the project tree and using Git, Compare with Branch
- Click the dropdown saying Do not ignore
- 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>
Please sign in to leave a comment.
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.
Thanks, filed: https://youtrack.jetbrains.com/issue/IDEA-335638