From 3d5ca26a429d791abafe901e5ad64d27beffd854 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Thu, 15 Oct 2015 13:35:58 +0300 Subject: [PATCH 01/80] EA-74528 - UOE: CommittedChangesTreeBrowser.collectChanges --- .../vcs/changes/committed/CommittedChangesTreeBrowser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesTreeBrowser.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesTreeBrowser.java index 1584e8533266..1ffe9a78ff0e 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesTreeBrowser.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesTreeBrowser.java @@ -276,7 +276,7 @@ public class CommittedChangesTreeBrowser extends JPanel implements TypeSafeDataP public static List collectChanges(final List selectedChangeLists, final boolean withMovedTrees) { Collections.sort(selectedChangeLists, CommittedChangeListByDateComparator.ASCENDING); - List changes = Collections.emptyList(); + List changes = new ArrayList(); for (CommittedChangeList cl : selectedChangeLists) { changes.addAll(withMovedTrees ? cl.getChangesWithMovedTrees() : cl.getChanges()); } From 713c642c749146eb4a9f0fe0ad60d7be2d6d8c11 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Thu, 15 Oct 2015 13:58:04 +0300 Subject: [PATCH 02/80] fix reverted per review IDEA-CR-5368 --- .../com/intellij/debugger/engine/SuspendManagerImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/SuspendManagerImpl.java b/java/debugger/impl/src/com/intellij/debugger/engine/SuspendManagerImpl.java index 2800d5a6f15f..0fe1e45cc5dc 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/SuspendManagerImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/SuspendManagerImpl.java @@ -15,7 +15,7 @@ */ package com.intellij.debugger.engine; -import com.intellij.debugger.engine.events.SuspendContextCommandImpl; +import com.intellij.debugger.engine.events.DebuggerCommandImpl; import com.intellij.debugger.jdi.ThreadReferenceProxyImpl; import com.intellij.openapi.diagnostic.Logger; import com.sun.jdi.InternalException; @@ -309,9 +309,9 @@ public class SuspendManagerImpl implements SuspendManager { if(suspendContext.myVotesToVote == 0) { if(suspendContext.myIsVotedForResume) { // resume in a separate request to allow other requests be processed (e.g. dependent bpts enable) - myDebugProcess.getManagerThread().schedule(new SuspendContextCommandImpl(suspendContext) { + myDebugProcess.getManagerThread().schedule(new DebuggerCommandImpl() { @Override - public void contextAction() throws Exception { + protected void action() throws Exception { resume(suspendContext); } From d86caf30a08ec38a3e7fd4d18343b34d838083ab Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Wed, 14 Oct 2015 20:24:58 +0200 Subject: [PATCH 03/80] move coverage-error.log under system/coverage so it would be found by user only when something really goes wrong (IDEA-146137) --- lib/coverage-agent.jar | Bin 35290 -> 35388 bytes lib/coverage-instrumenter.jar | Bin 72327 -> 72474 bytes lib/coverage-util.jar | Bin 21476 -> 21476 bytes lib/src/coverage-src.zip | Bin 60871 -> 60990 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/lib/coverage-agent.jar b/lib/coverage-agent.jar index c352e58e4a84b5a209ba68ca5570f2adedaecc2c..861e08e733a1c69fb2ef6962be1cdbfc32bf343a 100755 GIT binary patch delta 2245 zcmYk8dmxkhAIIl1Y*Jx!TgYMBOtd5;a%nXYQlUgbF_bBsn#x>eLo@7&+|GpKL~PPr zN@pdxl-rq7qMamC%F<=TIn>Fse*N0>$LssN-|x@o^E~_K^NaxUe_oJR+wHEPh=8bk zyRKdJ%vGyYSVp5Eh#`#nw>uK#r{8LzUQQD%f`jTeAJ`zbX*muY_ca49(Un&G=vaT% zQ&1t-siyGl032KO5@f%PC2%!aU2tLbC3#Sw#G3)FSSWBVyjH&Q_cBXh zL4WM0Buuc{Fctp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7Nd`*i^IHEJYZt88^Vh+8cI1Ppn!?>wZ1W|vCgSsA zOLtYr8brrF{mR#LrEzT15O3itJl=lzZmo@}wc1kAYKCQA^t3A+mE-kZe@BDDAyad@`(2g-1Z-saB)zPT1Lqa$4yha~yZ%Bh#uUQr3S zm!bX3dfj=<#TSQb?VSDRjKZLD7h|GTB1H&kEwG5h$!S`yq5@o>XL5TEO}#AGwIj?B zy52edxpFl@CuT65j9yt+QR>!*^vzvay81q{T^YKg%)F%biO{hGCeeJMo~oKPLKxa3 zJ50Nq)Fu6K z!utr4GaBpm%IQ|FdHQk3Lu_a#;YXtVY)fyD8A=TOJMu~NB|rDo`9U*T+hR;H3z2DZ zfle5~e~wo`IU9t`v)#W&{`*3A8b|obfnL6^0U6xv@Y-aq?5*lyWn)LfD0be!ynv)B z78`QSLXTCEqoyfRajVd+eZsXz8_~k)K4Ii|>4ulLdIw9lp7>FzrOfgkMPd*?FoPqM z@(+Ce-pOXP%N&$)kBdo-ryqsa6ts5upsE$z(a~qnh3T!?uU#IOq=-|)CB&b7 zn&K0?Ylnux!(N#i&uiR7!`qS+)J#?r;~Q!gu0FvRKNTIJR5M{gPaJT~Gr=ofM3*7{ zTR+}c?LJt=Sg6lk{bZ)Hs6<{Gd$A(s;wT^()w}4Dh=9QwH}A23?!c{^;eBk55IFx& zQ&a(OQmg@oDSCk7R1-i)su^H9)dsMWY7Zz+I}Q&1INAvi_t3mSY>?~;csbb@=wFk! z^G@__y@2iwbiNcKpnpmbU`t8_AT~7wFh3RaW2Je4u#+kW#ii+j@x!!}fFcZ^|K%7A zT`=u4hA-gmi@|{OizL8_i@u_p`^NwCMIe{-qv$OOk02f?UXm^G@zZzxB@?RE;mq7pk diff --git a/lib/coverage-instrumenter.jar b/lib/coverage-instrumenter.jar index 6c15e07ff11662986168f780ef9aad13b5c88402..cb8461b8a3db96597574a4c58d959423104bded3 100755 GIT binary patch delta 17333 zcmZX51z4QD5-y9oLveR^mqKwZ?(SCHWs5r$UEJN>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Gk+QY diff --git a/lib/src/coverage-src.zip b/lib/src/coverage-src.zip index 115a3247e1689ca27093c08473e11c6d444ac517..8c6424c7bd590a1fdd1df1ea18d5da6d46713a83 100755 GIT binary patch delta 8890 zcmZ8nWmr^Ew;sB?yE~;*x?5lFyE%hrT#|-@T7_ z|CsljcfV`xIp;agI(w~k`WBEn7LjmtHIR@o0e?nowRRE?9nv4*V~2w&7aZOT!J$(e z4mXN_&p5$4$teHNypt0=R)PYqK*0Q?0kN@)OhhO6GtWOna$S!A0Q4aO0DNEqKk7#bX)PhvB*GszwY%8A5#hQ8swt7OM~wt3 z0Kf&;Su&!4UDt7HY4HaT;o5z|F% zF-_& z8LTh6ul5f&U$$GI?teNEE3%0ngYXQbgGLlBz zHI+ATo5|x4G8UJUzAtD3$+b8wTt4WXXIk=?zAzlv?E4qJ`=}V-h=!FenwzI6IBzR?oZ128-7%Hwe(rI9%%>lk_h& zqP$eT+HC}?8u$FNV+@KQ`V|}JYNSW24{RMsKV`s9mV)_Ow#(s(1Zr?G7J(UuK;&Y# z6LWPWHYpHqS_mP*szNXiBiMZ+=Y6Hhhpt#<7S%Sn1J6V(K;;<=x>GoY0&WcBVq56k zSdDKcQUGF3eR;fWQJzEe8wafRu#r8RQ{K&xAJCZkr^_ME36T=3+3EW4V-#VuPlN$^ zTQAViBG>_u>QVg)x!;hjiPVqdKnyUs2#gqU@Qc=O;|w185qL?E{@GXqsV-LhwWx0o z-hA(IzLmXHZp#vS?V(*GpcV917G2^kfb4~3YGtn^(f}R1u@=^BxMHAxuvRp_g>x($ z<1XSbqV^>I&*;GBI1z?UF#G0sn18{7Det}+a)m4+u$yl^XEqckB9h!>5)>9a)Pm?F zs~vTg53o}crRm3pMk14Mu*|nwugTWR>#Jg4jHu)1f{IMeMu7;-mAA7!z@`#o+mDks zp@^h(wai%h0>i&jYojZZp!zd;8~eYEM!`4>7Oj) z5r^Wzmi3)~6q>v@!Eftg1qBAX3;5$cWpxV?$|#iG@zhX##)xN4k+S0K z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GlV*+Sr|MyV+?}8f}dm_q1 X2ReLA3ac{ Date: Thu, 15 Oct 2015 12:49:03 +0200 Subject: [PATCH 04/80] to subclass navigation: try to find 2 inheritors before reject search for functional expressions so chooser would be shown and additional expressions would be found if any --- .../codeInsight/daemon/impl/MarkerType.java | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/MarkerType.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/MarkerType.java index ed26f09a0aaf..b4c20959b41b 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/MarkerType.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/MarkerType.java @@ -57,8 +57,7 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.event.MouseEvent; import java.text.MessageFormat; -import java.util.Arrays; -import java.util.Comparator; +import java.util.*; public class MarkerType { @@ -289,7 +288,7 @@ public class MarkerType { @Override public void run() { OverridingMethodsSearch.search(method, true).forEach(new PsiElementProcessorAdapter(collectProcessor)); - if (collectProcessor.getCollection().isEmpty()) { + if (collectProcessor.getCollection().size() < 2) { final PsiClass aClass = ApplicationManager.getApplication().runReadAction(new Computable() { @Override public PsiClass compute() { @@ -306,13 +305,15 @@ public class MarkerType { } final PsiMethod[] methodOverriders = collectProcessor.toArray(PsiMethod.EMPTY_ARRAY); - NavigatablePsiElement[] overridings = ArrayUtil.mergeArrays(methodOverriders, collectExprProcessor.toArray(PsiFunctionalExpression.EMPTY_ARRAY)); - if (overridings.length == 0) return; + final List overridings = new ArrayList(); + overridings.addAll(collectProcessor.getCollection()); + overridings.addAll(collectExprProcessor.getCollection()); + if (overridings.isEmpty()) return; boolean showMethodNames = !PsiUtil.allMethodsHaveSameSignature(methodOverriders); MethodOrFunctionalExpressionCellRenderer renderer = new MethodOrFunctionalExpressionCellRenderer(showMethodNames); - Arrays.sort(overridings, renderer.getComparator()); + Collections.sort(overridings, renderer.getComparator()); final OverridingMethodsUpdater methodsUpdater = new OverridingMethodsUpdater(method, renderer); - PsiElementListNavigator.openTargets(e, overridings, methodsUpdater.getCaption(overridings.length), "Overriding methods of " + method.getName(), renderer, methodsUpdater); + PsiElementListNavigator.openTargets(e, overridings.toArray(new NavigatablePsiElement[overridings.size()]), methodsUpdater.getCaption(overridings.size()), "Overriding methods of " + method.getName(), renderer, methodsUpdater); } private static final String SEARCHING_FOR_OVERRIDDEN_METHODS = "Searching for Overridden Methods"; @@ -380,7 +381,7 @@ public class MarkerType { @Override public void run() { ClassInheritorsSearch.search(aClass, true).forEach(new PsiElementProcessorAdapter(collectProcessor)); - if (collectProcessor.getCollection().isEmpty()) { + if (collectProcessor.getCollection().size() < 2) { FunctionalExpressionSearch.search(aClass).forEach(new PsiElementProcessorAdapter(collectExprProcessor)); } } @@ -388,13 +389,14 @@ public class MarkerType { return; } - NavigatablePsiElement[] inheritors = ArrayUtil.mergeArrays(collectProcessor.toArray(PsiClass.EMPTY_ARRAY), - collectExprProcessor.toArray(PsiFunctionalExpression.EMPTY_ARRAY)); - if (inheritors.length == 0) return; + final List inheritors = new ArrayList(); + inheritors.addAll(collectProcessor.getCollection()); + inheritors.addAll(collectExprProcessor.getCollection()); + if (inheritors.isEmpty()) return; final PsiClassOrFunctionalExpressionListCellRenderer renderer = new PsiClassOrFunctionalExpressionListCellRenderer(); final SubclassUpdater subclassUpdater = new SubclassUpdater(aClass, renderer); - Arrays.sort(inheritors, renderer.getComparator()); - PsiElementListNavigator.openTargets(e, inheritors, subclassUpdater.getCaption(inheritors.length), CodeInsightBundle.message("goto.implementation.findUsages.title", aClass.getName()), renderer, subclassUpdater); + Collections.sort(inheritors, renderer.getComparator()); + PsiElementListNavigator.openTargets(e, inheritors.toArray(new NavigatablePsiElement[inheritors.size()]), subclassUpdater.getCaption(inheritors.size()), CodeInsightBundle.message("goto.implementation.findUsages.title", aClass.getName()), renderer, subclassUpdater); } private static class SubclassUpdater extends ListBackgroundUpdaterTask { From 9d165d56f61c7734993d853c75d57d1ef831717c Mon Sep 17 00:00:00 2001 From: nik Date: Thu, 15 Oct 2015 13:03:00 +0200 Subject: [PATCH 05/80] use correct Maven coordinates for annotations jar in 'Add annotations to classpath' quickfix (IDEA-146273) --- .../JetBrainsAnnotationsExternalLibraryResolver.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/JetBrainsAnnotationsExternalLibraryResolver.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/JetBrainsAnnotationsExternalLibraryResolver.java index 5ffede07efd7..f893306df1d8 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/JetBrainsAnnotationsExternalLibraryResolver.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/JetBrainsAnnotationsExternalLibraryResolver.java @@ -37,7 +37,7 @@ import java.util.List; * @author nik */ public class JetBrainsAnnotationsExternalLibraryResolver extends ExternalLibraryResolver { - private static final ExternalLibraryDescriptor JAVA5 = new JetBrainsAnnotationsLibraryDescriptor() { + private static final ExternalLibraryDescriptor JAVA5 = new JetBrainsAnnotationsLibraryDescriptor("annotations-java5") { @NotNull @Override public List getLibraryClassesRoots() { @@ -49,7 +49,7 @@ public class JetBrainsAnnotationsExternalLibraryResolver extends ExternalLibrary } }; - private static final ExternalLibraryDescriptor JAVA8 = new JetBrainsAnnotationsLibraryDescriptor() { + private static final ExternalLibraryDescriptor JAVA8 = new JetBrainsAnnotationsLibraryDescriptor("annotations") { @NotNull @Override public List getLibraryClassesRoots() { @@ -86,8 +86,8 @@ public class JetBrainsAnnotationsExternalLibraryResolver extends ExternalLibrary } private static abstract class JetBrainsAnnotationsLibraryDescriptor extends ExternalLibraryDescriptor { - public JetBrainsAnnotationsLibraryDescriptor() { - super("com.intellij", "annotations"); + public JetBrainsAnnotationsLibraryDescriptor(final String artifactId) { + super("org.jetbrains", artifactId); } } } From fb1695c2a58a9a4c3b63d7f9cc216d4d14875b69 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Thu, 15 Oct 2015 14:29:30 +0300 Subject: [PATCH 06/80] fixes after review IDEA-CR-5242 --- .../com/intellij/find/actions/CompositeActiveComponent.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/find/actions/CompositeActiveComponent.java b/platform/lang-impl/src/com/intellij/find/actions/CompositeActiveComponent.java index 9c6a27946b94..182efc382e44 100644 --- a/platform/lang-impl/src/com/intellij/find/actions/CompositeActiveComponent.java +++ b/platform/lang-impl/src/com/intellij/find/actions/CompositeActiveComponent.java @@ -16,6 +16,7 @@ package com.intellij.find.actions; import com.intellij.ui.ActiveComponent; +import com.intellij.util.ui.JBUI; import org.jetbrains.annotations.NotNull; import javax.swing.*; @@ -28,7 +29,7 @@ class CompositeActiveComponent implements ActiveComponent { public CompositeActiveComponent(@NotNull ActiveComponent... components) { myComponents = components; - myComponent = new JPanel(new FlowLayout(FlowLayout.CENTER, 2, 4)); + myComponent = new JPanel(new FlowLayout(FlowLayout.CENTER, JBUI.scale(2), JBUI.scale(4))); myComponent.setBorder(null); myComponent.setOpaque(false); for (ActiveComponent component : components) { From 07c191b63c26a5f394dedcefb45a052838011355 Mon Sep 17 00:00:00 2001 From: Dmitry Batkovich Date: Thu, 15 Oct 2015 14:49:22 +0300 Subject: [PATCH 07/80] resource bundle editor: ignore locales intention. post-review change (IDEA-CR-5668) --- .../codeInspection/ProblemDescriptorUtil.java | 17 ++- .../intention/impl/IntentionListStep.java | 122 ++++++++++-------- .../ResourceBundleEditorInspectionPass.java | 4 +- ...ResourceBundleEditorProblemDescriptor.java | 61 +-------- plugins/properties/src/META-INF/plugin.xml | 4 +- 5 files changed, 87 insertions(+), 121 deletions(-) diff --git a/platform/analysis-impl/src/com/intellij/codeInspection/ProblemDescriptorUtil.java b/platform/analysis-impl/src/com/intellij/codeInspection/ProblemDescriptorUtil.java index 93f40c41a3d9..47eb271344ea 100644 --- a/platform/analysis-impl/src/com/intellij/codeInspection/ProblemDescriptorUtil.java +++ b/platform/analysis-impl/src/com/intellij/codeInspection/ProblemDescriptorUtil.java @@ -140,6 +140,19 @@ public class ProblemDescriptorUtil { @NotNull HighlightSeverity severity, @NotNull SeverityRegistrar severityRegistrar) { final ProblemHighlightType highlightType = problemDescriptor.getHighlightType(); + final HighlightInfoType highlightInfoType = getHighlightInfoType(highlightType, severity, severityRegistrar); + if (highlightInfoType == HighlightSeverity.INFORMATION) { + final TextAttributesKey attributes = ((ProblemDescriptorBase)problemDescriptor).getEnforcedTextAttributes(); + if (attributes != null) { + return new HighlightInfoType.HighlightInfoTypeImpl(HighlightSeverity.INFORMATION, attributes); + } + } + return highlightInfoType; + } + + public static HighlightInfoType getHighlightInfoType(@NotNull ProblemHighlightType highlightType, + @NotNull HighlightSeverity severity, + @NotNull SeverityRegistrar severityRegistrar) { switch (highlightType) { case GENERIC_ERROR_OR_WARNING: return severityRegistrar.getHighlightInfoTypeBySeverity(severity); @@ -164,10 +177,6 @@ public class ProblemDescriptorUtil { case GENERIC_ERROR: return HighlightInfoType.ERROR; case INFORMATION: - final TextAttributesKey attributes = ((ProblemDescriptorBase)problemDescriptor).getEnforcedTextAttributes(); - if (attributes != null) { - return new HighlightInfoType.HighlightInfoTypeImpl(HighlightSeverity.INFORMATION, attributes); - } return HighlightInfoType.INFORMATION; } throw new RuntimeException("Cannot map " + highlightType); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/IntentionListStep.java b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/IntentionListStep.java index 85bf449092e2..8c9e48ace441 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/IntentionListStep.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/IntentionListStep.java @@ -114,65 +114,74 @@ public class IntentionListStep implements ListPopupStep newDescriptors, @NotNull Set cachedActions, boolean callUpdate) { - final int caretOffset = myEditor == null ? 0 : myEditor.getCaretModel().getOffset(); - final int fileOffset = caretOffset > 0 && caretOffset == myFile.getTextLength() ? caretOffset - 1 : caretOffset; - PsiElement element; - final PsiElement hostElement; - if (myFile instanceof PsiCompiledElement) { - hostElement = element = myFile; - - } - else if (myEditor != null && PsiDocumentManager.getInstance(myProject).isUncommited(myEditor.getDocument())) { - //??? - FileViewProvider viewProvider = myFile.getViewProvider(); - hostElement = element = viewProvider.findElementAt(fileOffset, viewProvider.getBaseLanguage()); - } - else { - hostElement = myFile.getViewProvider().findElementAt(fileOffset, myFile.getLanguage()); - element = InjectedLanguageUtil.findElementAtNoCommit(myFile, fileOffset); - } - PsiFile injectedFile; - Editor injectedEditor; - if (element == null || element == hostElement) { - injectedFile = myFile; - injectedEditor = myEditor; - } - else { - injectedFile = element.getContainingFile(); - injectedEditor = myEditor == null ? null : InjectedLanguageUtil.getInjectedEditorForInjectedFile(myEditor, injectedFile); - } - boolean changed = false; - for (Iterator iterator = cachedActions.iterator(); iterator.hasNext();) { - IntentionActionWithTextCaching cachedAction = iterator.next(); - IntentionAction action = cachedAction.getAction(); - if (myEditor != null && !ShowIntentionActionsHandler.availableFor(myFile, myEditor, action) - && (hostElement == element || element != null && !ShowIntentionActionsHandler.availableFor(injectedFile, injectedEditor, action))) { - iterator.remove(); - changed = true; + if (myEditor == null) { + LOG.assertTrue(!callUpdate); + for (HighlightInfo.IntentionActionDescriptor descriptor : newDescriptors) { + changed |= cachedActions.add(wrapAction(descriptor, null, myFile, null)); + } + } else { + final int caretOffset = myEditor.getCaretModel().getOffset(); + final int fileOffset = caretOffset > 0 && caretOffset == myFile.getTextLength() ? caretOffset - 1 : caretOffset; + PsiElement element; + final PsiElement hostElement; + if (myFile instanceof PsiCompiledElement) { + hostElement = element = myFile; + } + else if (PsiDocumentManager.getInstance(myProject).isUncommited(myEditor.getDocument())) { + //??? + FileViewProvider viewProvider = myFile.getViewProvider(); + hostElement = element = viewProvider.findElementAt(fileOffset, viewProvider.getBaseLanguage()); + } + else { + hostElement = myFile.getViewProvider().findElementAt(fileOffset, myFile.getLanguage()); + element = InjectedLanguageUtil.findElementAtNoCommit(myFile, fileOffset); + } + PsiFile injectedFile; + Editor injectedEditor; + if (element == null || element == hostElement) { + injectedFile = myFile; + injectedEditor = myEditor; + } + else { + injectedFile = element.getContainingFile(); + injectedEditor = InjectedLanguageUtil.getInjectedEditorForInjectedFile(myEditor, injectedFile); } - } - Set wrappedNew = new THashSet(newDescriptors.size(), ACTION_TEXT_AND_CLASS_EQUALS); - for (HighlightInfo.IntentionActionDescriptor descriptor : newDescriptors) { - final IntentionAction action = descriptor.getAction(); - if (element != null && element != hostElement && (!callUpdate || myEditor == null || ShowIntentionActionsHandler.availableFor(injectedFile, injectedEditor, action))) { - IntentionActionWithTextCaching cachedAction = wrapAction(descriptor, element, injectedFile, injectedEditor); - wrappedNew.add(cachedAction); - changed |= cachedActions.add(cachedAction); + for (Iterator iterator = cachedActions.iterator(); iterator.hasNext(); ) { + IntentionActionWithTextCaching cachedAction = iterator.next(); + IntentionAction action = cachedAction.getAction(); + if (!ShowIntentionActionsHandler.availableFor(myFile, myEditor, action) && + (hostElement == element || element != null && !ShowIntentionActionsHandler.availableFor(injectedFile, injectedEditor, action))) { + iterator.remove(); + changed = true; + } } - else if (hostElement != null && (!callUpdate || myEditor == null || ShowIntentionActionsHandler.availableFor(myFile, myEditor, action))) { - IntentionActionWithTextCaching cachedAction = wrapAction(descriptor, hostElement, myFile, myEditor); - wrappedNew.add(cachedAction); - changed |= cachedActions.add(cachedAction); + + Set wrappedNew = + new THashSet(newDescriptors.size(), ACTION_TEXT_AND_CLASS_EQUALS); + for (HighlightInfo.IntentionActionDescriptor descriptor : newDescriptors) { + final IntentionAction action = descriptor.getAction(); + if (element != null && + element != hostElement && + (!callUpdate || ShowIntentionActionsHandler.availableFor(injectedFile, injectedEditor, action))) { + IntentionActionWithTextCaching cachedAction = wrapAction(descriptor, element, injectedFile, injectedEditor); + wrappedNew.add(cachedAction); + changed |= cachedActions.add(cachedAction); + } + else if (hostElement != null && (!callUpdate || ShowIntentionActionsHandler.availableFor(myFile, myEditor, action))) { + IntentionActionWithTextCaching cachedAction = wrapAction(descriptor, hostElement, myFile, myEditor); + wrappedNew.add(cachedAction); + changed |= cachedActions.add(cachedAction); + } } - } - for (Iterator iterator = cachedActions.iterator(); iterator.hasNext();) { - IntentionActionWithTextCaching cachedAction = iterator.next(); - if (!wrappedNew.contains(cachedAction)) { - // action disappeared - iterator.remove(); - changed = true; + for (Iterator iterator = cachedActions.iterator(); iterator.hasNext(); ) { + IntentionActionWithTextCaching cachedAction = iterator.next(); + if (!wrappedNew.contains(cachedAction)) { + // action disappeared + iterator.remove(); + changed = true; + } } } return changed; @@ -180,10 +189,11 @@ public class IntentionListStep implements ListPopupStep options = descriptor.getOptions(element, containingEditor); if (options == null) return cachedAction; for (IntentionAction option : options) { diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/inspections/ResourceBundleEditorInspectionPass.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/inspections/ResourceBundleEditorInspectionPass.java index d3590824363e..88e6a90a8bfe 100644 --- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/inspections/ResourceBundleEditorInspectionPass.java +++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/inspections/ResourceBundleEditorInspectionPass.java @@ -92,7 +92,9 @@ public class ResourceBundleEditorInspectionPass { } HighlightSeverity severity = profileToUse.getInspectionProfile().getErrorLevel(toolKey, containingFile).getSeverity(); final HighlightInfoType infoType = - ProblemDescriptorUtil.highlightTypeFromDescriptor(descriptor, severity, SeverityRegistrar.getSeverityRegistrar(project)); + ProblemDescriptorUtil.getHighlightInfoType(descriptor.getHighlightType(), + severity, + SeverityRegistrar.getSeverityRegistrar(project)); highlightTypes.add(infoType); } } diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/inspections/ResourceBundleEditorProblemDescriptor.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/inspections/ResourceBundleEditorProblemDescriptor.java index c17bcb3c794f..ee9d286494d0 100644 --- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/inspections/ResourceBundleEditorProblemDescriptor.java +++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/inspections/ResourceBundleEditorProblemDescriptor.java @@ -15,25 +15,21 @@ */ package com.intellij.lang.properties.editor.inspections; -import com.intellij.codeInspection.ProblemDescriptor; +import com.intellij.codeInspection.CommonProblemDescriptor; import com.intellij.codeInspection.ProblemHighlightType; import com.intellij.codeInspection.QuickFix; -import com.intellij.lang.annotation.ProblemGroup; -import com.intellij.openapi.editor.colors.TextAttributesKey; -import com.intellij.openapi.util.TextRange; -import com.intellij.psi.PsiElement; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** * @author Dmitry Batkovich */ -public class ResourceBundleEditorProblemDescriptor implements ProblemDescriptor { +public class ResourceBundleEditorProblemDescriptor implements CommonProblemDescriptor { private final ProblemHighlightType myHighlightType; private final String myDescriptionTemplate; private final QuickFix[] myFixes; - public ResourceBundleEditorProblemDescriptor(final ProblemHighlightType type, String template, QuickFix... fixes) { + public ResourceBundleEditorProblemDescriptor(final ProblemHighlightType type, String template, QuickFix... fixes) { myHighlightType = type; myDescriptionTemplate = template; myFixes = fixes; @@ -55,55 +51,4 @@ public class ResourceBundleEditorProblemDescriptor implements ProblemDescriptor public QuickFix[] getFixes() { return myFixes; } - - @Override - public PsiElement getPsiElement() { - throw new UnsupportedOperationException(); - } - - @Override - public PsiElement getStartElement() { - throw new UnsupportedOperationException(); - } - - @Override - public PsiElement getEndElement() { - throw new UnsupportedOperationException(); - } - - @Override - public TextRange getTextRangeInElement() { - throw new UnsupportedOperationException(); - } - - @Override - public int getLineNumber() { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isAfterEndOfLine() { - throw new UnsupportedOperationException(); - } - - @Override - public void setTextAttributes(TextAttributesKey key) { - throw new UnsupportedOperationException(); - } - - @Nullable - @Override - public ProblemGroup getProblemGroup() { - throw new UnsupportedOperationException(); - } - - @Override - public void setProblemGroup(@Nullable ProblemGroup problemGroup) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean showTooltip() { - throw new UnsupportedOperationException(); - } } diff --git a/plugins/properties/src/META-INF/plugin.xml b/plugins/properties/src/META-INF/plugin.xml index 3f5d08df9093..de90a2dc8af9 100644 --- a/plugins/properties/src/META-INF/plugin.xml +++ b/plugins/properties/src/META-INF/plugin.xml @@ -86,9 +86,9 @@ key="wrong.property.key.value.delimiter.inspection.display.name" groupKey="properties.files.inspection.group.display.name" enabledByDefault="true" level="WEAK WARNING" cleanupTool="true" implementationClass="com.intellij.codeInspection.WrongPropertyKeyValueDelimiterInspection"/> - From 571b423273279d2a53f70ff7976297d428ef83cd Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Thu, 15 Oct 2015 14:48:29 +0300 Subject: [PATCH 08/80] IDEA-51897 show number of selected lines in status bar update following CR-IC-7414 --- .../com/intellij/openapi/wm/impl/status/PositionPanel.java | 7 ++++--- .../platform-resources-en/src/messages/UIBundle.properties | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PositionPanel.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PositionPanel.java index dcdd5e9912cf..7eb2ff2fc307 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PositionPanel.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PositionPanel.java @@ -145,18 +145,19 @@ public class PositionPanel extends EditorBasedWidget implements StatusBarWidget. SelectionModel selectionModel = editor.getSelectionModel(); int caretCount = editor.getCaretModel().getCaretCount(); if (caretCount > 1) { - message.append(caretCount).append(" carets"); + message.append(UIBundle.message("position.panel.caret.count", caretCount)); } else { if (selectionModel.hasSelection()) { int selectionStart = selectionModel.getSelectionStart(); int selectionEnd = selectionModel.getSelectionEnd(); if (selectionEnd > selectionStart) { - message.append(selectionEnd - selectionStart).append(" chars"); + message.append(UIBundle.message("position.panel.selected.chars.count", selectionEnd - selectionStart)); int selectionStartLine = editor.getDocument().getLineNumber(selectionStart); int selectionEndLine = editor.getDocument().getLineNumber(selectionEnd); if (selectionEndLine > selectionStartLine) { - message.append(", ").append(selectionEndLine - selectionStartLine + 1).append(" lines"); + message.append(", "); + message.append(UIBundle.message("position.panel.selected.lines.count", selectionEndLine - selectionStartLine + 1)); } message.append(" "); } diff --git a/platform/platform-resources-en/src/messages/UIBundle.properties b/platform/platform-resources-en/src/messages/UIBundle.properties index 3a2d87ed1a48..6f58d5a60cd3 100644 --- a/platform/platform-resources-en/src/messages/UIBundle.properties +++ b/platform/platform-resources-en/src/messages/UIBundle.properties @@ -72,6 +72,9 @@ memory.usage.panel.statistics.message=Allocated heap size: {0}M Used: {1}M memory.usage.panel.message.text={0,number,####} of {1,number,####}M go.to.line.command.name=Go to Line go.to.line.command.double.click=Click to go to line +position.panel.caret.count={0} carets +position.panel.selected.chars.count={0} chars +position.panel.selected.lines.count={0} lines popup.hints.panel.click.to.configure.highlighting.tooltip.text=Click to configure highlighting for this file popup.hints.panel.click.to.configure.profile.text=Click to configure inspection profiles read.only.attr.panel.double.click.to.toggle.attr.tooltip.text=Click to toggle the read-only attribute From 6972eb32e81fda6710a987cf9eb2a025e1a10dfc Mon Sep 17 00:00:00 2001 From: Sergey Ignatov Date: Thu, 15 Oct 2015 15:05:02 +0300 Subject: [PATCH 09/80] check for nullable list --- .../src/com/intellij/ide/dnd/FileCopyPasteUtil.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/dnd/FileCopyPasteUtil.java b/platform/platform-impl/src/com/intellij/ide/dnd/FileCopyPasteUtil.java index 4faddff03bab..9edf2bb7a945 100644 --- a/platform/platform-impl/src/com/intellij/ide/dnd/FileCopyPasteUtil.java +++ b/platform/platform-impl/src/com/intellij/ide/dnd/FileCopyPasteUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 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. @@ -100,8 +100,8 @@ public class FileCopyPasteUtil { try { if (transferable.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { @SuppressWarnings({"unchecked"}) - final List fileList = (List)transferable.getTransferData(DataFlavor.javaFileListFlavor); - return ContainerUtil.filter(fileList, new Condition() { + List fileList = (List)transferable.getTransferData(DataFlavor.javaFileListFlavor); + return fileList == null ? null : ContainerUtil.filter(fileList, new Condition() { @Override public boolean value(File file) { return !StringUtil.isEmptyOrSpaces(file.getPath()); From 7eff432b04b6ddb8a98a4609a279300566f9b0ba Mon Sep 17 00:00:00 2001 From: Dennis Ushakov Date: Thu, 15 Oct 2015 15:15:19 +0300 Subject: [PATCH 10/80] quick fix for WEB-18567: documentation for picture element --- .../com/intellij/xml/util/documentation/html5table.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xml/xml-psi-impl/src/com/intellij/xml/util/documentation/html5table.xml b/xml/xml-psi-impl/src/com/intellij/xml/util/documentation/html5table.xml index bd7e43da1077..087303858fe3 100644 --- a/xml/xml-psi-impl/src/com/intellij/xml/util/documentation/html5table.xml +++ b/xml/xml-psi-impl/src/com/intellij/xml/util/documentation/html5table.xml @@ -167,6 +167,14 @@ empty = "false" dtd = "" /> + Date: Thu, 15 Oct 2015 15:22:49 +0300 Subject: [PATCH 11/80] PY-17207 Rename appcfg.py to App Config at the bottom panel --- .../console/CommandLineConsoleApi.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/python/src/com/jetbrains/commandInterface/console/CommandLineConsoleApi.java b/python/src/com/jetbrains/commandInterface/console/CommandLineConsoleApi.java index 1d7b5a2f15a5..2591a4b90f08 100644 --- a/python/src/com/jetbrains/commandInterface/console/CommandLineConsoleApi.java +++ b/python/src/com/jetbrains/commandInterface/console/CommandLineConsoleApi.java @@ -57,8 +57,18 @@ public final class CommandLineConsoleApi { @NotNull final Module module, @NotNull final String consoleName, @Nullable final Pair, CommandExecutor> commandsAndDefaultExecutor) { + return createConsole(module, consoleName, consoleName, commandsAndDefaultExecutor); + } + + + @NotNull + public static LanguageConsoleView createConsole( + @NotNull final Module module, + @NotNull final String consoleName, + @NotNull final String promptName, + @Nullable final Pair, CommandExecutor> commandsAndDefaultExecutor) { final Project project = module.getProject(); - final CommandConsole console = CommandConsole.createConsole(module, consoleName, commandsAndDefaultExecutor); + final CommandConsole console = CommandConsole.createConsole(module, promptName, commandsAndDefaultExecutor); // Show console on "toolwindow" WindowWithActions.showConsoleWithProcess(console, From 80fc2b72089a6f6296396cae58b415429c65d0f7 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 15 Oct 2015 15:31:29 +0300 Subject: [PATCH 12/80] getContainingFile() can be null in DBE --- platform/core-api/src/com/intellij/psi/impl/ElementBase.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/platform/core-api/src/com/intellij/psi/impl/ElementBase.java b/platform/core-api/src/com/intellij/psi/impl/ElementBase.java index fb982fbadcbf..b2f5a7284eb4 100644 --- a/platform/core-api/src/com/intellij/psi/impl/ElementBase.java +++ b/platform/core-api/src/com/intellij/psi/impl/ElementBase.java @@ -104,15 +104,14 @@ public abstract class ElementBase extends UserDataHolderBase implements Iconable @Nullable private Icon computeIcon(@Iconable.IconFlags int flags) { PsiElement psiElement = (PsiElement)this; - PsiFile psiFile = psiElement.getContainingFile(); - if (psiFile == null || !psiFile.isValid()) return null; + if (!psiElement.isValid()) return null; if (Registry.is("psi.deferIconLoading")) { Icon baseIcon = LastComputedIcon.get(psiElement, flags); if (baseIcon == null) { baseIcon = computeBaseIcon(flags); } - return IconDeferrer.getInstance().defer(baseIcon, new ElementIconRequest(psiElement, psiFile.getProject(), flags), ICON_COMPUTE); + return IconDeferrer.getInstance().defer(baseIcon, new ElementIconRequest(psiElement, psiElement.getProject(), flags), ICON_COMPUTE); } return computeIconNow(psiElement, flags); From f486135dbdf4ff4747f15afbc4fd0f817ece25a4 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Thu, 15 Oct 2015 14:47:57 +0200 Subject: [PATCH 13/80] revert change in test discovery lead to inconsistent modifiers --- lib/coverage-agent.jar | Bin 35388 -> 35388 bytes lib/coverage-instrumenter.jar | Bin 72474 -> 72474 bytes lib/coverage-util.jar | Bin 21476 -> 21476 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/lib/coverage-agent.jar b/lib/coverage-agent.jar index 861e08e733a1c69fb2ef6962be1cdbfc32bf343a..bae7d09083a43eae4d1f945334fc26d793800231 100755 GIT binary patch delta 645 zcmdlpg=xl3>P#z*%55Kv!FW1y+VJL6oeE%wh$Jfc^8KoprKTJj60XF|ElT+NC$o ziC2M`dN{EaVxf1kCpTCNL<#F;g-)@_ck;G?#rSnV+E_Oq%I9GN+jOyXHYZpnzg`VY z&!~3>)A#E2!L&ew1(^13um;ne4K85%LW3ummT8Ot)8&oPVESrf6qq(@3J23YP4Qs* zT@ys!rx_x?tQn$?xg`cHpVX2HrcbrxfN9ItbTGZR6|8PjTO^o!p+S0bd7B=Xy`n7v sOmnx#!R6Z9A#yv~A=XNDq=Ds{J7U4~;|_?pYbV6oC7lrG{Ohy>06xSBmjD0& delta 645 zcmdlpg=xI7z~qgL!eC8YU{Rp_ zWCKPMkn+j7VOo<9XtE+1xp9Nv=EaQ1c$tBW$vON_!Sp$E{msn+8=1hIi=|*alM}>P zHfISR0Sj(66r08l)uKOHyIE*5x7>Lo)ts9J8%?Y+3 zzg`VY&!~3>)A#E2!L&ew1(^13um;ne4K85%LW3vRM4842FkRjl4W_R)MuBOgrf@Lb z(-aS;-!(zxeVQTS%bFqTm|J4N@<}bJVER-`4w$xVO$XD9TfyokwM9a$m7ZMQrU#Z< v(Ut(Fx!dF5a_#L9xgG5gYo$8Uz-pR1V!`y|4v4sGC&bz%o#9};|2pjePo)D@ diff --git a/lib/coverage-instrumenter.jar b/lib/coverage-instrumenter.jar index cb8461b8a3db96597574a4c58d959423104bded3..b6226f70fa01eb295e412cfaa3795083c56a2f7b 100755 GIT binary patch delta 3058 zcmY+Gc{r4N8^=AiF?M6b$dasC3)v~MjWr}xICc@qE;N;~F9%a-WM4|Qcq}otV=c0$ zI6~HrtWjC=>dkMQ_qyKsWA4xOy??*^{?2nf*EL^a9W}9zn(4A36*WD@(PtZPn!+SV zbyVcUK(UhmB|#pP4(+1?(?i`0%SWb%KMbIV@_V2sXeDrXl22vlZe5AFLQGV-ZXi z)ZrsRlpu4H7KW^1!B{xa(To;Mn|05m27vPlBag*-U4k`zG|6Kl{Zh!zF!*i=7{cI< zVCkqpV4Oe?sStRg*x;?iee$@CM{>X=LAXE*99M^x;QWHW$W|Oo#o^>?Qee%vRWtJL<3v?myRgtT^tuO~|A@xRr*FN*?NVoO)X=i66g;a(W}3Q5z-} zFT@(4%4or*LNau9MHZHq+n0~+o3&=TkJVkf@B+nT$o{TpCX5faCA0PQscK)fP`m?^ zOqI!b5wDNq3BkH)6AJCMYWAnid?)a6xtB@AzTEYcbd{e=-!ne_dp4d0441>lrM3-)e8~JHN^L2-`hBJ(F z0YA2+`1S%RW{`R8GcH|VUp*w8T0&lKn%QItcw z2~$j``UuTGPs+ot`|fs962l;mAeP|oJ= zbrnGnOx@&`p9mn$uW9*JC)e|y-!Lk1HM^Z_y(e6=a5XZ#%WY8qFQTdBmw~b(?hw_# zn%h_NE0nFiPvAX1qsI2#gybKqCzL4LYB@Wb*j_Ac4J+dk|i>N1|+O4Mg(Da{zg`V9m) zkTl#YmZU1xkTgZ#eWkRc>HLSQUq_Tal|*kRah>S=*61=kd^RtmB z-xe;%Ifj4GS5TJ4WxUbf%sIam&{ZS0h?}?5Vj_#Lq>|O8AfQfX?vhMypyno*jPuAF($>g9 zy&blX;hauAAv#~T2bSw}cfWBM+xy0_&u%ZI2@8D*Di+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oct 2015 15:02:50 +0200 Subject: [PATCH 14/80] UnsupportedOperationException --- .../intellij/codeInsight/ExceptionUtil.java | 4 ++-- .../ExceptionCollectionWithLambda.java | 24 +++++++++++++++++++ .../lambda/GenericsHighlighting8Test.java | 4 ++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/ExceptionCollectionWithLambda.java diff --git a/java/java-psi-impl/src/com/intellij/codeInsight/ExceptionUtil.java b/java/java-psi-impl/src/com/intellij/codeInsight/ExceptionUtil.java index 92fe13866aac..ec6c6d740217 100644 --- a/java/java-psi-impl/src/com/intellij/codeInsight/ExceptionUtil.java +++ b/java/java-psi-impl/src/com/intellij/codeInsight/ExceptionUtil.java @@ -268,10 +268,10 @@ public class ExceptionUtil { else if (element instanceof PsiMethodReferenceExpression) { PsiExpression qualifierExpression = ((PsiMethodReferenceExpression)element).getQualifierExpression(); return qualifierExpression != null ? collectUnhandledExceptions(qualifierExpression, topElement, null, false) - : Collections.emptySet(); + : null; } else if (element instanceof PsiLambdaExpression) { - return Collections.emptySet(); + return null; } else if (element instanceof PsiThrowStatement) { PsiThrowStatement statement = (PsiThrowStatement)element; diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/ExceptionCollectionWithLambda.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/ExceptionCollectionWithLambda.java new file mode 100644 index 000000000000..1ffb96765917 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/ExceptionCollectionWithLambda.java @@ -0,0 +1,24 @@ + + + +import java.io.File; +import java.io.IOException; +interface I { + void m(String s) throws IOException; +} +class Test { + public void test() throws IOException { + File file = new File("temp"); + try { + for(int t = 0; t < 4; ++t) { + for (int i = 0; i < 10; ++i) { + I appender = out -> File.createTempFile("", "").exists(); + appender.m(""); + } + } + } + finally { + System.out.println(file); + } + } +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GenericsHighlighting8Test.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GenericsHighlighting8Test.java index cb844b1b9142..9f10ace0ccce 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GenericsHighlighting8Test.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GenericsHighlighting8Test.java @@ -869,4 +869,8 @@ public class GenericsHighlighting8Test extends LightDaemonAnalyzerTestCase { public void testIDEA107713() throws Exception { doTest(); } + + public void testExceptionCollectionWithLambda() throws Exception { + doTest(); + } } From 0c83c2db6ecf53e35465bc7e64a2b042395c883d Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Thu, 15 Oct 2015 14:13:08 +0200 Subject: [PATCH 15/80] Added Commander / SourceSafe to the list of checked plugins --- platform/platform-resources/src/checkedPlugins.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/platform-resources/src/checkedPlugins.txt b/platform/platform-resources/src/checkedPlugins.txt index 7d80cf054556..1ee842c235d7 100644 --- a/platform/platform-resources/src/checkedPlugins.txt +++ b/platform/platform-resources/src/checkedPlugins.txt @@ -20,4 +20,7 @@ com.jetbrains.plugins.meteor AWSCloudFormation Dart IdeaVIM -IDETalk \ No newline at end of file +IDETalk +Commander +SourceSafe +TFS \ No newline at end of file From a7188b81c143ab2c72e05aedd3743c2ae10c36b5 Mon Sep 17 00:00:00 2001 From: Dmitry Batkovich Date: Thu, 15 Oct 2015 16:08:27 +0300 Subject: [PATCH 16/80] resource bundle editor: IncompleteProperty inspection: provide possibility to change configuration without explicit Settings invocation (IDEA-146371) --- .../codeInsight/daemon/impl/HighlightInfo.java | 14 +++++++------- .../intention/impl/IntentionListStep.java | 6 ++++-- .../impl/ShowIntentionActionsHandler.java | 7 +++---- ...sourceBundlePropertyStructureViewElement.java | 4 +++- .../ResourceBundleEditorInspectionPass.java | 16 +++++++++------- ...ResourceBundleEditorShowQuickFixesAction.java | 15 ++++++++++++--- 6 files changed, 38 insertions(+), 24 deletions(-) diff --git a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/HighlightInfo.java b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/HighlightInfo.java index 0320130f78e6..fb76b4b6b16a 100644 --- a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/HighlightInfo.java +++ b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/HighlightInfo.java @@ -741,13 +741,13 @@ public class HighlightInfo implements Segment { this(action, options, displayName, icon, null, null, null); } - private IntentionActionDescriptor(@NotNull IntentionAction action, - @Nullable final List options, - @Nullable final String displayName, - @Nullable Icon icon, - @Nullable HighlightDisplayKey key, - @Nullable ProblemGroup problemGroup, - @Nullable HighlightSeverity severity) { + public IntentionActionDescriptor(@NotNull IntentionAction action, + @Nullable final List options, + @Nullable final String displayName, + @Nullable Icon icon, + @Nullable HighlightDisplayKey key, + @Nullable ProblemGroup problemGroup, + @Nullable HighlightSeverity severity) { myAction = action; myOptions = options; myDisplayName = displayName; diff --git a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/IntentionListStep.java b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/IntentionListStep.java index 8c9e48ace441..e507c654eca2 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/IntentionListStep.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/IntentionListStep.java @@ -118,7 +118,7 @@ public class IntentionListStep implements ListPopupStep pair = hostEditor != null && hostFile != null - ? chooseBetweenHostAndInjected(hostFile, hostEditor, new PairProcessor() { + final Pair pair = hostEditor != null ? chooseBetweenHostAndInjected(hostFile, hostEditor, new PairProcessor() { @Override public boolean process(PsiFile psiFile, Editor editor) { return availableFor(psiFile, editor, action); } - }) : Pair.create(null, null); + }) : Pair.create(hostFile, null); if (pair == null) return false; Runnable runnable = new Runnable() { diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/ResourceBundlePropertyStructureViewElement.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/ResourceBundlePropertyStructureViewElement.java index a1f454eca8fc..27c44daba8ff 100644 --- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/ResourceBundlePropertyStructureViewElement.java +++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/ResourceBundlePropertyStructureViewElement.java @@ -19,6 +19,7 @@ */ package com.intellij.lang.properties.editor; +import com.intellij.codeInsight.daemon.HighlightDisplayKey; import com.intellij.ide.structureView.StructureViewTreeElement; import com.intellij.lang.properties.*; import com.intellij.lang.properties.ResourceBundle; @@ -31,6 +32,7 @@ import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.editor.colors.EditorColorsScheme; import com.intellij.openapi.editor.colors.TextAttributesKey; import com.intellij.openapi.editor.markup.TextAttributes; +import com.intellij.openapi.util.Pair; import com.intellij.psi.PsiFile; import com.intellij.util.PlatformIcons; import org.jetbrains.annotations.NotNull; @@ -93,7 +95,7 @@ public class ResourceBundlePropertyStructureViewElement implements StructureView } @NotNull - public ResourceBundleEditorProblemDescriptor[] getProblemDescriptors() { + public Pair[] getProblemDescriptors() { return myInspectionPassInfo.getDescriptors(); } diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/inspections/ResourceBundleEditorInspectionPass.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/inspections/ResourceBundleEditorInspectionPass.java index 88e6a90a8bfe..27bfe9e0e75f 100644 --- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/inspections/ResourceBundleEditorInspectionPass.java +++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/editor/inspections/ResourceBundleEditorInspectionPass.java @@ -30,6 +30,7 @@ import com.intellij.openapi.editor.colors.EditorColorsScheme; import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Comparing; +import com.intellij.openapi.util.Pair; import com.intellij.profile.codeInspection.InspectionProjectProfileManagerImpl; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; @@ -68,7 +69,8 @@ public class ResourceBundleEditorInspectionPass { final PsiFile containingFile = representativeFile.getContainingFile(); final InspectionToolWrapper[] propertiesTools = profileToUse.getInspectionTools(containingFile); - List allDescriptors = new SmartList(); + List> allDescriptors = + new SmartList>(); SortedSet highlightTypes = new TreeSet(new Comparator() { @Override public int compare(HighlightInfoType o1, HighlightInfoType o2) { @@ -87,8 +89,8 @@ public class ResourceBundleEditorInspectionPass { if (descriptors != null) { for (ResourceBundleEditorProblemDescriptor descriptor : descriptors) { final QuickFix[] currentFixes = descriptor.getFixes(); - if (currentFixes != null && currentFixes.length != 0) { - Collections.addAll(allDescriptors, descriptor); + if (currentFixes != null) { + allDescriptors.add(Pair.create(descriptor, toolKey)); } HighlightSeverity severity = profileToUse.getInspectionProfile().getErrorLevel(toolKey, containingFile).getSeverity(); final HighlightInfoType infoType = @@ -100,19 +102,19 @@ public class ResourceBundleEditorInspectionPass { } } } - return new InspectionPassInfo(allDescriptors.toArray(new ResourceBundleEditorProblemDescriptor[allDescriptors.size()]), highlightTypes); + return new InspectionPassInfo(allDescriptors.toArray(new Pair[allDescriptors.size()]), highlightTypes); } public static class InspectionPassInfo { - private final ResourceBundleEditorProblemDescriptor[] myDescriptors; + private final Pair[] myDescriptors; private final SortedSet myHighlightTypes; - public InspectionPassInfo(ResourceBundleEditorProblemDescriptor[] descriptors, SortedSet types) { + public InspectionPassInfo(Pair[] descriptors, SortedSet types) { myDescriptors = descriptors; myHighlightTypes = types; } - public ResourceBundleEditorProblemDescriptor[] getDescriptors() { + public Pair[] getDescriptors() { return myDescriptors; } diff --git a/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleEditorShowQuickFixesAction.java b/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleEditorShowQuickFixesAction.java index 32a17188cae8..b753963e3aed 100644 --- a/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleEditorShowQuickFixesAction.java +++ b/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleEditorShowQuickFixesAction.java @@ -15,6 +15,7 @@ */ package com.intellij.lang.properties.editor; +import com.intellij.codeInsight.daemon.HighlightDisplayKey; import com.intellij.codeInsight.daemon.impl.HighlightInfo; import com.intellij.codeInsight.daemon.impl.ShowIntentionsPass; import com.intellij.codeInsight.intention.IntentionAction; @@ -30,6 +31,7 @@ import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.fileEditor.FileEditor; import com.intellij.openapi.project.Project; +import com.intellij.openapi.util.Pair; import com.intellij.psi.PsiFile; import com.intellij.ui.popup.PopupFactoryImpl; import com.intellij.util.IncorrectOperationException; @@ -58,13 +60,20 @@ public class ResourceBundleEditorShowQuickFixesAction extends AnAction { final ShowIntentionsPass.IntentionsInfo intentions = new ShowIntentionsPass.IntentionsInfo(); boolean isQuickFixListEmpty = true; - ResourceBundleEditorProblemDescriptor[] descriptors = element.getProblemDescriptors(); - for (ResourceBundleEditorProblemDescriptor d : descriptors) { + Pair[] descriptorsAndSources = element.getProblemDescriptors(); + for (Pair p : descriptorsAndSources) { + final ResourceBundleEditorProblemDescriptor d = p.getFirst(); + final HighlightDisplayKey sourceKey = p.getSecond(); QuickFix[] fixes = d.getFixes(); if (fixes != null) { for (int i = 0; i < fixes.length; i++) { intentions.inspectionFixesToShow.add(new HighlightInfo.IntentionActionDescriptor(new RBEQuickFixWrapper(d, i), - AllIcons.Actions.IntentionBulb)); + null, + null, + AllIcons.Actions.IntentionBulb, + sourceKey, + null, + null)); isQuickFixListEmpty = false; } } From fe0133d9bdcd3dce56162fa7f428bbd5ff614d08 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Tue, 13 Oct 2015 16:56:16 +0200 Subject: [PATCH 17/80] Convert to kotlin --- .../debugger/FunctionScopesValueGroup.java | 69 +++---- .../debugger/ScopeVariablesGroup.java | 177 ++++++------------ .../debugger/frame/CallFrameView.java | 162 +++++----------- 3 files changed, 133 insertions(+), 275 deletions(-) diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/FunctionScopesValueGroup.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/FunctionScopesValueGroup.java index 28a7ed00829c..6f8ad5dc5bb3 100644 --- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/FunctionScopesValueGroup.java +++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/FunctionScopesValueGroup.java @@ -13,53 +13,38 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jetbrains.debugger; +package org.jetbrains.debugger -import com.intellij.util.Consumer; -import com.intellij.xdebugger.frame.XCompositeNode; -import com.intellij.xdebugger.frame.XValueChildrenList; -import com.intellij.xdebugger.frame.XValueGroup; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.concurrency.Promise; -import org.jetbrains.debugger.values.FunctionValue; -import org.jetbrains.rpc.CommandProcessor; +import com.intellij.util.Consumer +import com.intellij.xdebugger.frame.XCompositeNode +import com.intellij.xdebugger.frame.XValueChildrenList +import com.intellij.xdebugger.frame.XValueGroup +import org.jetbrains.concurrency.Promise +import org.jetbrains.debugger.values.FunctionValue +import org.jetbrains.rpc.CommandProcessor +import java.util.* -import java.util.Arrays; - -class FunctionScopesValueGroup extends XValueGroup { - private final FunctionValue value; - private final VariableContext variableContext; - - public FunctionScopesValueGroup(@NotNull FunctionValue value, @NotNull VariableContext variableContext) { - super("Function scopes"); - - this.value = value; - this.variableContext = variableContext; - } - - @Override - public void computeChildren(@NotNull final XCompositeNode node) { - node.setAlreadySorted(true); +internal class FunctionScopesValueGroup(private val value: FunctionValue, private val variableContext: VariableContext) : XValueGroup("Function scopes") { + override fun computeChildren(node: XCompositeNode) { + node.setAlreadySorted(true) value.resolve() - .done(new ObsolescentConsumer(node) { - @Override - public void consume(FunctionValue value) { - Scope[] scopes = value.getScopes(); - if (scopes == null || scopes.length == 0) { - node.addChildren(XValueChildrenList.EMPTY, true); + .done(object : ObsolescentConsumer(node) { + override fun consume(value: FunctionValue) { + val scopes = value.scopes + if (scopes == null || scopes.size() == 0) { + node.addChildren(XValueChildrenList.EMPTY, true) + } + else { + createAndAddScopeList(node, Arrays.asList(*scopes), variableContext, null) + } } - else { - ScopeVariablesGroup.createAndAddScopeList(node, Arrays.asList(scopes), variableContext, null); + }) + .rejected(object : Consumer { + override fun consume(error: Throwable) { + Promise.logError(CommandProcessor.LOG, error) + node.setErrorMessage(error.getMessage()!!) } - } - }) - .rejected(new Consumer() { - @Override - public void consume(Throwable error) { - Promise.logError(CommandProcessor.LOG, error); - node.setErrorMessage(error.getMessage()); - } - }); + }) } } \ No newline at end of file diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ScopeVariablesGroup.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ScopeVariablesGroup.java index 2d1ba1a36754..38be77f26bea 100644 --- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ScopeVariablesGroup.java +++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ScopeVariablesGroup.java @@ -13,139 +13,82 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jetbrains.debugger; +package org.jetbrains.debugger -import com.intellij.xdebugger.XDebuggerBundle; -import com.intellij.xdebugger.frame.XCompositeNode; -import com.intellij.xdebugger.frame.XValueChildrenList; -import com.intellij.xdebugger.frame.XValueGroup; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.TestOnly; -import org.jetbrains.concurrency.Promise; +import com.intellij.xdebugger.XDebuggerBundle +import com.intellij.xdebugger.frame.XCompositeNode +import com.intellij.xdebugger.frame.XValueChildrenList +import com.intellij.xdebugger.frame.XValueGroup -import java.util.List; +class ScopeVariablesGroup(val scope: Scope, parentContext: VariableContext, callFrame: CallFrame?) : XValueGroup(createScopeNodeName(scope)) { + private val context = createVariableContext(scope, parentContext, callFrame) -public class ScopeVariablesGroup extends XValueGroup { - private final Scope scope; - private final VariableContext context; + private val callFrame = if (scope.type == Scope.Type.LOCAL) callFrame else null - private final CallFrame callFrame; + override fun isAutoExpand() = scope.type == Scope.Type.LOCAL || scope.type == Scope.Type.CATCH - public ScopeVariablesGroup(@NotNull Scope scope, @NotNull VariableContext parentContext, @Nullable CallFrame callFrame) { - super(createScopeNodeName(scope)); - - this.scope = scope; - context = createVariableContext(scope, parentContext, callFrame); - this.callFrame = scope.getType() == Scope.Type.LOCAL ? callFrame : null; + override fun getComment(): String? { + val className = scope.description + return if ("Object" == className) null else className } - // public only for tests - @NotNull - public static VariableContext createVariableContext(@NotNull Scope scope, @NotNull VariableContext parentContext, @Nullable CallFrame callFrame) { - if (callFrame == null || scope.getType() == Scope.Type.LIBRARY) { - // functions scopes - we can watch variables only from global scope - return new ParentlessVariableContext(parentContext, scope, scope.getType() == Scope.Type.GLOBAL); - } - else { - return new VariableContextWrapper(parentContext, scope); + override fun computeChildren(node: XCompositeNode) { + val promise = processScopeVariables(scope, node, context, callFrame == null) + if (callFrame == null) { + return } + + promise.done(object : ObsolescentConsumer(node) { + override fun consume(ignored: Void) { + callFrame.receiverVariable.done(object : ObsolescentConsumer(node) { + override fun consume(variable: Variable?) { + node.addChildren(if (variable == null) XValueChildrenList.EMPTY else XValueChildrenList.singleton(VariableView(variable, context)), true) + } + }).rejected(object : ObsolescentConsumer(node) { + override fun consume(error: Throwable?) { + node.addChildren(XValueChildrenList.EMPTY, true) + } + }) + } + }) } +} - @TestOnly - @NotNull - public Scope getScope() { - return scope; +fun createAndAddScopeList(node: XCompositeNode, scopes: List, context: VariableContext, callFrame: CallFrame?) { + val list = XValueChildrenList(scopes.size()) + for (scope in scopes) { + list.addTopGroup(ScopeVariablesGroup(scope, context, callFrame)) } + node.addChildren(list, true) +} - public static void createAndAddScopeList(@NotNull XCompositeNode node, @NotNull List scopes, @NotNull VariableContext context, @Nullable CallFrame callFrame) { - XValueChildrenList list = new XValueChildrenList(scopes.size()); - for (Scope scope : scopes) { - list.addTopGroup(new ScopeVariablesGroup(scope, context, callFrame)); - } - node.addChildren(list, true); +fun createVariableContext(scope: Scope, parentContext: VariableContext, callFrame: CallFrame?): VariableContext { + if (callFrame == null || scope.type == Scope.Type.LIBRARY) { + // functions scopes - we can watch variables only from global scope + return ParentlessVariableContext(parentContext, scope, scope.type == Scope.Type.GLOBAL) } - - private static String createScopeNodeName(@NotNull Scope scope) { - switch (scope.getType()) { - case GLOBAL: - return XDebuggerBundle.message("scope.global"); - case LOCAL: - return XDebuggerBundle.message("scope.local"); - case WITH: - return XDebuggerBundle.message("scope.with"); - case CLOSURE: - return XDebuggerBundle.message("scope.closure"); - case CATCH: - return XDebuggerBundle.message("scope.catch"); - case LIBRARY: - return XDebuggerBundle.message("scope.library"); - case INSTANCE: - return XDebuggerBundle.message("scope.instance"); - case CLASS: - return XDebuggerBundle.message("scope.class"); - case UNKNOWN: - return XDebuggerBundle.message("scope.unknown"); - default: - throw new IllegalArgumentException(scope.getType().name()); - } + else { + return VariableContextWrapper(parentContext, scope) } +} - @Override - public boolean isAutoExpand() { - return scope.getType() == Scope.Type.LOCAL || scope.getType() == Scope.Type.CATCH; - } +private class ParentlessVariableContext(parentContext: VariableContext, scope: Scope, private val watchableAsEvaluationExpression: Boolean) : VariableContextWrapper(parentContext, scope) { + override fun watchableAsEvaluationExpression() = watchableAsEvaluationExpression - @Nullable - @Override - public String getComment() { - String className = scope.getDescription(); - return "Object".equals(className) ? null : className; - } + override fun getParent() = null +} - @Override - public void computeChildren(final @NotNull XCompositeNode node) { - Promise promise = VariablesKt.processScopeVariables(scope, node, context, callFrame == null); - if (callFrame != null) { - promise.done(new ObsolescentConsumer(node) { - @Override - public void consume(Void ignored) { - callFrame.getReceiverVariable() - .done(new ObsolescentConsumer(node) { - @Override - public void consume(Variable variable) { - node.addChildren(variable == null ? XValueChildrenList.EMPTY : XValueChildrenList.singleton(VariableViewKt.VariableView(variable, context)), true); - } - }) - .rejected(new ObsolescentConsumer(node) { - @Override - public void consume(@Nullable Throwable error) { - node.addChildren(XValueChildrenList.EMPTY, true); - } - }); - } - }); - } - } - - private static final class ParentlessVariableContext extends VariableContextWrapper { - private final boolean watchableAsEvaluationExpression; - - public ParentlessVariableContext(@NotNull VariableContext parentContext, @NotNull Scope scope, boolean watchableAsEvaluationExpression) { - super(parentContext, scope); - - this.watchableAsEvaluationExpression = watchableAsEvaluationExpression; - } - - @Override - public boolean watchableAsEvaluationExpression() { - return watchableAsEvaluationExpression; - } - - @Nullable - @Override - public VariableContext getParent() { - return null; - } +private fun createScopeNodeName(scope: Scope): String { + when (scope.type) { + Scope.Type.GLOBAL -> return XDebuggerBundle.message("scope.global") + Scope.Type.LOCAL -> return XDebuggerBundle.message("scope.local") + Scope.Type.WITH -> return XDebuggerBundle.message("scope.with") + Scope.Type.CLOSURE -> return XDebuggerBundle.message("scope.closure") + Scope.Type.CATCH -> return XDebuggerBundle.message("scope.catch") + Scope.Type.LIBRARY -> return XDebuggerBundle.message("scope.library") + Scope.Type.INSTANCE -> return XDebuggerBundle.message("scope.instance") + Scope.Type.CLASS -> return XDebuggerBundle.message("scope.class") + Scope.Type.UNKNOWN -> return XDebuggerBundle.message("scope.unknown") + else -> throw IllegalArgumentException(scope.type.name()) } } \ No newline at end of file diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.java index 6a123e80bade..029e1411da37 100644 --- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.java +++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.java @@ -13,155 +13,85 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jetbrains.debugger.frame; +package org.jetbrains.debugger.frame -import com.intellij.icons.AllIcons; -import com.intellij.ui.ColoredTextContainer; -import com.intellij.ui.SimpleTextAttributes; -import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; -import com.intellij.xdebugger.frame.XCompositeNode; -import com.intellij.xdebugger.frame.XStackFrame; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.concurrency.Promise; -import org.jetbrains.debugger.*; +import com.intellij.icons.AllIcons +import com.intellij.ui.ColoredTextContainer +import com.intellij.ui.SimpleTextAttributes +import com.intellij.xdebugger.evaluation.XDebuggerEvaluator +import com.intellij.xdebugger.frame.XCompositeNode +import com.intellij.xdebugger.frame.XStackFrame +import org.jetbrains.debugger.* -public final class CallFrameView extends XStackFrame implements VariableContext { - private final SourceInfo sourceInfo; - private final DebuggerViewSupport viewSupport; - private final CallFrame callFrame; +class CallFrameView(val callFrame: CallFrame, + private val sourceInfo: SourceInfo?, + private val viewSupport: DebuggerViewSupport, + val script: Script?) : XStackFrame(), VariableContext { + // isInLibraryContent call could be costly, so we compute it only once (our customizePresentation called on each repaint) + private val inLibraryContent = sourceInfo != null && viewSupport.isInLibraryContent(sourceInfo, script) + private var evaluator: XDebuggerEvaluator? = null - private final Script script; - - private final boolean inLibraryContent; - private XDebuggerEvaluator evaluator; - - public CallFrameView(@NotNull CallFrame callFrame, @NotNull DebuggerViewSupport viewSupport, @Nullable Script script) { - this(callFrame, viewSupport.getSourceInfo(script, callFrame), viewSupport, script); + constructor(callFrame: CallFrame, viewSupport: DebuggerViewSupport, script: Script?) : this(callFrame, viewSupport.getSourceInfo(script, callFrame), viewSupport, script) { } - public CallFrameView(@NotNull CallFrame callFrame, - @Nullable SourceInfo sourceInfo, - @NotNull DebuggerViewSupport viewSupport, - @Nullable Script script) { - this.sourceInfo = sourceInfo; + override fun getEqualityObject() = callFrame.equalityObject - this.viewSupport = viewSupport; - this.callFrame = callFrame; - this.script = script; - - // isInLibraryContent call could be costly, so we compute it only once (our customizePresentation called on each repaint) - inLibraryContent = sourceInfo != null && viewSupport.isInLibraryContent(sourceInfo, script); + override fun computeChildren(node: XCompositeNode) { + node.setAlreadySorted(true) + createAndAddScopeList(node, callFrame.variableScopes, this, callFrame) } - @Nullable - public Script getScript() { - return script; - } + override fun getEvaluateContext() = callFrame.evaluateContext - @Override - public Object getEqualityObject() { - return callFrame.getEqualityObject(); - } + override fun getName() = null - @Override - public void computeChildren(@NotNull XCompositeNode node) { - node.setAlreadySorted(true); - ScopeVariablesGroup.createAndAddScopeList(node, callFrame.getVariableScopes(), this, callFrame); - } + override fun getParent() = null - @NotNull - public CallFrame getCallFrame() { - return callFrame; - } + override fun watchableAsEvaluationExpression() = true - @NotNull - @Override - public EvaluateContext getEvaluateContext() { - return callFrame.getEvaluateContext(); - } + override fun getViewSupport() = viewSupport - @Nullable - @Override - public String getName() { - return null; - } + override fun getMemberFilter() = viewSupport.getMemberFilter(this) - @Nullable - @Override - public VariableContext getParent() { - return null; - } + fun getMemberFilter(scope: Scope) = createVariableContext(scope, this, callFrame).memberFilter - @Override - public boolean watchableAsEvaluationExpression() { - return true; - } + override fun getScope() = null - @NotNull - @Override - public DebuggerViewSupport getViewSupport() { - return viewSupport; - } - - @NotNull - @Override - public Promise getMemberFilter() { - return viewSupport.getMemberFilter(this); - } - - @NotNull - public Promise getMemberFilter(@NotNull Scope scope) { - return ScopeVariablesGroup.createVariableContext(scope, this, callFrame).getMemberFilter(); - } - - @Nullable - @Override - public Scope getScope() { - return null; - } - - @Override - public final XDebuggerEvaluator getEvaluator() { + override fun getEvaluator(): XDebuggerEvaluator? { if (evaluator == null) { - evaluator = viewSupport.createFrameEvaluator(this); + evaluator = viewSupport.createFrameEvaluator(this) } - return evaluator; + return evaluator } - @Override - @Nullable - public SourceInfo getSourcePosition() { - return sourceInfo; - } + override fun getSourcePosition() = sourceInfo - @Override - public final void customizePresentation(@NotNull ColoredTextContainer component) { + override fun customizePresentation(component: ColoredTextContainer) { if (sourceInfo == null) { - String scriptName = script == null ? "unknown" : script.getUrl().trimParameters().toDecodedForm(); - int line = callFrame.getLine(); - component.append(line != -1 ? scriptName + ':' + line : scriptName, SimpleTextAttributes.ERROR_ATTRIBUTES); - return; + val scriptName = if (script == null) "unknown" else script.url.trimParameters().toDecodedForm() + val line = callFrame.line + component.append(if (line != -1) scriptName + ':' + line else scriptName, SimpleTextAttributes.ERROR_ATTRIBUTES) + return } - String fileName = sourceInfo.getFile().getName(); - int line = sourceInfo.getLine() + 1; + val fileName = sourceInfo.file.name + val line = sourceInfo.line + 1 - SimpleTextAttributes textAttributes = inLibraryContent ? SimpleTextAttributes.GRAYED_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES; + val textAttributes = if (inLibraryContent) SimpleTextAttributes.GRAYED_ATTRIBUTES else SimpleTextAttributes.REGULAR_ATTRIBUTES - String functionName = sourceInfo.getFunctionName(); + val functionName = sourceInfo.functionName if (functionName == null || (functionName.isEmpty() && callFrame.hasOnlyGlobalScope())) { - component.append(fileName + ":" + line, textAttributes); + component.append(fileName + ":" + line, textAttributes) } else { if (functionName.isEmpty()) { - component.append("anonymous", inLibraryContent ? SimpleTextAttributes.GRAYED_ITALIC_ATTRIBUTES : SimpleTextAttributes.REGULAR_ITALIC_ATTRIBUTES); + component.append("anonymous", if (inLibraryContent) SimpleTextAttributes.GRAYED_ITALIC_ATTRIBUTES else SimpleTextAttributes.REGULAR_ITALIC_ATTRIBUTES) } else { - component.append(functionName, textAttributes); + component.append(functionName, textAttributes) } - component.append("(), " + fileName + ":" + line, textAttributes); + component.append("(), $fileName:$line", textAttributes) } - component.setIcon(AllIcons.Debugger.StackFrame); + component.setIcon(AllIcons.Debugger.StackFrame) } } \ No newline at end of file From 20f1c10fe330e6de9b0210197707d9937a96c31b Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Tue, 13 Oct 2015 16:56:33 +0200 Subject: [PATCH 18/80] Convert to kotlin --- ...{FunctionScopesValueGroup.java => FunctionScopesValueGroup.kt} | 0 .../debugger/{ScopeVariablesGroup.java => ScopeVariablesGroup.kt} | 0 .../debugger/frame/{CallFrameView.java => CallFrameView.kt} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/{FunctionScopesValueGroup.java => FunctionScopesValueGroup.kt} (100%) rename platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/{ScopeVariablesGroup.java => ScopeVariablesGroup.kt} (100%) rename platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/{CallFrameView.java => CallFrameView.kt} (100%) diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/FunctionScopesValueGroup.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/FunctionScopesValueGroup.kt similarity index 100% rename from platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/FunctionScopesValueGroup.java rename to platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/FunctionScopesValueGroup.kt diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ScopeVariablesGroup.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ScopeVariablesGroup.kt similarity index 100% rename from platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ScopeVariablesGroup.java rename to platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ScopeVariablesGroup.kt diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.kt similarity index 100% rename from platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.java rename to platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/frame/CallFrameView.kt From c7bb3c76ff129e88651653766ecae67683cbbe1e Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Tue, 13 Oct 2015 17:27:58 +0200 Subject: [PATCH 19/80] Convert to kotlin --- .../jetbrains/debugger/DeclarativeScope.java | 44 +++++++------------ 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/DeclarativeScope.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/DeclarativeScope.java index 6316d746464b..edc7ab93e3fe 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/debugger/DeclarativeScope.java +++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/DeclarativeScope.java @@ -1,38 +1,24 @@ -package org.jetbrains.debugger; +package org.jetbrains.debugger -import com.intellij.util.Consumer; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.concurrency.Promise; -import org.jetbrains.debugger.values.ObjectValue; -import org.jetbrains.debugger.values.ValueManager; +import com.intellij.util.Consumer +import org.jetbrains.concurrency.Promise +import org.jetbrains.debugger.values.ObjectValue +import org.jetbrains.debugger.values.ValueManager -import java.util.List; +abstract class DeclarativeScope>(type: Scope.Type, description: String? = null) : ScopeBase(type, description) { + protected abstract val childrenManager: VariablesHost -public abstract class DeclarativeScope extends ScopeBase { - protected VariablesHost childrenManager; - - protected DeclarativeScope(@NotNull Type type, @Nullable String description) { - super(type, description); - } - - @NotNull - protected final Promise> loadScopeObjectProperties(@NotNull ObjectValue value) { - if (childrenManager.valueManager.isObsolete()) { - return ValueManager.reject(); + protected fun loadScopeObjectProperties(value: ObjectValue): Promise> { + if (childrenManager.valueManager.isObsolete) { + return ValueManager.reject() } - return value.getProperties().done(new Consumer>() { - @Override - public void consume(List variables) { - childrenManager.updateCacheStamp(); + return value.properties.done(object : Consumer> { + override fun consume(variables: List) { + childrenManager.updateCacheStamp() } - }); + }) } - @NotNull - @Override - public final VariablesHost getVariablesHost() { - return childrenManager; - } + override fun getVariablesHost() = childrenManager } \ No newline at end of file From dea39675dc3eab586f83ce02954d8af2ac283048 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Tue, 13 Oct 2015 17:28:15 +0200 Subject: [PATCH 20/80] convert to kotlin --- .../debugger/{DeclarativeScope.java => DeclarativeScope.kt} | 0 platform/script-debugger/debugger-ui/src/util.kt | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename platform/script-debugger/backend/src/org/jetbrains/debugger/{DeclarativeScope.java => DeclarativeScope.kt} (100%) diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/DeclarativeScope.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/DeclarativeScope.kt similarity index 100% rename from platform/script-debugger/backend/src/org/jetbrains/debugger/DeclarativeScope.java rename to platform/script-debugger/backend/src/org/jetbrains/debugger/DeclarativeScope.kt diff --git a/platform/script-debugger/debugger-ui/src/util.kt b/platform/script-debugger/debugger-ui/src/util.kt index 527dea26ae1b..5c20e3cf9b6b 100644 --- a/platform/script-debugger/debugger-ui/src/util.kt +++ b/platform/script-debugger/debugger-ui/src/util.kt @@ -23,14 +23,14 @@ import org.jetbrains.rpc.CommandProcessor import org.jetbrains.util.concurrency.AsyncPromise // have to use package "com.intellij.xdebugger.util" to avoid package clash -public fun XDebugSession.rejectedErrorReporter(description: String? = null): (Throwable) -> Unit = { +fun XDebugSession.rejectedErrorReporter(description: String? = null): (Throwable) -> Unit = { Promise.logError(CommandProcessor.LOG, it) if (it != AsyncPromise.OBSOLETE_ERROR) { reportError("${if (description == null) "" else description + ": "}${it.getMessage()}") } } -public inline fun contextDependentResultConsumer(context: SuspendContext, crossinline done: (result: T, vm: Vm) -> Unit) : (T) -> Unit { +inline fun contextDependentResultConsumer(context: SuspendContext, crossinline done: (result: T, vm: Vm) -> Unit) : (T) -> Unit { return { val vm = context.valueManager.vm if (vm.attachStateManager.isAttached() && !vm.getSuspendContextManager().isContextObsolete(context)) { From ed2ba795b206f82df55e043667e2f128d76b00a2 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Thu, 15 Oct 2015 15:09:52 +0200 Subject: [PATCH 21/80] convert ObjectValue, MessageManager, Value, CommandProcessor, ValueModifier, MessageWriter, ArrayValue, ValueBase, CommandSenderBase, ResultReader, MessageProcessor, ObjectValueBase, ValueNodeAsyncFunction, RequestCallback, MessageManagerBase to kotlin --- .../org/jetbrains/debugger/ValueModifier.java | 16 +- .../jetbrains/debugger/values/ArrayValue.java | 13 +- .../debugger/values/ObjectValue.java | 48 +++--- .../debugger/values/ObjectValueBase.java | 160 ++++++------------ .../org/jetbrains/debugger/values/Value.java | 11 +- .../jetbrains/debugger/values/ValueBase.java | 18 +- .../org/jetbrains/rpc/CommandProcessor.java | 50 ++---- .../org/jetbrains/rpc/CommandSenderBase.java | 58 +++---- .../src/org/jetbrains/rpc/MessageManager.java | 125 ++++++-------- .../org/jetbrains/rpc/MessageManagerBase.java | 27 +-- .../org/jetbrains/rpc/MessageProcessor.java | 16 +- .../src/org/jetbrains/rpc/MessageWriter.java | 33 ++-- .../org/jetbrains/rpc/RequestCallback.java | 12 +- .../src/org/jetbrains/rpc/ResultReader.java | 8 +- .../debugger/ValueNodeAsyncFunction.java | 30 ++-- 15 files changed, 245 insertions(+), 380 deletions(-) diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/ValueModifier.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/ValueModifier.java index 4800f8005f8b..7b404382bc99 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/debugger/ValueModifier.java +++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/ValueModifier.java @@ -1,19 +1,17 @@ -package org.jetbrains.debugger; +package org.jetbrains.debugger -import org.jetbrains.annotations.NotNull; -import org.jetbrains.concurrency.Promise; -import org.jetbrains.debugger.values.Value; +import org.jetbrains.concurrency.Promise +import org.jetbrains.debugger.values.Value -public interface ValueModifier { +interface ValueModifier { // expression can contains reference to another variables in current scope, so, we should evaluate it before set // https://youtrack.jetbrains.com/issue/WEB-2342#comment=27-512122 // we don't worry about performance in case of simple primitive values - boolean/string/numbers, // it works quickly and we don't want to complicate our code and debugger SDK - Promise setValue(@NotNull Variable variable, String newValue, @NotNull EvaluateContext evaluateContext); + fun setValue(variable: Variable, newValue: String, evaluateContext: EvaluateContext): Promise<*> - Promise setValue(@NotNull Variable variable, @NotNull Value newValue, @NotNull EvaluateContext evaluateContext); + fun setValue(variable: Variable, newValue: Value, evaluateContext: EvaluateContext): Promise<*> - @NotNull - Promise evaluateGet(@NotNull Variable variable, @NotNull EvaluateContext evaluateContext); + fun evaluateGet(variable: Variable, evaluateContext: EvaluateContext): Promise } \ No newline at end of file diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ArrayValue.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ArrayValue.java index a0a8b22ccb5b..f9bd69031e27 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ArrayValue.java +++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ArrayValue.java @@ -1,14 +1,13 @@ -package org.jetbrains.debugger.values; +package org.jetbrains.debugger.values -public interface ArrayValue extends ObjectValue { +interface ArrayValue : ObjectValue { /** * Be aware - it is not equals to java array length. - * In case of sparse array {@code - * var sparseArray = [3, 4]; + * In case of sparse array `var sparseArray = [3, 4]; * sparseArray[45] = 34; - * sparseArray[40999995] = "foo"; - * } + * sparseArray[40999995] = "foo"; + ` * * length will be equal to 40999995. */ - int getLength(); + val length: Int } \ No newline at end of file diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ObjectValue.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ObjectValue.java index 3d9bd035ed15..ed57378999c2 100755 --- a/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ObjectValue.java +++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ObjectValue.java @@ -1,49 +1,39 @@ -package org.jetbrains.debugger.values; +package org.jetbrains.debugger.values -import com.intellij.util.ThreeState; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.concurrency.Obsolescent; -import org.jetbrains.concurrency.Promise; -import org.jetbrains.debugger.EvaluateContext; -import org.jetbrains.debugger.Variable; -import org.jetbrains.debugger.VariablesHost; - -import java.util.List; +import com.intellij.util.ThreeState +import org.jetbrains.concurrency.Obsolescent +import org.jetbrains.concurrency.Promise +import org.jetbrains.debugger.EvaluateContext +import org.jetbrains.debugger.Variable +import org.jetbrains.debugger.VariablesHost +import org.jetbrains.debugger.Vm /** * A compound value that has zero or more properties */ -public interface ObjectValue extends Value { - @Nullable - String getClassName(); +interface ObjectValue : Value { + val className: String? - @NotNull - Promise> getProperties(); + val properties: Promise> - @NotNull - Promise> getProperties(@NotNull List names, @NotNull EvaluateContext evaluateContext, @NotNull Obsolescent obsolescent); + fun getProperties(names: List, evaluateContext: EvaluateContext, obsolescent: Obsolescent): Promise> - @NotNull - VariablesHost getVariablesHost(); + val variablesHost: VariablesHost> /** * from (inclusive) to (exclusive) ranges of array elements or elements if less than bucketThreshold - * + * "to" could be -1 (sometimes length is unknown, so, you can pass -1 instead of actual elements size) */ - @NotNull - Promise getIndexedProperties(int from, int to, int bucketThreshold, @NotNull IndexedVariablesConsumer consumer, @Nullable ValueType componentType); + fun getIndexedProperties(from: Int, to: Int, bucketThreshold: Int, consumer: IndexedVariablesConsumer, componentType: ValueType?): Promise<*> /** - * It must return quickly. Return {@link com.intellij.util.ThreeState#UNSURE} otherwise. + * It must return quickly. Return [com.intellij.util.ThreeState.UNSURE] otherwise. */ - @NotNull - ThreeState hasProperties(); + fun hasProperties() = ThreeState.UNSURE /** - * It must return quickly. Return {@link com.intellij.util.ThreeState#UNSURE} otherwise. + * It must return quickly. Return [com.intellij.util.ThreeState.UNSURE] otherwise. */ - @NotNull - ThreeState hasIndexedProperties(); + fun hasIndexedProperties() = ThreeState.NO } \ No newline at end of file diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ObjectValueBase.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ObjectValueBase.java index 67f375b00ad1..f6db099fc20f 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ObjectValueBase.java +++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ObjectValueBase.java @@ -1,127 +1,73 @@ -package org.jetbrains.debugger.values; +package org.jetbrains.debugger.values -import com.intellij.util.SmartList; -import com.intellij.util.ThreeState; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.concurrency.Obsolescent; -import org.jetbrains.concurrency.ObsolescentAsyncFunction; -import org.jetbrains.concurrency.Promise; -import org.jetbrains.debugger.EvaluateContext; -import org.jetbrains.debugger.ValueModifier; -import org.jetbrains.debugger.Variable; -import org.jetbrains.debugger.VariablesHost; +import com.intellij.util.SmartList +import org.jetbrains.concurrency.Obsolescent +import org.jetbrains.concurrency.ObsolescentAsyncFunction +import org.jetbrains.concurrency.Promise +import org.jetbrains.debugger.EvaluateContext +import org.jetbrains.debugger.Variable +import org.jetbrains.debugger.VariablesHost +import org.jetbrains.debugger.Vm +import java.util.* -import java.util.Collections; -import java.util.Comparator; -import java.util.List; +abstract class ObjectValueBase>(type: ValueType) : ValueBase(type), ObjectValue { + protected abstract val childrenManager: VariablesHost -public abstract class ObjectValueBase extends ValueBase implements ObjectValue { - protected VariablesHost childrenManager; + override val properties: Promise> + get() = childrenManager.get() - public ObjectValueBase(@NotNull ValueType type) { - super(type); + internal abstract inner class MyObsolescentAsyncFunction(private val obsolescent: Obsolescent) : ObsolescentAsyncFunction { + override fun isObsolete() = obsolescent.isObsolete || childrenManager.valueManager.isObsolete } - @NotNull - @Override - public final Promise> getProperties() { - return childrenManager.get(); - } + override fun getProperties(names: List, evaluateContext: EvaluateContext, obsolescent: Obsolescent) = properties + .then(object : MyObsolescentAsyncFunction, List>(obsolescent) { + override fun `fun`(variables: List) = getSpecifiedProperties(variables, names, evaluateContext) + }) - abstract class MyObsolescentAsyncFunction implements ObsolescentAsyncFunction { - private final Obsolescent obsolescent; + override val valueString: String? = null - MyObsolescentAsyncFunction(@NotNull Obsolescent obsolescent) { - this.obsolescent = obsolescent; - } + override fun getIndexedProperties(from: Int, to: Int, bucketThreshold: Int, consumer: IndexedVariablesConsumer, componentType: ValueType?): Promise<*> = Promise.REJECTED - @Override - public boolean isObsolete() { - return obsolescent.isObsolete() || childrenManager.valueManager.isObsolete(); - } - } + @Suppress("CAST_NEVER_SUCCEEDS") + override val variablesHost: VariablesHost> + get() = childrenManager as VariablesHost> - @NotNull - @Override - public Promise> getProperties(@NotNull final List names, @NotNull final EvaluateContext evaluateContext, @NotNull final Obsolescent obsolescent) { - return getProperties() - .then(new MyObsolescentAsyncFunction, List>(obsolescent) { - @NotNull - @Override - public Promise> fun(List variables) { - return getSpecifiedProperties(variables, names, evaluateContext); + companion object { + protected fun getSpecifiedProperties(variables: List, names: List, evaluateContext: EvaluateContext): Promise> { + val properties = SmartList() + var getterCount = 0 + for (property in variables) { + if (!property.isReadable || !names.contains(property.name)) { + continue } - }); - } - @NotNull - protected static Promise> getSpecifiedProperties(@NotNull List variables, @NotNull final List names, @NotNull EvaluateContext evaluateContext) { - final List properties = new SmartList(); - int getterCount = 0; - for (Variable property : variables) { - if (!property.isReadable() || !names.contains(property.getName())) { - continue; + if (!properties.isEmpty()) { + Collections.sort(properties, object : Comparator { + override fun compare(o1: Variable, o2: Variable) = names.indexOf(o1.name) - names.indexOf(o2.name) + }) + } + + properties.add(property) + if (property.value == null) { + getterCount++ + } } - if (!properties.isEmpty()) { - Collections.sort(properties, new Comparator() { - @Override - public int compare(@NotNull Variable o1, @NotNull Variable o2) { - return names.indexOf(o1.getName()) - names.indexOf(o2.getName()); + if (getterCount == 0) { + return Promise.resolve(properties) + } + else { + val promises = SmartList>() + for (variable in properties) { + if (variable.value == null) { + val valueModifier = variable.valueModifier + assert(valueModifier != null) + promises.add(valueModifier!!.evaluateGet(variable, evaluateContext)) } - }); - } - - properties.add(property); - if (property.getValue() == null) { - getterCount++; - } - } - - if (getterCount == 0) { - return Promise.resolve(properties); - } - else { - List> promises = new SmartList>(); - for (Variable variable : properties) { - if (variable.getValue() == null) { - ValueModifier valueModifier = variable.getValueModifier(); - assert valueModifier != null; - promises.add(valueModifier.evaluateGet(variable, evaluateContext)); } + return Promise.all>(promises, properties) } - return Promise.all(promises, properties); } } - - @Nullable - @Override - public String getValueString() { - return null; - } - - @NotNull - @Override - public ThreeState hasProperties() { - return ThreeState.UNSURE; - } - - @NotNull - @Override - public ThreeState hasIndexedProperties() { - return ThreeState.NO; - } - - @NotNull - @Override - public Promise getIndexedProperties(int from, int to, int bucketThreshold, @NotNull IndexedVariablesConsumer consumer, @Nullable ValueType componentType) { - return Promise.REJECTED; - } - - @NotNull - @Override - public VariablesHost getVariablesHost() { - return childrenManager; - } } \ No newline at end of file diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/values/Value.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/values/Value.java index c64d1e090795..7c8ec35576e5 100755 --- a/platform/script-debugger/backend/src/org/jetbrains/debugger/values/Value.java +++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/values/Value.java @@ -1,16 +1,13 @@ -package org.jetbrains.debugger.values; - -import org.jetbrains.annotations.NotNull; +package org.jetbrains.debugger.values /** * An object that represents a VM variable value (compound or atomic). */ -public interface Value { - @NotNull - ValueType getType(); +interface Value { + val type: ValueType /** * @return a string representation of this value */ - String getValueString(); + val valueString: String? } diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ValueBase.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ValueBase.java index fd8cc9c93615..a97684a3522e 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ValueBase.java +++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ValueBase.java @@ -1,17 +1,3 @@ -package org.jetbrains.debugger.values; +package org.jetbrains.debugger.values -import org.jetbrains.annotations.NotNull; - -public abstract class ValueBase implements Value { - protected final ValueType type; - - public ValueBase(@NotNull ValueType type) { - this.type = type; - } - - @NotNull - @Override - public final ValueType getType() { - return type; - } -} \ No newline at end of file +abstract class ValueBase(override val type: ValueType) : Value \ No newline at end of file diff --git a/platform/script-debugger/backend/src/org/jetbrains/rpc/CommandProcessor.java b/platform/script-debugger/backend/src/org/jetbrains/rpc/CommandProcessor.java index ea20491884da..2614dcaf8697 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/rpc/CommandProcessor.java +++ b/platform/script-debugger/backend/src/org/jetbrains/rpc/CommandProcessor.java @@ -1,44 +1,30 @@ -package org.jetbrains.rpc; +package org.jetbrains.rpc -import com.intellij.openapi.diagnostic.Logger; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jsonProtocol.Request; +import com.intellij.openapi.diagnostic.Logger +import org.jetbrains.jsonProtocol.Request +import java.util.concurrent.atomic.AtomicInteger -import java.util.concurrent.atomic.AtomicInteger; +val LOG = Logger.getInstance(CommandProcessor::class.java) -public abstract class CommandProcessor - extends CommandSenderBase - implements MessageManager.Handler, - ResultReader, - MessageProcessor { - public static final Logger LOG = Logger.getInstance(CommandProcessor.class); +abstract class CommandProcessor() : CommandSenderBase(), MessageManager.Handler, INCOMING, INCOMING_WITH_SEQ, SUCCESS_RESPONSE>, ResultReader, MessageProcessor { + private val currentSequence = AtomicInteger() + protected val messageManager = MessageManager(this) - private final AtomicInteger currentSequence = new AtomicInteger(); - protected final MessageManager messageManager; - - protected CommandProcessor() { - messageManager = new MessageManager(this); + override fun cancelWaitingRequests() { + messageManager.cancelWaitingRequests() } - @Override - public final void cancelWaitingRequests() { - messageManager.cancelWaitingRequests(); + override fun closed() { + messageManager.closed() } - @Override - public final void closed() { - messageManager.closed(); + override fun getUpdatedSequence(message: Request): Int { + val id = currentSequence.incrementAndGet() + message.finalize(id) + return id } - @Override - public final int getUpdatedSequence(@NotNull Request message) { - int id = currentSequence.incrementAndGet(); - message.finalize(id); - return id; - } - - @Override - protected void send(@NotNull Request message, @NotNull RequestPromise callback) { - messageManager.send(message, callback); + override final fun doSend(message: Request, callback: CommandSenderBase.RequestPromise) { + messageManager.send(message, callback) } } \ No newline at end of file diff --git a/platform/script-debugger/backend/src/org/jetbrains/rpc/CommandSenderBase.java b/platform/script-debugger/backend/src/org/jetbrains/rpc/CommandSenderBase.java index 41ecacf14420..c9c799014f4f 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/rpc/CommandSenderBase.java +++ b/platform/script-debugger/backend/src/org/jetbrains/rpc/CommandSenderBase.java @@ -1,49 +1,43 @@ -package org.jetbrains.rpc; +package org.jetbrains.rpc -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.concurrency.AsyncPromise; -import org.jetbrains.concurrency.Promise; -import org.jetbrains.jsonProtocol.Request; +import org.jetbrains.concurrency.AsyncPromise +import org.jetbrains.concurrency.Promise +import org.jetbrains.jsonProtocol.Request -public abstract class CommandSenderBase implements CommandSender { - protected abstract void send(@NotNull Request message, @NotNull RequestPromise callback); +abstract class CommandSenderBase { + protected abstract fun doSend(message: Request, callback: RequestPromise) - @Override - @NotNull - public final Promise send(@NotNull Request request) { - RequestPromise callback = new RequestPromise(request.getMethodName()); - send(request, callback); - return callback; + fun send(message: Request): Promise { + val callback = RequestPromise(message.methodName) + doSend(message, callback) + return callback } - protected static final class RequestPromise extends AsyncPromise implements RequestCallback { - private final String methodName; - - public RequestPromise(@Nullable String methodName) { - this.methodName = methodName; - } - - @Override - public void onSuccess(@Nullable SUCCESS_RESPONSE response, @Nullable ResultReader resultReader) { + protected class RequestPromise(private val methodName: String?) : AsyncPromise(), RequestCallback { + @Suppress("BASE_WITH_NULLABLE_UPPER_BOUND") + override fun onSuccess(response: SUCCESS_RESPONSE?, resultReader: ResultReader?) { try { if (resultReader == null || response == null) { - //noinspection unchecked - setResult((RESULT)response); + @Suppress("UNCHECKED_CAST") + setResult(response as RESULT) } else { - setResult(methodName == null ? null : resultReader.readResult(methodName, response)); + if (methodName == null) { + setResult(null) + } + else { + setResult(resultReader.readResult(methodName, response)) + } } } - catch (Throwable e) { - CommandProcessor.LOG.error(e); - setError(e); + catch (e: Throwable) { + LOG.error(e) + setError(e) } } - @Override - public void onError(@NotNull Throwable error) { - setError(error); + override fun onError(error: Throwable) { + setError(error) } } } \ No newline at end of file diff --git a/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageManager.java b/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageManager.java index 4421b199b735..820be7cce07f 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageManager.java +++ b/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageManager.java @@ -13,121 +13,100 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jetbrains.rpc; +package org.jetbrains.rpc -import com.intellij.util.containers.ConcurrentIntObjectMap; -import com.intellij.util.containers.ContainerUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.concurrency.Promise; +import com.intellij.util.containers.ContainerUtil +import org.jetbrains.concurrency.Promise +import java.io.IOException +import java.util.* -import java.io.IOException; -import java.util.Arrays; +class MessageManager(private val handler: MessageManager.Handler) : MessageManagerBase() { + private val callbackMap = ContainerUtil.createConcurrentIntObjectMap>() -/** - * @param type of outgoing message - * @param type of incoming message - * @param type of incoming message that is a command (has sequence number) - */ -public final class MessageManager extends MessageManagerBase { - private final ConcurrentIntObjectMap> callbackMap = ContainerUtil.createConcurrentIntObjectMap(); - private final Handler handler; + interface Handler { + fun getUpdatedSequence(message: OUTGOING): Int - public MessageManager(Handler handler) { - this.handler = handler; + @Throws(IOException::class) + fun write(message: OUTGOING): Boolean + + fun readIfHasSequence(incoming: INCOMING): INCOMING_WITH_SEQ? + + fun getSequence(incomingWithSeq: INCOMING_WITH_SEQ): Int + + fun acceptNonSequence(incoming: INCOMING) + + fun call(response: INCOMING_WITH_SEQ, callback: RequestCallback) } - public interface Handler { - int getUpdatedSequence(@NotNull OUTGOING message); - - boolean write(@NotNull OUTGOING message) throws IOException; - - INCOMING_WITH_SEQ readIfHasSequence(INCOMING incoming); - - int getSequence(INCOMING_WITH_SEQ incomingWithSeq); - - void acceptNonSequence(INCOMING incoming); - - void call(INCOMING_WITH_SEQ response, RequestCallback callback); - } - - public void send(@NotNull REQUEST message, @NotNull RequestCallback callback) { + fun send(message: REQUEST, callback: RequestCallback) { if (rejectIfClosed(callback)) { - return; + return } - int sequence = handler.getUpdatedSequence(message); - callbackMap.put(sequence, callback); - - boolean success; + val sequence = handler.getUpdatedSequence(message) + callbackMap.put(sequence, callback) + + val success: Boolean try { - success = handler.write(message); + success = handler.write(message) } - catch (Throwable e) { + catch (e: Throwable) { try { - failedToSend(sequence); + failedToSend(sequence) } finally { - CommandProcessor.LOG.error("Failed to send", e); + LOG.error("Failed to send", e) } - return; + return } if (!success) { - failedToSend(sequence); + failedToSend(sequence) } } - private void failedToSend(int sequence) { - RequestCallback callback = callbackMap.remove(sequence); - if (callback != null) { - callback.onError(Promise.createError("Failed to send")); - } + private fun failedToSend(sequence: Int) { + callbackMap.remove(sequence)?.onError(Promise.createError("Failed to send")) } - public void processIncoming(INCOMING incomingParsed) { - INCOMING_WITH_SEQ commandResponse = handler.readIfHasSequence(incomingParsed); + fun processIncoming(incomingParsed: INCOMING) { + val commandResponse = handler.readIfHasSequence(incomingParsed) if (commandResponse == null) { if (closed) { // just ignore - CommandProcessor.LOG.info("Connection closed, ignore incoming"); + LOG.info("Connection closed, ignore incoming") } else { - handler.acceptNonSequence(incomingParsed); + handler.acceptNonSequence(incomingParsed) } - return; + return } - RequestCallback callback = getCallbackAndRemove(handler.getSequence(commandResponse)); + val callback = getCallbackAndRemove(handler.getSequence(commandResponse)) if (rejectIfClosed(callback)) { - return; + return } try { - handler.call(commandResponse, callback); + handler.call(commandResponse, callback) } - catch (Throwable e) { - callback.onError(e); - CommandProcessor.LOG.error("Failed to dispatch response to callback", e); + catch (e: Throwable) { + callback.onError(e) + LOG.error("Failed to dispatch response to callback", e) } } - public RequestCallback getCallbackAndRemove(int id) { - RequestCallback callback = callbackMap.remove(id); - if (callback == null) { - throw new IllegalArgumentException("Cannot find callback with id " + id); - } - return callback; - } + fun getCallbackAndRemove(id: Int) = callbackMap.remove(id) ?: throw IllegalArgumentException("Cannot find callback with id $id") - public void cancelWaitingRequests() { + fun cancelWaitingRequests() { // we should call them in the order they have been submitted - ConcurrentIntObjectMap> map = callbackMap; - int[] keys = map.keys(); - Arrays.sort(keys); - for (int key : keys) { - RequestCallback callback = map.get(key); + val map = callbackMap + val keys = map.keys() + Arrays.sort(keys) + for (key in keys) { + val callback = map.get(key) if (callback != null) { - rejectCallback(callback); + MessageManagerBase.rejectCallback(callback) } } } diff --git a/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageManagerBase.java b/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageManagerBase.java index 079aa83b4684..03c61a90f9f9 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageManagerBase.java +++ b/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageManagerBase.java @@ -1,24 +1,25 @@ -package org.jetbrains.rpc; +package org.jetbrains.rpc -import org.jetbrains.annotations.NotNull; -import org.jetbrains.concurrency.Promise; +import org.jetbrains.concurrency.Promise -public abstract class MessageManagerBase { - protected volatile boolean closed; +abstract class MessageManagerBase { + @Volatile protected var closed = false - protected final boolean rejectIfClosed(RequestCallback callback) { + protected fun rejectIfClosed(callback: RequestCallback<*>): Boolean { if (closed) { - callback.onError(Promise.createError("Connection closed")); - return true; + callback.onError(Promise.createError("Connection closed")) + return true } - return false; + return false } - public final void closed() { - closed = true; + fun closed() { + closed = true } - protected static void rejectCallback(@NotNull RequestCallback callback) { - callback.onError(Promise.createError("Connection closed")); + companion object { + protected fun rejectCallback(callback: RequestCallback<*>) { + callback.onError(Promise.createError("Connection closed")) + } } } \ No newline at end of file diff --git a/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageProcessor.java b/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageProcessor.java index 719d8b033040..7c5523090ab2 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageProcessor.java +++ b/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageProcessor.java @@ -1,14 +1,12 @@ -package org.jetbrains.rpc; +package org.jetbrains.rpc -import org.jetbrains.annotations.NotNull; -import org.jetbrains.concurrency.Promise; -import org.jetbrains.jsonProtocol.Request; +import org.jetbrains.concurrency.Promise +import org.jetbrains.jsonProtocol.Request -public interface MessageProcessor { - void cancelWaitingRequests(); +interface MessageProcessor { + fun cancelWaitingRequests() - void closed(); + fun closed() - @NotNull - Promise send(@NotNull Request message); + fun send(message: Request): Promise } \ No newline at end of file diff --git a/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageWriter.java b/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageWriter.java index 07dbee19f922..690f8cf9f3c2 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageWriter.java +++ b/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageWriter.java @@ -1,26 +1,21 @@ -package org.jetbrains.rpc; +package org.jetbrains.rpc -import com.intellij.openapi.vfs.CharsetToolkit; -import com.intellij.util.BooleanFunction; -import io.netty.buffer.ByteBuf; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jsonProtocol.Request; +import com.intellij.openapi.vfs.CharsetToolkit +import com.intellij.util.BooleanFunction +import io.netty.buffer.ByteBuf +import org.jetbrains.jsonProtocol.Request -import static org.jetbrains.rpc.CommandProcessor.LOG; - -public abstract class MessageWriter implements BooleanFunction { - @Override - public boolean fun(@NotNull Request message) { - ByteBuf content = message.getBuffer(); - if (isDebugLoggingEnabled()) { - LOG.debug("OUT: " + content.toString(CharsetToolkit.UTF8_CHARSET)); +abstract class MessageWriter : BooleanFunction> { + override fun `fun`(message: Request): Boolean { + val content = message.buffer + if (isDebugLoggingEnabled) { + LOG.debug("OUT: ${content.toString(CharsetToolkit.UTF8_CHARSET)}") } - return write(content); + return write(content) } - protected boolean isDebugLoggingEnabled() { - return LOG.isDebugEnabled(); - } + protected open val isDebugLoggingEnabled: Boolean + get() = LOG.isDebugEnabled - protected abstract boolean write(@NotNull ByteBuf content); + protected abstract fun write(content: ByteBuf): Boolean } \ No newline at end of file diff --git a/platform/script-debugger/backend/src/org/jetbrains/rpc/RequestCallback.java b/platform/script-debugger/backend/src/org/jetbrains/rpc/RequestCallback.java index 409cff797923..530aa7c586d2 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/rpc/RequestCallback.java +++ b/platform/script-debugger/backend/src/org/jetbrains/rpc/RequestCallback.java @@ -1,10 +1,8 @@ -package org.jetbrains.rpc; +package org.jetbrains.rpc -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +@Suppress("BASE_WITH_NULLABLE_UPPER_BOUND") +interface RequestCallback { + fun onSuccess(response: SUCCESS_RESPONSE?, resultReader: ResultReader?) -public interface RequestCallback { - void onSuccess(@Nullable SUCCESS_RESPONSE successResponse, @Nullable ResultReader resultReader); - - void onError(@NotNull Throwable error); + fun onError(error: Throwable) } \ No newline at end of file diff --git a/platform/script-debugger/backend/src/org/jetbrains/rpc/ResultReader.java b/platform/script-debugger/backend/src/org/jetbrains/rpc/ResultReader.java index 4bb055c754d2..5aeb94e0c369 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/rpc/ResultReader.java +++ b/platform/script-debugger/backend/src/org/jetbrains/rpc/ResultReader.java @@ -1,7 +1,5 @@ -package org.jetbrains.rpc; +package org.jetbrains.rpc -import org.jetbrains.annotations.NotNull; - -public interface ResultReader { - RESULT readResult(@NotNull String readMethodName, @NotNull RESPONSE successResponse); +interface ResultReader { + fun readResult(readMethodName: String, successResponse: RESPONSE): RESULT } \ No newline at end of file diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ValueNodeAsyncFunction.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ValueNodeAsyncFunction.java index 15d685b492f9..e9340f483d94 100644 --- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ValueNodeAsyncFunction.java +++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ValueNodeAsyncFunction.java @@ -13,21 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jetbrains.debugger; +package org.jetbrains.debugger -import org.jetbrains.annotations.NotNull; -import org.jetbrains.concurrency.AsyncFunction; -import org.jetbrains.concurrency.Obsolescent; +import org.jetbrains.concurrency.AsyncFunction +import org.jetbrains.concurrency.Obsolescent +import org.jetbrains.concurrency.Promise -public abstract class ValueNodeAsyncFunction implements AsyncFunction, Obsolescent { - private final Obsolescent node; - - protected ValueNodeAsyncFunction(@NotNull Obsolescent node) { - this.node = node; - } - - @Override - public final boolean isObsolete() { - return node.isObsolete(); - } +abstract class ValueNodeAsyncFunction protected constructor(private val node: Obsolescent) : AsyncFunction, Obsolescent { + override fun isObsolete() = node.isObsolete } + +inline fun Promise.thenAsync(node: Obsolescent, crossinline handler: (T) -> Promise) = then(object : ValueNodeAsyncFunction(node) { + override fun `fun`(param: T) = handler(param) +}) + +@Suppress("UNCHECKED_CAST") +inline fun Promise.thenAsyncVoid(node: Obsolescent, crossinline handler: (T) -> Promise<*>) = then(object : ValueNodeAsyncFunction(node) { + override fun `fun`(param: T) = handler(param) as Promise +}) \ No newline at end of file From 6d312f96d3d9625fb086f8478423b113c1101520 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Thu, 15 Oct 2015 15:10:17 +0200 Subject: [PATCH 22/80] convert ObjectValue, MessageManager, Value, CommandProcessor, ValueModifier, MessageWriter, ArrayValue, ValueBase, CommandSenderBase, ResultReader, MessageProcessor, ObjectValueBase, ValueNodeAsyncFunction, RequestCallback, MessageManagerBase to kotlin --- .../jetbrains/debugger/{ValueModifier.java => ValueModifier.kt} | 0 .../jetbrains/debugger/values/{ArrayValue.java => ArrayValue.kt} | 0 .../debugger/values/{ObjectValue.java => ObjectValue.kt} | 0 .../debugger/values/{ObjectValueBase.java => ObjectValueBase.kt} | 0 .../src/org/jetbrains/debugger/values/{Value.java => Value.kt} | 0 .../jetbrains/debugger/values/{ValueBase.java => ValueBase.kt} | 0 .../jetbrains/rpc/{CommandProcessor.java => CommandProcessor.kt} | 0 .../rpc/{CommandSenderBase.java => CommandSenderBase.kt} | 0 .../org/jetbrains/rpc/{MessageManager.java => MessageManager.kt} | 0 .../rpc/{MessageManagerBase.java => MessageManagerBase.kt} | 0 .../jetbrains/rpc/{MessageProcessor.java => MessageProcessor.kt} | 0 .../org/jetbrains/rpc/{MessageWriter.java => MessageWriter.kt} | 0 .../jetbrains/rpc/{RequestCallback.java => RequestCallback.kt} | 0 .../src/org/jetbrains/rpc/{ResultReader.java => ResultReader.kt} | 0 .../{ValueNodeAsyncFunction.java => ValueNodeAsyncFunction.kt} | 0 15 files changed, 0 insertions(+), 0 deletions(-) rename platform/script-debugger/backend/src/org/jetbrains/debugger/{ValueModifier.java => ValueModifier.kt} (100%) rename platform/script-debugger/backend/src/org/jetbrains/debugger/values/{ArrayValue.java => ArrayValue.kt} (100%) rename platform/script-debugger/backend/src/org/jetbrains/debugger/values/{ObjectValue.java => ObjectValue.kt} (100%) rename platform/script-debugger/backend/src/org/jetbrains/debugger/values/{ObjectValueBase.java => ObjectValueBase.kt} (100%) rename platform/script-debugger/backend/src/org/jetbrains/debugger/values/{Value.java => Value.kt} (100%) rename platform/script-debugger/backend/src/org/jetbrains/debugger/values/{ValueBase.java => ValueBase.kt} (100%) rename platform/script-debugger/backend/src/org/jetbrains/rpc/{CommandProcessor.java => CommandProcessor.kt} (100%) rename platform/script-debugger/backend/src/org/jetbrains/rpc/{CommandSenderBase.java => CommandSenderBase.kt} (100%) rename platform/script-debugger/backend/src/org/jetbrains/rpc/{MessageManager.java => MessageManager.kt} (100%) rename platform/script-debugger/backend/src/org/jetbrains/rpc/{MessageManagerBase.java => MessageManagerBase.kt} (100%) rename platform/script-debugger/backend/src/org/jetbrains/rpc/{MessageProcessor.java => MessageProcessor.kt} (100%) rename platform/script-debugger/backend/src/org/jetbrains/rpc/{MessageWriter.java => MessageWriter.kt} (100%) rename platform/script-debugger/backend/src/org/jetbrains/rpc/{RequestCallback.java => RequestCallback.kt} (100%) rename platform/script-debugger/backend/src/org/jetbrains/rpc/{ResultReader.java => ResultReader.kt} (100%) rename platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/{ValueNodeAsyncFunction.java => ValueNodeAsyncFunction.kt} (100%) diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/ValueModifier.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/ValueModifier.kt similarity index 100% rename from platform/script-debugger/backend/src/org/jetbrains/debugger/ValueModifier.java rename to platform/script-debugger/backend/src/org/jetbrains/debugger/ValueModifier.kt diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ArrayValue.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ArrayValue.kt similarity index 100% rename from platform/script-debugger/backend/src/org/jetbrains/debugger/values/ArrayValue.java rename to platform/script-debugger/backend/src/org/jetbrains/debugger/values/ArrayValue.kt diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ObjectValue.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ObjectValue.kt similarity index 100% rename from platform/script-debugger/backend/src/org/jetbrains/debugger/values/ObjectValue.java rename to platform/script-debugger/backend/src/org/jetbrains/debugger/values/ObjectValue.kt diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ObjectValueBase.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ObjectValueBase.kt similarity index 100% rename from platform/script-debugger/backend/src/org/jetbrains/debugger/values/ObjectValueBase.java rename to platform/script-debugger/backend/src/org/jetbrains/debugger/values/ObjectValueBase.kt diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/values/Value.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/values/Value.kt similarity index 100% rename from platform/script-debugger/backend/src/org/jetbrains/debugger/values/Value.java rename to platform/script-debugger/backend/src/org/jetbrains/debugger/values/Value.kt diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ValueBase.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/values/ValueBase.kt similarity index 100% rename from platform/script-debugger/backend/src/org/jetbrains/debugger/values/ValueBase.java rename to platform/script-debugger/backend/src/org/jetbrains/debugger/values/ValueBase.kt diff --git a/platform/script-debugger/backend/src/org/jetbrains/rpc/CommandProcessor.java b/platform/script-debugger/backend/src/org/jetbrains/rpc/CommandProcessor.kt similarity index 100% rename from platform/script-debugger/backend/src/org/jetbrains/rpc/CommandProcessor.java rename to platform/script-debugger/backend/src/org/jetbrains/rpc/CommandProcessor.kt diff --git a/platform/script-debugger/backend/src/org/jetbrains/rpc/CommandSenderBase.java b/platform/script-debugger/backend/src/org/jetbrains/rpc/CommandSenderBase.kt similarity index 100% rename from platform/script-debugger/backend/src/org/jetbrains/rpc/CommandSenderBase.java rename to platform/script-debugger/backend/src/org/jetbrains/rpc/CommandSenderBase.kt diff --git a/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageManager.java b/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageManager.kt similarity index 100% rename from platform/script-debugger/backend/src/org/jetbrains/rpc/MessageManager.java rename to platform/script-debugger/backend/src/org/jetbrains/rpc/MessageManager.kt diff --git a/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageManagerBase.java b/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageManagerBase.kt similarity index 100% rename from platform/script-debugger/backend/src/org/jetbrains/rpc/MessageManagerBase.java rename to platform/script-debugger/backend/src/org/jetbrains/rpc/MessageManagerBase.kt diff --git a/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageProcessor.java b/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageProcessor.kt similarity index 100% rename from platform/script-debugger/backend/src/org/jetbrains/rpc/MessageProcessor.java rename to platform/script-debugger/backend/src/org/jetbrains/rpc/MessageProcessor.kt diff --git a/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageWriter.java b/platform/script-debugger/backend/src/org/jetbrains/rpc/MessageWriter.kt similarity index 100% rename from platform/script-debugger/backend/src/org/jetbrains/rpc/MessageWriter.java rename to platform/script-debugger/backend/src/org/jetbrains/rpc/MessageWriter.kt diff --git a/platform/script-debugger/backend/src/org/jetbrains/rpc/RequestCallback.java b/platform/script-debugger/backend/src/org/jetbrains/rpc/RequestCallback.kt similarity index 100% rename from platform/script-debugger/backend/src/org/jetbrains/rpc/RequestCallback.java rename to platform/script-debugger/backend/src/org/jetbrains/rpc/RequestCallback.kt diff --git a/platform/script-debugger/backend/src/org/jetbrains/rpc/ResultReader.java b/platform/script-debugger/backend/src/org/jetbrains/rpc/ResultReader.kt similarity index 100% rename from platform/script-debugger/backend/src/org/jetbrains/rpc/ResultReader.java rename to platform/script-debugger/backend/src/org/jetbrains/rpc/ResultReader.kt diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ValueNodeAsyncFunction.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ValueNodeAsyncFunction.kt similarity index 100% rename from platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ValueNodeAsyncFunction.java rename to platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ValueNodeAsyncFunction.kt From 841d1d00a2644f960a06a0710c4f6fbef40b3494 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Thu, 15 Oct 2015 15:11:41 +0200 Subject: [PATCH 23/80] [js-debugger] cleanup after convert to kotlin --- .../jetbrains/io/fastCgi/FastCgiService.kt | 7 +- .../org/jetbrains/concurrency/Promise.java | 2 +- .../src/org/jetbrains/concurrency/promise.kt | 35 ++++++ .../org/jetbrains/util/concurrency/Promise.kt | 8 +- .../util/concurrency/RejectedPromise.kt | 2 +- .../jetbrains/debugger/StandaloneVmHelper.kt | 13 +-- .../src/org/jetbrains/rpc/CommandSender.java | 10 -- .../src/org/jetbrains/rpc/ErrorConsumer.java | 8 -- .../javascript/debugger/NameMapper.kt | 2 +- .../jetbrains/debugger/DebugProcessImpl.kt | 8 +- .../jetbrains/debugger/DebuggerViewSupport.kt | 2 +- .../debugger/FunctionScopesValueGroup.kt | 13 +-- .../debugger/ProcessHandlerWrapper.kt | 4 +- .../debugger/RejectErrorReporter.java | 4 +- .../jetbrains/debugger/ScopeVariablesGroup.kt | 25 ++--- .../org/jetbrains/debugger/VariableView.kt | 104 +++++++----------- .../src/org/jetbrains/debugger/Variables.kt | 67 ++++++----- .../debugger/connection/RemoteVmConnection.kt | 4 +- .../script-debugger/debugger-ui/src/util.kt | 4 +- 19 files changed, 151 insertions(+), 171 deletions(-) create mode 100644 platform/platform-impl/src/org/jetbrains/concurrency/promise.kt delete mode 100644 platform/script-debugger/backend/src/org/jetbrains/rpc/CommandSender.java delete mode 100644 platform/script-debugger/backend/src/org/jetbrains/rpc/ErrorConsumer.java diff --git a/platform/built-in-server/src/org/jetbrains/io/fastCgi/FastCgiService.kt b/platform/built-in-server/src/org/jetbrains/io/fastCgi/FastCgiService.kt index e7d54e0210f7..63989e44549f 100644 --- a/platform/built-in-server/src/org/jetbrains/io/fastCgi/FastCgiService.kt +++ b/platform/built-in-server/src/org/jetbrains/io/fastCgi/FastCgiService.kt @@ -15,7 +15,6 @@ */ package org.jetbrains.io.fastCgi -import com.intellij.execution.process.OSProcessHandler import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.project.Project import com.intellij.util.Consumer @@ -144,11 +143,7 @@ public abstract class FastCgiService(project: Project) : SingleConnectionNetServ } else { processHandler.get() - .done(object : Consumer { - override fun consume(osProcessHandler: OSProcessHandler) { - fastCgiRequest.writeToServerChannel(notEmptyContent, processChannel!!) - } - }) + .done { fastCgiRequest.writeToServerChannel(notEmptyContent, processChannel!!) } .rejected { Promise.logError(LOG, it) handleError(fastCgiRequest, notEmptyContent) diff --git a/platform/core-api/src/org/jetbrains/concurrency/Promise.java b/platform/core-api/src/org/jetbrains/concurrency/Promise.java index 2ce7c001d1d1..2d578c354523 100644 --- a/platform/core-api/src/org/jetbrains/concurrency/Promise.java +++ b/platform/core-api/src/org/jetbrains/concurrency/Promise.java @@ -67,7 +67,7 @@ public abstract class Promise { } @NotNull - public static Promise all(@NotNull Collection> promises) { + public static Promise all(@NotNull Collection> promises) { return all(promises, null); } diff --git a/platform/platform-impl/src/org/jetbrains/concurrency/promise.kt b/platform/platform-impl/src/org/jetbrains/concurrency/promise.kt new file mode 100644 index 000000000000..4264de0597b7 --- /dev/null +++ b/platform/platform-impl/src/org/jetbrains/concurrency/promise.kt @@ -0,0 +1,35 @@ +/* + * Copyright 2000-2015 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.concurrency + +import com.intellij.util.Function + +inline fun Promise.then(crossinline handler: (T) -> SUB_RESULT) = then(object : Function { + override fun `fun`(param: T) = handler(param) +}) + +inline fun Promise.thenAsync(crossinline handler: (T) -> Promise) = then(object : AsyncFunction { + override fun `fun`(param: T) = handler(param) +}) + +inline fun Promise.thenAsyncVoid(crossinline handler: (T) -> Promise<*>) = then(object : AsyncFunction { + override fun `fun`(param: T): Promise { + @Suppress("UNCHECKED_CAST") + return handler(param) as Promise + } +}) + +fun ResolvedPromise(): Promise<*> = Promise.DONE \ No newline at end of file diff --git a/platform/platform-impl/src/org/jetbrains/util/concurrency/Promise.kt b/platform/platform-impl/src/org/jetbrains/util/concurrency/Promise.kt index d5371c3e0e35..448fd53a347c 100644 --- a/platform/platform-impl/src/org/jetbrains/util/concurrency/Promise.kt +++ b/platform/platform-impl/src/org/jetbrains/util/concurrency/Promise.kt @@ -17,8 +17,8 @@ package org.jetbrains.util.concurrency import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.diagnostic.Logger -import org.jetbrains.concurrency.Promise as OJCPromise import org.jetbrains.concurrency.AsyncPromise as OJCAsyncPromise +import org.jetbrains.concurrency.Promise as OJCPromise interface Promise { enum class State { @@ -33,7 +33,7 @@ interface Promise { fun rejected(rejected: (Throwable) -> Unit): Promise - fun processed(processed: (T?) -> Unit): Promise + fun processed(@Suppress("BASE_WITH_NULLABLE_UPPER_BOUND") processed: (T?) -> Unit): Promise fun then(done: (T) -> SUB_RESULT): Promise @@ -93,8 +93,8 @@ fun ResolvedPromise(result: T): Promise = DonePromise(result) fun OJCPromise.toPromise(): AsyncPromise { val promise = AsyncPromise() val oldPromise = this - done({ promise.setResult(it) }) - .rejected({ promise.setError(it) }) + done { promise.setResult(it) } + .rejected { promise.setError(it) } if (oldPromise is OJCAsyncPromise) { promise diff --git a/platform/platform-impl/src/org/jetbrains/util/concurrency/RejectedPromise.kt b/platform/platform-impl/src/org/jetbrains/util/concurrency/RejectedPromise.kt index 08b523a31adf..6c2c6a85eb2c 100644 --- a/platform/platform-impl/src/org/jetbrains/util/concurrency/RejectedPromise.kt +++ b/platform/platform-impl/src/org/jetbrains/util/concurrency/RejectedPromise.kt @@ -15,7 +15,7 @@ */ package org.jetbrains.util.concurrency -class RejectedPromise(private val error: Throwable) : Promise { +internal class RejectedPromise(private val error: Throwable) : Promise { override public val state: Promise.State get() = Promise.State.REJECTED diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/StandaloneVmHelper.kt b/platform/script-debugger/backend/src/org/jetbrains/debugger/StandaloneVmHelper.kt index 67c3045af634..8ca522934fa3 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/debugger/StandaloneVmHelper.kt +++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/StandaloneVmHelper.kt @@ -30,7 +30,7 @@ import org.jetbrains.util.concurrency.catchError import java.util.concurrent.TimeUnit import org.jetbrains.concurrency.Promise as OJCPromise -public open class StandaloneVmHelper(private val vm: Vm, private val messageProcessor: MessageProcessor) : MessageWriter(), AttachStateManager { +open class StandaloneVmHelper(private val vm: Vm, private val messageProcessor: MessageProcessor) : MessageWriter(), AttachStateManager { private @Volatile var channel: Channel? = null override fun write(content: ByteBuf) = write((content as Any)) @@ -40,16 +40,16 @@ public open class StandaloneVmHelper(private val vm: Vm, private val messageProc return if (currentChannel == null || !currentChannel.isActive) null else currentChannel } - public fun write(content: Any): Boolean { + fun write(content: Any): Boolean { val channel = getChannelIfActive() return channel != null && !channel.writeAndFlush(content).isCancelled } - public interface VmEx : Vm { - public fun createDisconnectRequest(): Request? + interface VmEx : Vm { + fun createDisconnectRequest(): Request? } - public fun setChannel(channel: Channel) { + fun setChannel(channel: Channel) { this.channel = channel channel.closeFuture().addListener(MyChannelFutureListener()) } @@ -82,8 +82,7 @@ public open class StandaloneVmHelper(private val vm: Vm, private val messageProc messageProcessor.closed() channel = null - @Suppress("USELESS_CAST") - val p = messageProcessor.send(disconnectRequest) as OJCPromise<*> + val p = messageProcessor.send(disconnectRequest) p.processed { promise.catchError { messageProcessor.cancelWaitingRequests() diff --git a/platform/script-debugger/backend/src/org/jetbrains/rpc/CommandSender.java b/platform/script-debugger/backend/src/org/jetbrains/rpc/CommandSender.java deleted file mode 100644 index 87618be3bb93..000000000000 --- a/platform/script-debugger/backend/src/org/jetbrains/rpc/CommandSender.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.jetbrains.rpc; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.concurrency.Promise; -import org.jetbrains.jsonProtocol.Request; - -public interface CommandSender { - @NotNull - Promise send(@NotNull Request message); -} \ No newline at end of file diff --git a/platform/script-debugger/backend/src/org/jetbrains/rpc/ErrorConsumer.java b/platform/script-debugger/backend/src/org/jetbrains/rpc/ErrorConsumer.java deleted file mode 100644 index d081df871648..000000000000 --- a/platform/script-debugger/backend/src/org/jetbrains/rpc/ErrorConsumer.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.jetbrains.rpc; - -import com.intellij.openapi.util.ActionCallback; -import org.jetbrains.annotations.Nullable; - -public interface ErrorConsumer { - void consume(String errorMessage, @Nullable ERROR_DETAILS errorDetails, C callback); -} \ No newline at end of file diff --git a/platform/script-debugger/debugger-ui/src/com/jetbrains/javascript/debugger/NameMapper.kt b/platform/script-debugger/debugger-ui/src/com/jetbrains/javascript/debugger/NameMapper.kt index 6e8a7bbe9b9e..b809849996d1 100644 --- a/platform/script-debugger/debugger-ui/src/com/jetbrains/javascript/debugger/NameMapper.kt +++ b/platform/script-debugger/debugger-ui/src/com/jetbrains/javascript/debugger/NameMapper.kt @@ -24,8 +24,8 @@ import gnu.trove.THashMap import org.jetbrains.debugger.sourcemap.MappingEntry import org.jetbrains.debugger.sourcemap.MappingList import org.jetbrains.debugger.sourcemap.SourceMap +import org.jetbrains.rpc.LOG -import org.jetbrains.rpc.CommandProcessor.LOG private val S1 = ",()[]{}=" // don't trim trailing .&: - could be part of expression diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebugProcessImpl.kt b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebugProcessImpl.kt index ad3c7b908927..2f46bc4dd59c 100644 --- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebugProcessImpl.kt +++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebugProcessImpl.kt @@ -38,10 +38,10 @@ import java.util.concurrent.ConcurrentMap import java.util.concurrent.atomic.AtomicBoolean public abstract class DebugProcessImpl>(session: XDebugSession, - public val connection: C, - private val editorsProvider: XDebuggerEditorsProvider, - private val smartStepIntoHandler: XSmartStepIntoHandler<*>?, - protected val executionResult: ExecutionResult?) : XDebugProcess(session) { + public val connection: C, + private val editorsProvider: XDebuggerEditorsProvider, + private val smartStepIntoHandler: XSmartStepIntoHandler<*>?, + protected val executionResult: ExecutionResult?) : XDebugProcess(session) { protected val repeatStepInto: AtomicBoolean = AtomicBoolean() @Volatile protected var lastStep: StepAction? = null @Volatile protected var lastCallFrame: CallFrame? = null diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebuggerViewSupport.kt b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebuggerViewSupport.kt index cbaaf1d1d65c..26c9b2084874 100644 --- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebuggerViewSupport.kt +++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebuggerViewSupport.kt @@ -56,7 +56,7 @@ interface DebuggerViewSupport { fun computeInlineDebuggerData(name: String, variable: Variable, context: VariableContext, callback: XInlineDebuggerDataCallback) = ThreeState.UNSURE // return null if you don't need to add additional properties - fun computeAdditionalObjectProperties(value: ObjectValue, variable: Variable, context: VariableContext, node: XCompositeNode): Promise? = null + fun computeAdditionalObjectProperties(value: ObjectValue, variable: Variable, context: VariableContext, node: XCompositeNode): Promise<*>? = null fun getMemberFilter(context: VariableContext): Promise diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/FunctionScopesValueGroup.kt b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/FunctionScopesValueGroup.kt index 6f8ad5dc5bb3..35524b875c28 100644 --- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/FunctionScopesValueGroup.kt +++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/FunctionScopesValueGroup.kt @@ -15,13 +15,12 @@ */ package org.jetbrains.debugger -import com.intellij.util.Consumer import com.intellij.xdebugger.frame.XCompositeNode import com.intellij.xdebugger.frame.XValueChildrenList import com.intellij.xdebugger.frame.XValueGroup import org.jetbrains.concurrency.Promise import org.jetbrains.debugger.values.FunctionValue -import org.jetbrains.rpc.CommandProcessor +import org.jetbrains.rpc.LOG import java.util.* internal class FunctionScopesValueGroup(private val value: FunctionValue, private val variableContext: VariableContext) : XValueGroup("Function scopes") { @@ -40,11 +39,9 @@ internal class FunctionScopesValueGroup(private val value: FunctionValue, privat } } }) - .rejected(object : Consumer { - override fun consume(error: Throwable) { - Promise.logError(CommandProcessor.LOG, error) - node.setErrorMessage(error.getMessage()!!) - } - }) + .rejected { + Promise.logError(LOG, it) + node.setErrorMessage(it.getMessage()!!) + } } } \ No newline at end of file diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ProcessHandlerWrapper.kt b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ProcessHandlerWrapper.kt index 6050748bbd38..b58bab56102a 100644 --- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ProcessHandlerWrapper.kt +++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ProcessHandlerWrapper.kt @@ -19,10 +19,8 @@ import com.intellij.execution.KillableProcess import com.intellij.execution.process.ProcessAdapter import com.intellij.execution.process.ProcessEvent import com.intellij.execution.process.ProcessHandler -import com.intellij.openapi.diagnostic.Logger import com.intellij.xdebugger.XDebugProcess - -private val LOG: Logger = Logger.getInstance(ProcessHandlerWrapper::class.java) +import org.jetbrains.rpc.LOG class ProcessHandlerWrapper(private val debugProcess: XDebugProcess, private val handler: ProcessHandler) : ProcessHandler(), KillableProcess { init { diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/RejectErrorReporter.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/RejectErrorReporter.java index 85da0944f378..337ec586106e 100644 --- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/RejectErrorReporter.java +++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/RejectErrorReporter.java @@ -21,7 +21,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.concurrency.AsyncPromise; import org.jetbrains.concurrency.Promise; -import org.jetbrains.rpc.CommandProcessor; +import org.jetbrains.rpc.CommandProcessorKt; public final class RejectErrorReporter implements Consumer { private final XDebugSession session; @@ -38,7 +38,7 @@ public final class RejectErrorReporter implements Consumer { @Override public void consume(Throwable error) { - Promise.logError(CommandProcessor.LOG, error); + Promise.logError(CommandProcessorKt.getLOG(), error); if (error != AsyncPromise.OBSOLETE_ERROR) { session.reportError((description == null ? "" : description + ": ") + error.getMessage()); } diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ScopeVariablesGroup.kt b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ScopeVariablesGroup.kt index 38be77f26bea..0e711016c1c4 100644 --- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ScopeVariablesGroup.kt +++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/ScopeVariablesGroup.kt @@ -38,19 +38,18 @@ class ScopeVariablesGroup(val scope: Scope, parentContext: VariableContext, call return } - promise.done(object : ObsolescentConsumer(node) { - override fun consume(ignored: Void) { - callFrame.receiverVariable.done(object : ObsolescentConsumer(node) { - override fun consume(variable: Variable?) { - node.addChildren(if (variable == null) XValueChildrenList.EMPTY else XValueChildrenList.singleton(VariableView(variable, context)), true) - } - }).rejected(object : ObsolescentConsumer(node) { - override fun consume(error: Throwable?) { - node.addChildren(XValueChildrenList.EMPTY, true) - } - }) - } - }) + promise + .done(object : ObsolescentConsumer(node) { + override fun consume(ignored: Any?) { + callFrame.receiverVariable + .done(object : ObsolescentConsumer(node) { + override fun consume(variable: Variable?) = node.addChildren(if (variable == null) XValueChildrenList.EMPTY else XValueChildrenList.singleton(VariableView(variable, context)), true) + }) + .rejected(object : ObsolescentConsumer(node) { + override fun consume(error: Throwable?) = node.addChildren(XValueChildrenList.EMPTY, true) + }) + } + }) } } diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/VariableView.kt b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/VariableView.kt index 8e2e8d0b38a2..e0501853e2a9 100644 --- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/VariableView.kt +++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/VariableView.kt @@ -31,7 +31,6 @@ import com.intellij.xdebugger.frame.presentation.XKeywordValuePresentation import com.intellij.xdebugger.frame.presentation.XNumericValuePresentation import com.intellij.xdebugger.frame.presentation.XStringValuePresentation import com.intellij.xdebugger.frame.presentation.XValuePresentation -import org.jetbrains.concurrency.ObsolescentAsyncFunction import org.jetbrains.concurrency.Promise import org.jetbrains.debugger.values.* import java.util.* @@ -116,7 +115,6 @@ class VariableView(name: String, private val variable: Variable, private val con } private fun computePresentation(value: Value, node: XValueNode) { - val valueString = value.valueString when (value.type) { ValueType.OBJECT, ValueType.NODE -> context.viewSupport.computeObjectPresentation((value as ObjectValue), variable, context, node, icon) @@ -124,20 +122,20 @@ class VariableView(name: String, private val variable: Variable, private val con ValueType.ARRAY -> context.viewSupport.computeArrayPresentation(value, variable, context, node, icon) - ValueType.BOOLEAN, ValueType.NULL, ValueType.UNDEFINED -> node.setPresentation(icon, XKeywordValuePresentation(valueString), false) + ValueType.BOOLEAN, ValueType.NULL, ValueType.UNDEFINED -> node.setPresentation(icon, XKeywordValuePresentation(value.valueString!!), false) - ValueType.NUMBER -> node.setPresentation(icon, createNumberPresentation(valueString), false) + ValueType.NUMBER -> node.setPresentation(icon, createNumberPresentation(value.valueString!!), false) ValueType.STRING -> { - node.setPresentation(icon, XStringValuePresentation(valueString), false) + node.setPresentation(icon, XStringValuePresentation(value.valueString!!), false) // isTruncated in terms of debugger backend, not in our terms (i.e. sometimes we cannot control truncation), // so, even in case of StringValue, we check value string length - if ((value is StringValue && value.isTruncated) || valueString.length() > XValueNode.MAX_VALUE_LENGTH) { + if ((value is StringValue && value.isTruncated) || value.valueString!!.length() > XValueNode.MAX_VALUE_LENGTH) { node.setFullValueEvaluator(MyFullValueEvaluator(value)) } } - else -> node.setPresentation(icon, null, valueString, true) + else -> node.setPresentation(icon, null, value.valueString!!, true) } } @@ -181,32 +179,19 @@ class VariableView(name: String, private val variable: Variable, private val con promises.add(computeNamedProperties(objectValue, node, !hasIndexedProperties && additionalProperties == null)) } else { - promises.add(additionalProperties.then(object : ObsolescentAsyncFunction { - override fun isObsolete(): Boolean { - return node.isObsolete - } - - override fun `fun`(o: Void): Promise { - return computeNamedProperties(objectValue, node, true) - } - })) + promises.add(additionalProperties.thenAsync(node) { computeNamedProperties(objectValue, node, true) }) } } if (hasIndexedProperties == hasNamedProperties || additionalProperties != null) { - Promise.all(promises).processed(object : ObsolescentConsumer(node) { - override fun consume(aVoid: Void) { - node.addChildren(XValueChildrenList.EMPTY, true) - } + Promise.all(promises).processed(object : ObsolescentConsumer(node) { + override fun consume(aVoid: Any?) = node.addChildren(XValueChildrenList.EMPTY, true) }) } } - abstract class ObsolescentIndexedVariablesConsumer protected constructor(protected val node: XCompositeNode) : IndexedVariablesConsumer() { - - override fun isObsolete(): Boolean { - return node.isObsolete - } + abstract class ObsolescentIndexedVariablesConsumer(protected val node: XCompositeNode) : IndexedVariablesConsumer() { + override fun isObsolete() = node.isObsolete } private fun computeIndexedProperties(value: ArrayValue, node: XCompositeNode, isLastChildren: Boolean): Promise<*> { @@ -228,29 +213,27 @@ class VariableView(name: String, private val variable: Variable, private val con }, null) } - private fun computeNamedProperties(value: ObjectValue, node: XCompositeNode, isLastChildren: Boolean): Promise { - return processVariables(this, value.properties, node) { memberFilter, variables -> - this@VariableView.memberFilter = memberFilter + private fun computeNamedProperties(value: ObjectValue, node: XCompositeNode, isLastChildren: Boolean) = processVariables(this, value.properties, node) { memberFilter, variables -> + this@VariableView.memberFilter = memberFilter - if (value.type == ValueType.ARRAY && value !is ArrayValue) { - computeArrayRanges(variables, node) - return@processVariables - } + if (value.type == ValueType.ARRAY && value !is ArrayValue) { + computeArrayRanges(variables, node) + return@processVariables + } - var functionValue = value as? FunctionValue - if (functionValue != null && functionValue.hasScopes() == ThreeState.NO) { - functionValue = null - } + var functionValue = value as? FunctionValue + if (functionValue != null && functionValue.hasScopes() == ThreeState.NO) { + functionValue = null + } - remainingChildren = processNamedObjectProperties(variables, node, this@VariableView, memberFilter, XCompositeNode.MAX_CHILDREN_TO_SHOW, isLastChildren && functionValue == null) - if (remainingChildren != null) { - remainingChildrenOffset = XCompositeNode.MAX_CHILDREN_TO_SHOW - } + remainingChildren = processNamedObjectProperties(variables, node, this@VariableView, memberFilter, XCompositeNode.MAX_CHILDREN_TO_SHOW, isLastChildren && functionValue == null) + if (remainingChildren != null) { + remainingChildrenOffset = XCompositeNode.MAX_CHILDREN_TO_SHOW + } - if (functionValue != null) { - // we pass context as variable context instead of this variable value - we cannot watch function scopes variables, so, this variable name doesn't matter - node.addChildren(XValueChildrenList.bottomGroup(FunctionScopesValueGroup(functionValue, context)), isLastChildren) - } + if (functionValue != null) { + // we pass context as variable context instead of this variable value - we cannot watch function scopes variables, so, this variable name doesn't matter + node.addChildren(XValueChildrenList.bottomGroup(FunctionScopesValueGroup(functionValue, context)), isLastChildren) } } @@ -312,7 +295,7 @@ class VariableView(name: String, private val variable: Variable, private val con return object : XValueModifier() { override fun getInitialValueEditorText(): String? { if (value!!.type == ValueType.STRING) { - val string = value!!.valueString + val string = value!!.valueString!! val builder = StringBuilder(string.length()) builder.append('"') StringUtil.escapeStringCharacters(string.length(), string, builder) @@ -325,10 +308,7 @@ class VariableView(name: String, private val variable: Variable, private val con } override fun setValue(expression: String, callback: XValueModifier.XModificationCallback) { - val valueModifier = variable.valueModifier - assert(valueModifier != null) - //noinspection unchecked - valueModifier!!.setValue(variable, expression, evaluateContext) + variable.valueModifier!!.setValue(variable, expression, evaluateContext) .done(Consumer { value = null callback.valueModified() @@ -346,11 +326,11 @@ class VariableView(name: String, private val variable: Variable, private val con override fun computeSourcePosition(navigatable: XNavigatable) { if (value is FunctionValue) { - (value as FunctionValue).resolve().done(object : Consumer { - override fun consume(function: FunctionValue) { - viewSupport.vm!!.scriptManager.getScript(function).done(object : Consumer