mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote branch 'origin/master'
This commit is contained in:
@@ -22,6 +22,7 @@ import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiMigration;
|
||||
import com.intellij.psi.impl.migration.PsiMigrationManager;
|
||||
import com.intellij.refactoring.BaseRefactoringProcessor;
|
||||
@@ -71,6 +72,11 @@ class MigrationProcessor extends BaseRefactoringProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void refreshElements(PsiElement[] elements) {
|
||||
myPsiMigration = startMigration(myProject);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected UsageInfo[] findUsages() {
|
||||
ArrayList<UsageInfo> usagesVector = new ArrayList<UsageInfo>();
|
||||
|
||||
@@ -1409,7 +1409,7 @@ public class Mappings {
|
||||
|
||||
debug("Processing removed fields:");
|
||||
for (FieldRepr f : diff.fields().removed()) {
|
||||
debug("Field: ", it.name);
|
||||
debug("Field: ", f.name);
|
||||
|
||||
if ((f.access & Opcodes.ACC_PRIVATE) == 0 && (f.access & mask) == mask && f.hasValue()) {
|
||||
debug("Field had value and was (non-private) final static => a switch to non-incremental mode requested");
|
||||
|
||||
@@ -116,7 +116,7 @@ public class LayeredIcon implements Icon {
|
||||
|
||||
@Override
|
||||
public int getIconWidth() {
|
||||
if (myWidth == 0) {
|
||||
if (myWidth <= 1) { //icon is not loaded yet
|
||||
recalculateSize();
|
||||
}
|
||||
return myWidth;
|
||||
@@ -124,7 +124,7 @@ public class LayeredIcon implements Icon {
|
||||
|
||||
@Override
|
||||
public int getIconHeight() {
|
||||
if (myHeight == 0) {
|
||||
if (myHeight <= 1) { //icon is not loaded yet
|
||||
recalculateSize();
|
||||
}
|
||||
return myHeight;
|
||||
|
||||
@@ -32,10 +32,12 @@ import com.intellij.openapi.extensions.ExtensionPoint;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.updateSettings.impl.UpdateChecker;
|
||||
import com.intellij.openapi.updateSettings.impl.UpdateSettings;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.wm.WindowManager;
|
||||
import com.intellij.openapi.wm.impl.WindowManagerImpl;
|
||||
import com.intellij.ui.Splash;
|
||||
@@ -212,9 +214,14 @@ public class IdeaApplication {
|
||||
loadProject();
|
||||
}
|
||||
|
||||
if (UpdateChecker.isMyVeryFirstOpening() && UpdateChecker.checkNeeded()) {
|
||||
UpdateChecker.setMyVeryFirstOpening(false);
|
||||
UpdateChecker.updateAndShowResult();
|
||||
final UpdateSettings settings = UpdateSettings.getInstance();
|
||||
if (settings != null) {
|
||||
final ApplicationInfo appInfo = ApplicationInfo.getInstance();
|
||||
if (StringUtil.compareVersionNumbers(settings.LAST_BUILD_CHECKED, appInfo.getBuild().asString()) < 0 ||
|
||||
(UpdateChecker.isMyVeryFirstOpening() && UpdateChecker.checkNeeded())) {
|
||||
UpdateChecker.setMyVeryFirstOpening(false);
|
||||
UpdateChecker.updateAndShowResult();
|
||||
}
|
||||
}
|
||||
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ public class CheckForUpdateAction extends AnAction implements DumbAware {
|
||||
return;
|
||||
}
|
||||
|
||||
instance.LAST_TIME_CHECKED = System.currentTimeMillis();
|
||||
instance.saveLastCheckedInfo();
|
||||
UpdateChecker.showUpdateResult(result, updatedPlugins, true, enableLink, true);
|
||||
}
|
||||
});
|
||||
|
||||
+1
-1
@@ -428,7 +428,7 @@ public final class UpdateChecker {
|
||||
final CheckForUpdateResult result = doCheckForUpdates(updateSettings);
|
||||
|
||||
if (result.getState() == UpdateStrategy.State.LOADED) {
|
||||
updateSettings.LAST_TIME_CHECKED = System.currentTimeMillis();
|
||||
updateSettings.saveLastCheckedInfo();
|
||||
settings.setKnownChannelIds(result.getAllChannelsIds());
|
||||
}
|
||||
|
||||
|
||||
+8
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.openapi.updateSettings.impl;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationInfo;
|
||||
import com.intellij.openapi.application.impl.ApplicationInfoImpl;
|
||||
import com.intellij.openapi.components.PersistentStateComponent;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
@@ -55,6 +56,7 @@ public class UpdateSettings implements PersistentStateComponent<Element>, UserUp
|
||||
|
||||
public boolean CHECK_NEEDED = true;
|
||||
public long LAST_TIME_CHECKED = 0;
|
||||
public String LAST_BUILD_CHECKED = "";
|
||||
public String UPDATE_CHANNEL_TYPE = ChannelStatus.RELEASE_CODE;
|
||||
|
||||
public static UpdateSettings getInstance() {
|
||||
@@ -65,6 +67,12 @@ public class UpdateSettings implements PersistentStateComponent<Element>, UserUp
|
||||
updateDefaultChannel();
|
||||
}
|
||||
|
||||
public void saveLastCheckedInfo() {
|
||||
LAST_TIME_CHECKED = System.currentTimeMillis();
|
||||
ApplicationInfo appInfo = ApplicationInfo.getInstance();
|
||||
LAST_BUILD_CHECKED = appInfo.getBuild().asString();
|
||||
}
|
||||
|
||||
private void updateDefaultChannel() {
|
||||
if (ApplicationInfoImpl.getShadowInstance().isEAP()) {
|
||||
UPDATE_CHANNEL_TYPE = ChannelStatus.EAP_CODE;
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.intellij.reference.SoftReference;
|
||||
import com.intellij.util.ImageLoader;
|
||||
import com.intellij.util.containers.ConcurrentHashMap;
|
||||
import com.intellij.util.containers.WeakHashMap;
|
||||
import com.intellij.util.ui.EmptyIcon;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -46,7 +45,7 @@ public final class IconLoader {
|
||||
*/
|
||||
private static final Map<Icon, Icon> ourIcon2DisabledIcon = new WeakHashMap<Icon, Icon>(200);
|
||||
|
||||
private static final Icon EMPTY_ICON = new EmptyIcon(0,0) {
|
||||
private static final ImageIcon EMPTY_ICON = new ImageIcon(new BufferedImage(1, 1, BufferedImage.TYPE_3BYTE_BGR)) {
|
||||
@NonNls
|
||||
public String toString() {
|
||||
return "Empty icon " + super.toString();
|
||||
|
||||
+8
-3
@@ -320,9 +320,14 @@ public final class AndroidDesignerEditorPanel extends DesignerEditorPanel {
|
||||
float xdpi = deviceConfiguration.getDevice().getXDpi();
|
||||
float ydpi = deviceConfiguration.getDevice().getYDpi();
|
||||
|
||||
mySession = RenderUtil
|
||||
.createRenderSession(getProject(), layoutXmlText, myFile, manager.getSelectedTarget(), facet, config, xdpi, ydpi,
|
||||
manager.getSelectedTheme());
|
||||
while (true) {
|
||||
mySession = RenderUtil
|
||||
.createRenderSession(getProject(), layoutXmlText, myFile, manager.getSelectedTarget(), facet, config, xdpi, ydpi,
|
||||
manager.getSelectedTheme(), 10000);
|
||||
if (mySession.getResult().getStatus() != Result.Status.ERROR_TIMEOUT) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
|
||||
@@ -69,7 +69,7 @@ class RenderService {
|
||||
|
||||
@Nullable
|
||||
@SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
|
||||
public RenderSession createRenderSession(@NotNull String layoutXmlText, @NotNull String appLabel)
|
||||
public RenderSession createRenderSession(@NotNull String layoutXmlText, @NotNull String appLabel, long timeout)
|
||||
throws FileNotFoundException, XmlPullParserException {
|
||||
|
||||
final ILayoutPullParser parser = new XmlParser();
|
||||
@@ -102,6 +102,7 @@ class RenderService {
|
||||
|
||||
params.setExtendedViewInfoMode(false);
|
||||
params.setAppLabel(appLabel);
|
||||
params.setTimeout(timeout);
|
||||
|
||||
final ScreenSizeQualifier screenSizeQualifier = myConfig.getScreenSizeQualifier();
|
||||
params.setConfigScreenSize(screenSizeQualifier != null ? screenSizeQualifier.getValue() : ScreenSize.NORMAL);
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package org.jetbrains.android.uipreview;
|
||||
|
||||
import com.android.ide.common.rendering.api.RenderResources;
|
||||
import com.android.ide.common.rendering.api.RenderSession;
|
||||
import com.android.ide.common.rendering.api.Result;
|
||||
import com.android.ide.common.rendering.api.*;
|
||||
import com.android.ide.common.resources.ResourceDeltaKind;
|
||||
import com.android.ide.common.resources.ResourceFolder;
|
||||
import com.android.ide.common.resources.ResourceRepository;
|
||||
@@ -73,7 +71,8 @@ public class RenderUtil {
|
||||
@NotNull FolderConfiguration config,
|
||||
float xdpi,
|
||||
float ydpi,
|
||||
@NotNull ThemeData theme)
|
||||
@NotNull ThemeData theme,
|
||||
long timeout)
|
||||
throws RenderingException, IOException, AndroidSdkNotConfiguredException {
|
||||
final Sdk sdk = ModuleRootManager.getInstance(facet.getModule()).getSdk();
|
||||
if (sdk == null || !(sdk.getSdkType() instanceof AndroidSdkType)) {
|
||||
@@ -121,7 +120,7 @@ public class RenderUtil {
|
||||
final RenderService renderService = factory.createService(pair.getFirst(), pair.getSecond(), config, xdpi, ydpi, callback, minSdkVersion);
|
||||
|
||||
try {
|
||||
return renderService.createRenderSession(layoutXmlText, getAppLabelToShow(facet));
|
||||
return renderService.createRenderSession(layoutXmlText, getAppLabelToShow(facet), timeout);
|
||||
}
|
||||
catch (XmlPullParserException e) {
|
||||
throw new RenderingException(e);
|
||||
@@ -198,7 +197,7 @@ public class RenderUtil {
|
||||
|
||||
final RenderSession session;
|
||||
try {
|
||||
session = renderService.createRenderSession(layoutXmlText, getAppLabelToShow(facet));
|
||||
session = renderService.createRenderSession(layoutXmlText, getAppLabelToShow(facet), RenderParams.DEFAULT_TIMEOUT);
|
||||
}
|
||||
catch (XmlPullParserException e) {
|
||||
throw new RenderingException(e);
|
||||
|
||||
+23
-5
@@ -264,7 +264,8 @@ public class GroovyAssignabilityCheckInspection extends BaseInspection {
|
||||
final PsiElement constructor = constructorResolveResult.getElement();
|
||||
|
||||
if (constructor != null) {
|
||||
checkConstructorApplicability(constructorResolveResult, refElement);
|
||||
if (!checkConstructorApplicability(constructorResolveResult, refElement)) return;
|
||||
if (!checkUnknownParams(refElement)) return;
|
||||
}
|
||||
else {
|
||||
final GroovyResolveResult[] results = constructorCall.multiResolveConstructor();
|
||||
@@ -275,7 +276,7 @@ public class GroovyAssignabilityCheckInspection extends BaseInspection {
|
||||
if (!checkConstructorApplicability(result, refElement)) return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!checkUnknownParams(refElement)) return;
|
||||
registerError(getElementToHighlight(refElement, argList), GroovyBundle.message("constructor.call.is.ambiguous"));
|
||||
}
|
||||
else {
|
||||
@@ -419,12 +420,12 @@ public class GroovyAssignabilityCheckInspection extends BaseInspection {
|
||||
final PsiType type = referenceExpression.getType();
|
||||
if (resolved != null ) {
|
||||
if (resolved instanceof PsiMethod && !resolveResult.isInvokedOnProperty()) {
|
||||
checkMethodApplicability(resolveResult, referenceExpression);
|
||||
if (!checkMethodApplicability(resolveResult, referenceExpression)) return;
|
||||
}
|
||||
else {
|
||||
checkCallApplicability(type, referenceExpression);
|
||||
if (!checkCallApplicability(type, referenceExpression)) return;
|
||||
}
|
||||
|
||||
if (!checkUnknownParams(referenceExpression)) return;
|
||||
}
|
||||
else if (results.length > 0) {
|
||||
for (GroovyResolveResult result : results) {
|
||||
@@ -436,6 +437,7 @@ public class GroovyAssignabilityCheckInspection extends BaseInspection {
|
||||
if (!checkCallApplicability(type, referenceExpression)) return;
|
||||
}
|
||||
}
|
||||
if (!checkUnknownParams(referenceExpression)) return;
|
||||
|
||||
registerError(getElementToHighlight(referenceExpression, PsiUtil.getArgumentsList(referenceExpression)),
|
||||
GroovyBundle.message("method.call.is.ambiguous"));
|
||||
@@ -443,6 +445,20 @@ public class GroovyAssignabilityCheckInspection extends BaseInspection {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkUnknownParams(PsiElement place) {
|
||||
PsiType[] args = PsiUtil.getArgumentTypes(place, true);
|
||||
if (args == null) return true;
|
||||
|
||||
for (PsiType arg : args) {
|
||||
if (arg == null) {
|
||||
registerError(getElementToHighlight(place, PsiUtil.getArgumentsList(place)), GroovyBundle.message("cannot.infer.argument.types"),
|
||||
LocalQuickFix.EMPTY_ARRAY, ProblemHighlightType.WEAK_WARNING);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean checkCannotInferArgumentTypes(PsiElement referenceExpression) {
|
||||
if (PsiUtil.getArgumentTypes(referenceExpression, true) != null) return false;
|
||||
|
||||
@@ -553,10 +569,12 @@ public class GroovyAssignabilityCheckInspection extends BaseInspection {
|
||||
PsiElement resolved = result.getElement();
|
||||
if (resolved instanceof PsiMethod && !result.isInvokedOnProperty()) {
|
||||
if (!checkMethodApplicability(result, invokedExpr)) return false;
|
||||
if (!checkUnknownParams(invokedExpr)) return false;
|
||||
}
|
||||
else if (resolved instanceof PsiField) {
|
||||
if (!checkCallApplicability(((PsiField)resolved).getType(), invokedExpr)) return false;
|
||||
}
|
||||
if (!checkUnknownParams(invokedExpr)) return false;
|
||||
}
|
||||
if (calls.length == 0 && !(invokedExpr instanceof GrString)) {
|
||||
registerCannotApplyError(invokedExpr, argumentTypes, invokedExpr.getText());
|
||||
|
||||
+2
-2
@@ -52,8 +52,8 @@ public class ArgumentInstruction extends InstructionImpl implements MixinTypeIns
|
||||
|
||||
PsiElement parent = element.getParent().getParent();
|
||||
LOG.assertTrue(parent instanceof GrCall, "elemText: " + element.getText() +
|
||||
"\n elemParent = " + (element.getParent() == null ? "null" : element.getParent().getClass()) +
|
||||
"\n elemPParent" + (parent == null ? "null" : parent.getClass()));
|
||||
"\nParent = " + (element.getParent() == null ? "null" : element.getParent().getClass()) +
|
||||
"\nPParent" + (parent == null ? "null" : parent.getClass()));
|
||||
|
||||
GrCall call = (GrCall)parent;
|
||||
|
||||
|
||||
+1
-1
@@ -437,7 +437,7 @@ public class ControlFlowBuilder extends GroovyRecursiveElementVisitor {
|
||||
else {
|
||||
boolean isWrite = !myAssertionsOnly && PsiUtil.isLValue(refExpr);
|
||||
addNodeAndCheckPending(new ReadWriteVariableInstruction(name, refExpr, myInstructionNumber++, isWrite ? WRITE : READ));
|
||||
if (refExpr.getParent() instanceof GrArgumentList) {
|
||||
if (refExpr.getParent() instanceof GrArgumentList && refExpr.getParent().getParent() instanceof GrCall) {
|
||||
addNodeAndCheckPending(new ArgumentInstruction(refExpr, myInstructionNumber++));
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -299,7 +299,7 @@ public class TypesUtil {
|
||||
}
|
||||
}
|
||||
|
||||
if (isClassType(rType, GroovyCommonClassNames.GROOVY_LANG_GSTRING)) {
|
||||
if (isClassType(rType, GROOVY_LANG_GSTRING)) {
|
||||
if (isAssignable(lType, GroovyPsiManager.getInstance(manager.getProject()).createTypeByFQClassName(JAVA_LANG_STRING, scope), manager, scope)) {
|
||||
return true;
|
||||
}
|
||||
@@ -584,9 +584,9 @@ public class TypesUtil {
|
||||
public static PsiClassType createListType(@NotNull PsiClass elements) {
|
||||
JavaPsiFacade facade = JavaPsiFacade.getInstance(elements.getProject());
|
||||
GlobalSearchScope resolveScope = elements.getResolveScope();
|
||||
PsiClass listClass = facade.findClass(CommonClassNames.JAVA_UTIL_LIST, resolveScope);
|
||||
PsiClass listClass = facade.findClass(JAVA_UTIL_LIST, resolveScope);
|
||||
if (listClass == null) {
|
||||
return facade.getElementFactory().createTypeByFQClassName(CommonClassNames.JAVA_UTIL_LIST, resolveScope);
|
||||
return facade.getElementFactory().createTypeByFQClassName(JAVA_UTIL_LIST, resolveScope);
|
||||
}
|
||||
return facade.getElementFactory().createType(listClass, facade.getElementFactory().createType(elements));
|
||||
}
|
||||
@@ -596,12 +596,12 @@ public class TypesUtil {
|
||||
JavaPsiFacade facade = JavaPsiFacade.getInstance(context.getProject());
|
||||
GlobalSearchScope resolveScope = context.getResolveScope();
|
||||
|
||||
PsiClass setClass = facade.findClass(CommonClassNames.JAVA_UTIL_SET, resolveScope);
|
||||
PsiClass setClass = facade.findClass(JAVA_UTIL_SET, resolveScope);
|
||||
if (setClass != null) {
|
||||
return facade.getElementFactory().createType(setClass, type);
|
||||
}
|
||||
|
||||
return facade.getElementFactory().createTypeByFQClassName(CommonClassNames.JAVA_UTIL_SET, resolveScope);
|
||||
return facade.getElementFactory().createTypeByFQClassName(JAVA_UTIL_SET, resolveScope);
|
||||
}
|
||||
|
||||
public static Map<String, PsiClass> getSuperClassesWithCache(@NotNull PsiClass aClass) {
|
||||
|
||||
+2
-19
@@ -52,6 +52,7 @@ import java.util.*;
|
||||
/**
|
||||
* @author Maxim.Medvedev
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public class GrClosureSignatureUtil {
|
||||
private GrClosureSignatureUtil() {
|
||||
}
|
||||
@@ -549,7 +550,7 @@ public class GrClosureSignatureUtil {
|
||||
|
||||
for (GrExpression expression : expressionArgs) {
|
||||
PsiType type = expression.getType();
|
||||
if (expression instanceof GrNewExpression && com.intellij.psi.util.PsiUtil.resolveClassInType(type) == null) {
|
||||
if (partial && expression instanceof GrNewExpression && com.intellij.psi.util.PsiUtil.resolveClassInType(type) == null) {
|
||||
type = null;
|
||||
}
|
||||
if (eraseArgs) {
|
||||
@@ -649,24 +650,6 @@ public class GrClosureSignatureUtil {
|
||||
return generateAllMethodSignaturesByClosureSignature(name, signature, PsiTypeParameter.EMPTY_ARRAY, PsiSubstitutor.EMPTY);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static PsiType getTypeByTypeArg(ArgInfo<PsiType> arg, PsiManager manager, GlobalSearchScope resolveScope) {
|
||||
if (arg.isMultiArg) {
|
||||
if (arg.args.size() == 0) return PsiType.getJavaLangObject(manager, resolveScope).createArrayType();
|
||||
PsiType leastUpperBound = null;
|
||||
|
||||
for (PsiType type : arg.args) {
|
||||
leastUpperBound = TypesUtil.getLeastUpperBoundNullable(leastUpperBound, type, manager);
|
||||
}
|
||||
if (leastUpperBound == null) return null;
|
||||
return leastUpperBound.createArrayType();
|
||||
}
|
||||
else {
|
||||
if (arg.args.size() > 0) return arg.args.get(0);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static PsiType getTypeByArg(ArgInfo<PsiElement> arg, PsiManager manager, GlobalSearchScope resolveScope) {
|
||||
if (arg.isMultiArg) {
|
||||
|
||||
@@ -251,7 +251,7 @@ public class PsiUtil {
|
||||
}
|
||||
else {
|
||||
if (type == null) {
|
||||
result.add(nullAsBottom ? PsiType.NULL : TypesUtil.getJavaLangObject(expression));
|
||||
result.add(nullAsBottom ? null : TypesUtil.getJavaLangObject(expression));
|
||||
}
|
||||
else {
|
||||
if (stopAt == expression) {
|
||||
|
||||
@@ -84,7 +84,7 @@ public class GroovyHighlightingTest extends LightCodeInsightFixtureTestCase {
|
||||
|
||||
private void doTest(InspectionProfileEntry... tools) {
|
||||
myFixture.enableInspections(tools);
|
||||
myFixture.testHighlighting(true, false, false, getTestName(false) + ".groovy");
|
||||
myFixture.testHighlighting(true, false, true, getTestName(false) + ".groovy");
|
||||
}
|
||||
|
||||
public void testCircularInheritance() throws Throwable {
|
||||
@@ -477,11 +477,11 @@ class A {
|
||||
doTest(new GroovyUnresolvedAccessInspection());
|
||||
}
|
||||
|
||||
public void testUnknownVarInArgList() {
|
||||
public void testImplicitEnumCoercion() {
|
||||
doTest(new GroovyAssignabilityCheckInspection());
|
||||
}
|
||||
|
||||
public void testImplicitEnumCoercion() {
|
||||
|
||||
public void testUnknownVarInArgList() {
|
||||
doTest(new GroovyAssignabilityCheckInspection());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package org.jetbrains.plugins.groovy.spock
|
||||
|
||||
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase
|
||||
import com.intellij.codeInsight.lookup.LookupElement
|
||||
import com.intellij.util.containers.CollectionFactory
|
||||
import com.intellij.psi.PsiFile
|
||||
|
||||
import com.intellij.psi.PsiVariable
|
||||
import com.intellij.psi.CommonClassNames
|
||||
import com.intellij.psi.PsiFile
|
||||
import com.intellij.psi.PsiVariable
|
||||
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase
|
||||
import com.intellij.util.containers.CollectionFactory
|
||||
import org.jetbrains.plugins.groovy.codeInspection.assignment.GroovyAssignabilityCheckInspection
|
||||
import org.jetbrains.plugins.groovy.codeInspection.untypedUnresolvedAccess.GroovyUnresolvedAccessInspection
|
||||
|
||||
@@ -203,13 +202,13 @@ class FooSpec extends spock.lang.Specification {
|
||||
public void testVariable_resolved() {
|
||||
myFixture.enableInspections(GroovyAssignabilityCheckInspection, GroovyUnresolvedAccessInspection)
|
||||
|
||||
myFixture.configureByText("FooSpec.groovy", """
|
||||
myFixture.configureByText("FooSpec.groovy", """\
|
||||
class FooSpec extends spock.lang.Specification {
|
||||
def "foo test"() {
|
||||
String subscriber = <warning>Mock</warning>()
|
||||
then: (0.._) * subscriber.concat(_)
|
||||
subscriber.concat(<warning>asdasdasd</warning>)
|
||||
subscriber.concat<warning>(23)</warning>
|
||||
String subscriber = <warning descr="Can not resolve symbol 'Mock'">Mock</warning>()
|
||||
then: (0.._) * subscriber.concat<weak_warning descr="Cannot infer argument types">(_)</weak_warning>
|
||||
subscriber.concat<weak_warning descr="Cannot infer argument types">(<warning descr="Can not resolve symbol 'asdasdasd'">asdasdasd</warning>)</weak_warning>
|
||||
subscriber.concat<warning descr="'concat' in 'java.lang.String' cannot be applied to '(java.lang.Integer)'">(23)</warning>
|
||||
}
|
||||
}
|
||||
""")
|
||||
|
||||
@@ -5,5 +5,5 @@ enum My {
|
||||
My var = 'foo'
|
||||
var = <warning descr="Cannot find enum constant 'fail' in enum 'My'">'fail'</warning>
|
||||
|
||||
var = "fo"+"o"
|
||||
var="fo${'o'}"
|
||||
var = <weak_warning descr="Cannot assign string to enum 'My'">"fo"+"o"</weak_warning>
|
||||
var=<weak_warning descr="Cannot assign string to enum 'My'">"fo${'o'}"</weak_warning>
|
||||
|
||||
@@ -4,5 +4,4 @@ foo(1, 2, '3')
|
||||
foo(1, *[2, '3'])
|
||||
foo<warning descr="'foo' in 'SpreadArguments' cannot be applied to '(java.lang.Integer, java.lang.Integer, java.lang.Integer)'">(1, *[2, 3])</warning>
|
||||
def list = new ArrayList()
|
||||
foo(1, *list)
|
||||
|
||||
foo<weak_warning descr="Cannot infer argument types">(1, *list)</weak_warning>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
def foo(Date d) {}
|
||||
|
||||
def a = unknown
|
||||
foo(a)
|
||||
foo<weak_warning descr="Cannot infer argument types">(a)</weak_warning>
|
||||
foo<warning descr="'foo' in 'UnknownVarInArgList' cannot be applied to '(java.lang.Integer)'">(1)</warning>
|
||||
|
||||
|
||||
@@ -10,4 +10,4 @@ def abc(Date d){}
|
||||
def abc(int i) {}
|
||||
|
||||
def x = unknown2
|
||||
abc<warning descr="'abc' in 'UnknownVarInArgList' cannot be applied to '(null)'">(x)</warning>
|
||||
abc<weak_warning descr="Cannot infer argument types">(x)</weak_warning>
|
||||
Reference in New Issue
Block a user