testFun(first: String, second: Int) = 12
+
+// INFO: internal fun testFun(first: jet.String, second: jet.Int): jet.Int defined in test
Test function
@param - first - Some
@param - second - Other
\ No newline at end of file
diff --git a/idea/testData/editor/quickDoc/OnMethodUsage.kt b/idea/testData/editor/quickDoc/OnMethodUsage.kt
new file mode 100644
index 00000000000..529988e3239
--- /dev/null
+++ b/idea/testData/editor/quickDoc/OnMethodUsage.kt
@@ -0,0 +1,15 @@
+/**
+ Some documentation
+
+ @param a - Some int
+ * @param b: String
+ */
+fun testMethod(a: Int, b: String) {
+
+}
+
+fun test() {
+ testMethod(1, "value")
+}
+
+// INFO: internal fun testMethod(a: jet.Int, b: jet.String): jet.Unit defined in root package
Some documentation
@param - a - Some int
@param - b: String
\ No newline at end of file
diff --git a/idea/tests/org/jetbrains/jet/editor/quickDoc/AbstractJetQuickDocProviderTest.java b/idea/tests/org/jetbrains/jet/editor/quickDoc/AbstractJetQuickDocProviderTest.java
new file mode 100644
index 00000000000..fa21406adde
--- /dev/null
+++ b/idea/tests/org/jetbrains/jet/editor/quickDoc/AbstractJetQuickDocProviderTest.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2010-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.jet.editor.quickDoc;
+
+import com.intellij.codeInsight.documentation.DocumentationManager;
+import com.intellij.codeInsight.navigation.CtrlMouseHandler;
+import com.intellij.psi.PsiElement;
+import com.intellij.testFramework.LightProjectDescriptor;
+import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.jet.InTextDirectivesUtils;
+import org.jetbrains.jet.plugin.ProjectDescriptorWithStdlibSources;
+
+import java.util.List;
+
+public abstract class AbstractJetQuickDocProviderTest extends LightCodeInsightFixtureTestCase {
+ public void doTest(@NotNull String path) throws Exception {
+ myFixture.configureByFile(path);
+
+ PsiElement element = myFixture.getFile().findElementAt(myFixture.getEditor().getCaretModel().getOffset());
+ assertNotNull("Can't find element at caret in file: " + path, element);
+
+ DocumentationManager documentationManager = DocumentationManager.getInstance(myFixture.getProject());
+ PsiElement targetElement = documentationManager.findTargetElement(myFixture.getEditor(), myFixture.getFile());
+
+ List directives = InTextDirectivesUtils.findLinesWithPrefixesRemoved(myFixture.getFile().getText(), "INFO:");
+ assertTrue("Documentation to check should be added to test file with // INFO: directive " + path, 1 == directives.size());
+
+ assertEquals(directives.get(0), CtrlMouseHandler.getInfo(targetElement, element));
+ }
+
+ @NotNull
+ @Override
+ protected LightProjectDescriptor getProjectDescriptor() {
+ return ProjectDescriptorWithStdlibSources.INSTANCE;
+ }
+}
diff --git a/idea/tests/org/jetbrains/jet/editor/quickDoc/JetQuickDocProviderTestGenerated.java b/idea/tests/org/jetbrains/jet/editor/quickDoc/JetQuickDocProviderTestGenerated.java
new file mode 100644
index 00000000000..e0c6c8f15e0
--- /dev/null
+++ b/idea/tests/org/jetbrains/jet/editor/quickDoc/JetQuickDocProviderTestGenerated.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2010-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.jet.editor.quickDoc;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import java.io.File;
+import java.util.regex.Pattern;
+import org.jetbrains.jet.JetTestUtils;
+import org.jetbrains.jet.test.InnerTestClasses;
+import org.jetbrains.jet.test.TestMetadata;
+
+import org.jetbrains.jet.editor.quickDoc.AbstractJetQuickDocProviderTest;
+
+/** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */
+@SuppressWarnings("all")
+@TestMetadata("idea/testData/editor/quickDoc")
+public class JetQuickDocProviderTestGenerated extends AbstractJetQuickDocProviderTest {
+ public void testAllFilesPresentInQuickDoc() throws Exception {
+ JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/editor/quickDoc"), Pattern.compile("^(.+)\\.kt$"), true);
+ }
+
+ @TestMetadata("MethodFromStdLib.kt")
+ public void testMethodFromStdLib() throws Exception {
+ doTest("idea/testData/editor/quickDoc/MethodFromStdLib.kt");
+ }
+
+ @TestMetadata("OnClassDeclarationWithNoPackage.kt")
+ public void testOnClassDeclarationWithNoPackage() throws Exception {
+ doTest("idea/testData/editor/quickDoc/OnClassDeclarationWithNoPackage.kt");
+ }
+
+ @TestMetadata("OnFunctionDeclarationWithPackage.kt")
+ public void testOnFunctionDeclarationWithPackage() throws Exception {
+ doTest("idea/testData/editor/quickDoc/OnFunctionDeclarationWithPackage.kt");
+ }
+
+ @TestMetadata("OnMethodUsage.kt")
+ public void testOnMethodUsage() throws Exception {
+ doTest("idea/testData/editor/quickDoc/OnMethodUsage.kt");
+ }
+
+}