mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
[xml] WEB-68929 Tests. Copy element factory helper for AntParsingTest
GitOrigin-RevId: 262cca06f0592067d149cb4370fec5659e736931
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8640517101
commit
4fdfbbdbbe
@@ -12,6 +12,8 @@ import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.psi.xml.StartTagEndTokenProvider;
|
||||
import com.intellij.testFramework.ParsingTestCase;
|
||||
|
||||
import static com.intellij.lang.ant.XmlElementTypeServiceHelper.registerXmlElementTypeServices;
|
||||
|
||||
public class AntParsingTest extends ParsingTestCase {
|
||||
|
||||
public AntParsingTest() {
|
||||
@@ -21,6 +23,7 @@ public class AntParsingTest extends ParsingTestCase {
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
registerXmlElementTypeServices(getApplication(), getTestRootDisposable());
|
||||
addExplicitExtension(LanguageASTFactory.INSTANCE, XMLLanguage.INSTANCE, new XmlASTFactory());
|
||||
registerExtensionPoint(new ExtensionPointName<>("com.intellij.xml.startTagEndToken"),
|
||||
StartTagEndTokenProvider.class);
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.intellij.lang.ant
|
||||
|
||||
import com.intellij.lang.html.BackendHtmlElementFactory
|
||||
import com.intellij.lang.html.BasicHtmlElementFactory
|
||||
import com.intellij.lang.xml.BackendXmlElementFactory
|
||||
import com.intellij.lang.xml.BasicXmlElementFactory
|
||||
import com.intellij.mock.MockApplication
|
||||
import com.intellij.openapi.Disposable
|
||||
|
||||
/**
|
||||
* Copy of [com.intellij.xml.XmlElementTypeServiceHelper]
|
||||
* Copied to avoid "cyclic module dependency" exception
|
||||
*/
|
||||
internal object XmlElementTypeServiceHelper {
|
||||
@JvmStatic
|
||||
fun registerXmlElementTypeServices(
|
||||
application: MockApplication,
|
||||
testRootDisposable: Disposable,
|
||||
) {
|
||||
application.registerService(
|
||||
BasicXmlElementFactory::class.java,
|
||||
BackendXmlElementFactory(),
|
||||
testRootDisposable,
|
||||
)
|
||||
|
||||
application.registerService(
|
||||
BasicHtmlElementFactory::class.java,
|
||||
BackendHtmlElementFactory(),
|
||||
testRootDisposable,
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user