Merge remote-tracking branch 'origin/master'

This commit is contained in:
Roman Shevchenko
2016-09-22 14:41:18 +03:00
185 changed files with 2489 additions and 1979 deletions
@@ -258,7 +258,7 @@ class Test88 {
void testNoCollectorsInComment() { doAntiTest() }
void testNoContinueInsideLambdaInLoop() { doAntiTest(); }
void testNoContinueInsideLambdaInLoop() { doAntiTest() }
void testNoSemicolonAfterVoidMethodInLambda() {
configureByTestName()
@@ -26,20 +26,20 @@ class NormalCompletionDfaTest extends LightFixtureCompletionTestCase {
return JavaTestUtil.getRelativeJavaTestDataPath() + "/codeInsight/completion/normal/"
}
void testCastInstanceofedQualifier() { doTest(); }
void testCastInstanceofedQualifierInForeach() { doTest(); }
void testCastComplexInstanceofedQualifier() { doTest(); }
void _testCastIncompleteInstanceofedQualifier() { doTest(); }
void testCastInstanceofedQualifier() { doTest() }
void testCastInstanceofedQualifierInForeach() { doTest() }
void testCastComplexInstanceofedQualifier() { doTest() }
void _testCastIncompleteInstanceofedQualifier() { doTest() }
void testCastTooComplexInstanceofedQualifier() { doAntiTest() }
void testDontCastInstanceofedQualifier() { doTest(); }
void testDontCastPartiallyInstanceofedQualifier() { doAntiTest(); }
void testQualifierCastingWithUnknownAssignments() { doTest(); }
void testQualifierCastingBeforeLt() { doTest(); }
void testCastQualifierForPrivateFieldReference() { doTest(); }
void testOrAssignmentDfa() { doTest(); }
void testFieldWithCastingCaret() { doTest(); }
void testDontCastInstanceofedQualifier() { doTest() }
void testDontCastPartiallyInstanceofedQualifier() { doAntiTest() }
void testQualifierCastingWithUnknownAssignments() { doTest() }
void testQualifierCastingBeforeLt() { doTest() }
void testCastQualifierForPrivateFieldReference() { doTest() }
void testOrAssignmentDfa() { doTest() }
void testFieldWithCastingCaret() { doTest() }
void testCastTwice() {
configureByTestName()
@@ -204,9 +204,9 @@ class NormalCompletionTest extends LightFixtureCompletionTestCase {
assertTrue("Exception not found", Arrays.binarySearch(myItems, "xxx") > 0)
}
void testClassLiteralInArrayAnnoInitializer() throws Throwable { doTest(); }
void testClassLiteralInArrayAnnoInitializer() throws Throwable { doTest() }
void testClassLiteralInArrayAnnoInitializer2() throws Throwable { doTest(); }
void testClassLiteralInArrayAnnoInitializer2() throws Throwable { doTest() }
void testReferenceParameters() throws Exception {
configureByFile("ReferenceParameters.java")
@@ -398,13 +398,13 @@ class NormalCompletionTest extends LightFixtureCompletionTestCase {
checkResult()
}
void testFieldType() { doTest(); }
void testFieldType() { doTest() }
void testPackageInAnnoParam() throws Throwable {
doTest()
}
void testAnonymousTypeParameter() throws Throwable { doTest(); }
void testAnonymousTypeParameter() throws Throwable { doTest() }
void testClassLiteralInAnnoParam() throws Throwable {
doTest()
@@ -473,9 +473,9 @@ public class Outer {
doTest('\n')
}
void testLocalClassName() throws Throwable { doTest(); }
void testLocalClassName() throws Throwable { doTest() }
void testAssigningFieldForTheFirstTime() throws Throwable { doTest(); }
void testAssigningFieldForTheFirstTime() throws Throwable { doTest() }
void testClassTypeParameters() throws Throwable {
configure()
@@ -538,9 +538,9 @@ public class Outer {
doTest()
}
void testBreakInIfCondition() throws Throwable { doTest(); }
void testBreakInIfCondition() throws Throwable { doTest() }
void testAccessStaticViaInstance() throws Throwable { doTest(); }
void testAccessStaticViaInstance() throws Throwable { doTest() }
void testIfConditionLt() {
configure()
@@ -559,7 +559,7 @@ public class Outer {
checkResult()
}
void testContinueLabel() throws Throwable { doTest(); }
void testContinueLabel() throws Throwable { doTest() }
void testAnonymousProcess() {
myFixture.addClass 'package java.lang; public class Process {}'
@@ -584,7 +584,7 @@ public class ListUtils {
assert !('null' in myFixture.lookupElementStrings)
}
void testLastExpressionInFor() throws Throwable { doTest(); }
void testLastExpressionInFor() throws Throwable { doTest() }
void testOnlyKeywordsInsideSwitch() throws Throwable {
configureByFile(getTestName(false) + ".java")
@@ -621,7 +621,7 @@ public class ListUtils {
checkResult()
}
void testEnclosingThis() throws Throwable { doTest(); }
void testEnclosingThis() throws Throwable { doTest() }
void testSeamlessConstant() throws Throwable {
configureByFile(getTestName(false) + ".java")
@@ -629,7 +629,7 @@ public class ListUtils {
checkResult()
}
void testDefaultAnnoParam() throws Throwable { doTest(); }
void testDefaultAnnoParam() throws Throwable { doTest() }
void testSpaceAfterLookupString() throws Throwable {
configureByFile(getTestName(false) + ".java")
@@ -684,7 +684,7 @@ public class ListUtils {
doTest()
}
void testInnerEnumConstant() throws Throwable { doTest('\n'); }
void testInnerEnumConstant() throws Throwable { doTest('\n') }
void testNoExpectedReturnTypeDuplication() {
configure()
@@ -717,15 +717,15 @@ public class ListUtils {
doTest()
}
void testNothingAfterNumericLiteral() throws Throwable { doAntiTest(); }
void testNothingAfterNumericLiteral() throws Throwable { doAntiTest() }
void testNothingAfterTypeParameterQualifier() { doAntiTest(); }
void testNothingAfterTypeParameterQualifier() { doAntiTest() }
void testExcludeVariableBeingDeclared() { doAntiTest(); }
void testExcludeVariableBeingDeclared() { doAntiTest() }
void testExcludeVariableBeingDeclared2() { doAntiTest(); }
void testExcludeVariableBeingDeclared2() { doAntiTest() }
void testSpacesAroundEq() throws Throwable { doTest('='); }
void testSpacesAroundEq() throws Throwable { doTest('=') }
void _testClassBeforeCast() throws Throwable { doTest '\n' }
@@ -755,7 +755,7 @@ public class ListUtils {
checkResult()
}
void testFieldNegation() throws Throwable { doTest('!'); }
void testFieldNegation() throws Throwable { doTest('!') }
void testDefaultInSwitch() throws Throwable { doTest() }
@@ -797,11 +797,11 @@ public class ListUtils {
doTest()
}
void testSecondMethodParameter() throws Throwable { doTest(); }
void testSecondMethodParameter() throws Throwable { doTest() }
void testReturnInCase() throws Throwable { doTest(); }
void testReturnInCase() throws Throwable { doTest() }
void testUnboxedConstantsInCase() throws Throwable { doTest(); }
void testUnboxedConstantsInCase() throws Throwable { doTest() }
void testAnnotationWithoutValueMethod() throws Throwable {
configureByFile(getTestName(false) + ".java")
@@ -858,13 +858,13 @@ public class ListUtils {
doTest()
}
void testNoSemicolonAfterExistingParenthesesEspeciallyIfItsACast() throws Throwable { doTest(); }
void testNoSemicolonAfterExistingParenthesesEspeciallyIfItsACast() throws Throwable { doTest() }
void testReturningTypeVariable() throws Throwable { doTest(); }
void testReturningTypeVariable() throws Throwable { doTest() }
void testReturningTypeVariable2() throws Throwable { doTest(); }
void testReturningTypeVariable2() throws Throwable { doTest() }
void testReturningTypeVariable3() throws Throwable { doTest(); }
void testReturningTypeVariable3() throws Throwable { doTest() }
void testImportInGenericType() throws Throwable {
configure()
@@ -873,7 +873,7 @@ public class ListUtils {
checkResult()
}
void testCaseTailType() throws Throwable { doTest(); }
void testCaseTailType() throws Throwable { doTest() }
def doPrimitiveTypeTest() {
configure()
@@ -963,7 +963,7 @@ public class ListUtils {
checkResult()
}
void testSecondAnonymousClassParameter() { doTest(); }
void testSecondAnonymousClassParameter() { doTest() }
void testSpaceAfterReturn() throws Throwable {
configure()
@@ -980,7 +980,7 @@ public class ListUtils {
assertStringItems "fooa", "foob"
}
void testNoReturnInTernary() throws Throwable { doTest(); }
void testNoReturnInTernary() throws Throwable { doTest() }
void testWildcardsInLookup() throws Exception {
configure()
@@ -999,11 +999,11 @@ public class ListUtils {
void testSmartEnterInsideArrayBrackets() { doTest(Lookup.COMPLETE_STATEMENT_SELECT_CHAR as String) }
void testTabReplacesMethodNameWithLocalVariableName() throws Throwable { doTest('\t'); }
void testTabReplacesMethodNameWithLocalVariableName() throws Throwable { doTest('\t') }
void testMethodParameterAnnotationClass() throws Throwable { doTest(); }
void testMethodParameterAnnotationClass() throws Throwable { doTest() }
void testInnerAnnotation() { doTest('\n'); }
void testInnerAnnotation() { doTest('\n') }
void testPrimitiveCastOverwrite() throws Throwable { doTest() }
@@ -1016,11 +1016,11 @@ public class ListUtils {
doTest ' '
}
void testEnumConstantFromEnumMember() throws Throwable { doTest(); }
void testEnumConstantFromEnumMember() throws Throwable { doTest() }
void testPrimitiveMethodParameter() throws Throwable { doTest(); }
void testPrimitiveMethodParameter() throws Throwable { doTest() }
void testNewExpectedClassParens() throws Throwable { doTest('\n'); }
void testNewExpectedClassParens() throws Throwable { doTest('\n') }
void testQualifyInnerMembers() throws Throwable { doTest('\n') }
@@ -53,26 +53,26 @@ class SmartTypeCompletionDfaTest extends LightFixtureCompletionTestCase {
checkResultByTestName()
}
void testSuggestCastedValueAfterCast() { doTest(); }
void testSuggestCastedValueAfterCast() { doTest() }
void testSuggestInstanceofedValue() { doTest() }
void testSuggestInstanceofedValueInTernary() { doTest() }
void testSuggestInstanceofedValueInComplexIf() { doTest(); }
void testSuggestInstanceofedValueInComplexIf() { doTest() }
void testSuggestInstanceofedValueInElseNegated() { doTest(); }
void testSuggestInstanceofedValueInElseNegated() { doTest() }
void testSuggestInstanceofedValueAfterReturn() { doTest(); }
void testSuggestInstanceofedValueAfterReturn() { doTest() }
void testNoInstanceofedValueWhenBasicSuits() { doTest(); }
void testNoInstanceofedValueWhenBasicSuits() { doTest() }
void testNoInstanceofedValueInElse() { doAntiTest(); }
void testNoInstanceofedValueInElse() { doAntiTest() }
void testNoInstanceofedValueInThenNegated() { doAntiTest(); }
void testNoInstanceofedValueInThenNegated() { doAntiTest() }
void testNoInstanceofedValueInElseWithComplexIf() { doAntiTest(); }
void testNoInstanceofedValueInElseWithComplexIf() { doAntiTest() }
void testInstanceofedInsideAnonymous() { doTest(); }
void testInstanceofedInsideAnonymous() { doTest() }
}
@@ -16,11 +16,9 @@
package com.intellij.codeInsight.daemon.inlays
import com.intellij.codeInsight.daemon.impl.ParameterHintsPresentationManager
import com.intellij.codeInsight.folding.JavaCodeFoldingSettings
import com.intellij.codeInsight.folding.impl.JavaCodeFoldingSettingsImpl
import com.intellij.openapi.editor.Inlay
import com.intellij.openapi.editor.ex.EditorSettingsExternalizable
import com.intellij.openapi.util.TextRange
import com.intellij.openapi.util.registry.Registry
import com.intellij.psi.PsiFile
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase
import com.intellij.util.DocumentUtil
@@ -29,24 +27,27 @@ import org.assertj.core.api.Assertions.assertThat
class InlayParameterHintsTest: LightCodeInsightFixtureTestCase() {
lateinit var registryStateBefore: String
lateinit var myFoldingSettings: JavaCodeFoldingSettingsImpl
lateinit var myFoldingStateToRestore: JavaCodeFoldingSettingsImpl
private var isParamHintsEnabledBefore = false
private var minParamLength = 3
private var minArgsToShow = 2
override fun setUp() {
super.setUp()
val registry = Registry.get("editor.inline.parameter.hints")
registryStateBefore = registry.asString()
registry.setValue(true)
myFoldingSettings = JavaCodeFoldingSettings.getInstance() as JavaCodeFoldingSettingsImpl
myFoldingStateToRestore = JavaCodeFoldingSettingsImpl()
myFoldingStateToRestore.loadState(myFoldingSettings)
val settings = EditorSettingsExternalizable.getInstance()
isParamHintsEnabledBefore = settings.isShowParameterNameHints
minParamLength = settings.minParamNameLengthToShow
minArgsToShow = settings.minArgsToShow
settings.isShowParameterNameHints = true
}
override fun tearDown() {
Registry.get("editor.inline.parameter.hints").setValue(registryStateBefore)
myFoldingSettings.loadState(myFoldingStateToRestore)
val settings = EditorSettingsExternalizable.getInstance()
settings.isShowParameterNameHints = isParamHintsEnabledBefore
settings.minParamNameLengthToShow = minParamLength
settings.minArgsToShow = minArgsToShow
super.tearDown()
}
@@ -259,11 +260,10 @@ public class CharSymbol {
}
fun `test inline literal arguments with crazy settings`() {
val foldingSettings = JavaCodeFoldingSettings.getInstance()
foldingSettings.isInlineParameterNamesForLiteralCallArguments = true;
foldingSettings.inlineLiteralParameterMinArgumentsToFold = 1;
foldingSettings.inlineLiteralParameterMinNameLength = 1;
val settings = EditorSettingsExternalizable.getInstance()
settings.minArgsToShow = 1
settings.minParamNameLengthToShow = 1
setup("""
public class Test {
public void main(boolean isActive, boolean requestFocus, int xoo) {
@@ -281,10 +281,9 @@ public class Test {
}
fun `test hints for generic arguments`() {
val foldingSettings = JavaCodeFoldingSettings.getInstance()
foldingSettings.isInlineParameterNamesForLiteralCallArguments = true
foldingSettings.inlineLiteralParameterMinArgumentsToFold = 1
foldingSettings.inlineLiteralParameterMinNameLength = 1
val settings = EditorSettingsExternalizable.getInstance()
settings.minArgsToShow = 1
settings.minParamNameLengthToShow = 1
setup("""
import java.util.*;
@@ -29,7 +29,7 @@ import com.intellij.psi.util.PsiTreeUtil
* @author ven
*/
class CreateMethodFromUsageTest extends LightQuickFixTestCase {
void test() throws Exception { doAllTests(); }
void test() throws Exception { doAllTests() }
void testTemplateAssertions() throws Exception {
configureFromFileText "a.java", """
@@ -1128,7 +1128,7 @@ class Foo {
((TemplateImpl)template).templateContext.setEnabled(contextType(JavaCodeContextType.class), true)
CodeInsightTestUtil.addTemplate(template, testRootDisposable)
writeCommand { startTemplate(template); }
writeCommand { startTemplate(template) }
myFixture.checkResult """\
class Foo {
{