diff --git a/plugins/devkit/devkit.iml b/plugins/devkit/devkit.iml index 8c3fc8591ea3..494abc9156c7 100644 --- a/plugins/devkit/devkit.iml +++ b/plugins/devkit/devkit.iml @@ -39,6 +39,7 @@ + diff --git a/plugins/devkit/src/dom/Extensions.java b/plugins/devkit/src/dom/Extensions.java index 6428d351a5b8..ebf9ef53df82 100644 --- a/plugins/devkit/src/dom/Extensions.java +++ b/plugins/devkit/src/dom/Extensions.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,10 +19,7 @@ package org.jetbrains.idea.devkit.dom; -import com.intellij.util.xml.Attribute; -import com.intellij.util.xml.Convert; -import com.intellij.util.xml.DomElement; -import com.intellij.util.xml.GenericAttributeValue; +import com.intellij.util.xml.*; import org.jetbrains.annotations.NotNull; import org.jetbrains.idea.devkit.dom.impl.ExtensionNsConverter; @@ -32,10 +29,12 @@ public interface Extensions extends DomElement { @NotNull @Attribute("defaultExtensionNs") @Convert(value=ExtensionNsConverter.class, soft=true) + @Stubbed GenericAttributeValue getDefaultExtensionNs(); @NotNull @Convert(value=ExtensionNsConverter.class, soft=true) + @Stubbed GenericAttributeValue getXmlns(); List getExtensions(); diff --git a/plugins/devkit/src/dom/IdeaPlugin.java b/plugins/devkit/src/dom/IdeaPlugin.java index 6b5bb48f2cf3..d624be71008e 100644 --- a/plugins/devkit/src/dom/IdeaPlugin.java +++ b/plugins/devkit/src/dom/IdeaPlugin.java @@ -105,6 +105,7 @@ public interface IdeaPlugin extends DomElement { @NotNull @SubTagList("extensions") + @Stubbed List getExtensions(); Extensions addExtensions(); diff --git a/plugins/devkit/src/dom/impl/PluginXmlDomFileDescription.java b/plugins/devkit/src/dom/impl/PluginXmlDomFileDescription.java index 2c2eb77ee831..f0dd66b5f8c4 100644 --- a/plugins/devkit/src/dom/impl/PluginXmlDomFileDescription.java +++ b/plugins/devkit/src/dom/impl/PluginXmlDomFileDescription.java @@ -103,4 +103,9 @@ public class PluginXmlDomFileDescription extends DomFileDescription public boolean hasStubs() { return true; } + + @Override + public int getStubVersion() { + return 2; + } } diff --git a/plugins/devkit/testData/codeInsight/pluginXmlStubs.xml b/plugins/devkit/testData/codeInsight/pluginXmlStubs.xml new file mode 100644 index 000000000000..300033972a3a --- /dev/null +++ b/plugins/devkit/testData/codeInsight/pluginXmlStubs.xml @@ -0,0 +1,20 @@ + + com.intellij.myPlugin + pluginName + + anotherPlugin + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/devkit/testSources/codeInsight/PluginXmlDomStubsTest.java b/plugins/devkit/testSources/codeInsight/PluginXmlDomStubsTest.java new file mode 100644 index 000000000000..4326a14aab4f --- /dev/null +++ b/plugins/devkit/testSources/codeInsight/PluginXmlDomStubsTest.java @@ -0,0 +1,52 @@ +/* + * Copyright 2000-2013 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.devkit.codeInsight; + +import com.intellij.openapi.application.PluginPathManager; +import com.intellij.util.xml.stubs.DomStubTest; + +public class PluginXmlDomStubsTest extends DomStubTest { + + public void testStubs() { + doBuilderTest("pluginXmlStubs.xml", + "File:idea-plugin\n" + + " Element:idea-plugin\n" + + " Element:id\n" + + " Element:name\n" + + " Element:depends\n" + + " Element:module\n" + + " Attribute:value:myModule\n" + + " Element:extensions\n" + + " Attribute:xmlns:someNS\n" + + " Attribute:defaultExtensionNs:com.intellij\n" + + " Element:extensionPoints\n" + + " Element:extensionPoint\n" + + " Attribute:name:myEP\n" + + " Attribute:interface:SomeInterface\n" + + " Element:with\n" + + " Attribute:attribute:attributeName\n" + + " Attribute:implements:SomeImplements\n" + + " Element:extensionPoint\n" + + " Attribute:qualifiedName:qualifiedName\n" + + " Attribute:beanClass:BeanClass\n" + ); + } + + @Override + protected String getBasePath() { + return PluginPathManager.getPluginHomePathRelative("devkit") + "/testData/codeInsight"; + } +}