Missing endpoint on cleanup of unit tests in my custom plugin on IntelliJ 2020.1 EAP.

Answered

Hi,

I am working on IntelliJ 2020.1 compatibility for my XQuery plugin [1]. I have the project running on that platform, but several of my unit tests are failing in the tearDown function during cleanup. I've traced this to two cases, both of which occur in an update triggered from a call to notifyListeners on an endpoint trying to use an already disposed service or endpoint.

The first class of failures are with some setName/handleElementRename tests I have that are calling rename on the PsiElement implementation. I am registering the needed functionality for rename calls to work [2]. On IntelliJ 2020.1, the tearDown logic is failing in CodeStyleSettings#getCurrentSettings via notifyCodeStyleSettingsChanged because CodeStyleSchemes has been unregistered at this point. I cannot figure out an order to register these classes as they are all interdependent on each other.

The second class of failures are with DomFileDescription tests [3]. On IntelliJ 2020.1, the DomApplicationComponent#extensionsChanged method is calling registerDescriptions, which is using both DomFileDescription and DomFileMetaData endpoints. For this, I need a way to clean up both of these endpoints without invoking the extensionsChanged logic.

Any help fixing these errors would be greatly appreciated.

Kind regards,

Reece

[1] https://github.com/rhdunn/xquery-intellij-plugin

[2] https://github.com/rhdunn/xquery-intellij-plugin/blob/master/src/intellij-mock/main/uk/co/reecedunn/intellij/plugin/core/tests/parser/ParsingTestCase.kt#L157

[3] https://github.com/rhdunn/xquery-intellij-plugin/blob/master/src/lang-xslt/test/uk/co/reecedunn/intellij/plugin/xslt/tests/parser/ParserTestCase.kt#L63

0

Please sign in to leave a comment.