diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/ViewTextAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/ViewTextAction.java index 22573df059af..922c96a88b3e 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/ViewTextAction.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/ViewTextAction.java @@ -50,6 +50,7 @@ public class ViewTextAction extends XFetchValueActionBase { @NotNull @Override protected ValueCollector createCollector(@NotNull AnActionEvent e) { + XValueNodeImpl node = getStringNode(e); return new ValueCollector(XDebuggerTree.getTree(e.getDataContext())) { MyDialog dialog = null; @@ -57,7 +58,6 @@ public class ViewTextAction extends XFetchValueActionBase { public void handleInCollector(Project project, String value, XDebuggerTree tree) { String text = StringUtil.unquoteString(value); if (dialog == null) { - XValueNodeImpl node = getStringNode(e); dialog = new MyDialog(project, text, node); dialog.setTitle(ActionsBundle.message(node != null ? "action.Debugger.ViewEditText.text" : "action.Debugger.ViewText.text")); dialog.show(); diff --git a/java/debugger/impl/src/com/intellij/debugger/impl/ReloadClassesWorker.java b/java/debugger/impl/src/com/intellij/debugger/impl/ReloadClassesWorker.java index 319d1e781988..04088e5947ff 100644 --- a/java/debugger/impl/src/com/intellij/debugger/impl/ReloadClassesWorker.java +++ b/java/debugger/impl/src/com/intellij/debugger/impl/ReloadClassesWorker.java @@ -17,10 +17,7 @@ package com.intellij.debugger.impl; import com.intellij.debugger.DebuggerBundle; import com.intellij.debugger.DebuggerManagerEx; -import com.intellij.debugger.engine.DebugProcessImpl; -import com.intellij.debugger.engine.DebuggerManagerThreadImpl; -import com.intellij.debugger.engine.JavaExecutionStack; -import com.intellij.debugger.engine.SuspendContextImpl; +import com.intellij.debugger.engine.*; import com.intellij.debugger.jdi.VirtualMachineProxyImpl; import com.intellij.debugger.ui.breakpoints.BreakpointManager; import com.intellij.openapi.diagnostic.Logger; @@ -168,7 +165,10 @@ class ReloadClassesWorker { processException(e); } - debugProcess.getPositionManager().clearCache(); + CompoundPositionManager positionManager = debugProcess.getPositionManager(); + if (positionManager != null) { + positionManager.clearCache(); + } DebuggerContextImpl context = myDebuggerSession.getContextManager().getContext(); SuspendContextImpl suspendContext = context.getSuspendContext(); diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java b/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java index 783e30efd9b3..240339068111 100644 --- a/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java +++ b/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java @@ -18,6 +18,7 @@ package com.intellij.psi.codeStyle; import com.intellij.configurationStore.UnknownElementCollector; import com.intellij.configurationStore.UnknownElementWriter; import com.intellij.lang.Language; +import com.intellij.lang.LanguageUtil; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Document; import com.intellij.openapi.extensions.ExtensionException; @@ -672,6 +673,14 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea } } } + + Language language = LanguageUtil.getLanguageForPsi(file.getProject(), file.getVirtualFile()); + if (language != null) { + IndentOptions options = getIndentOptions(language); + if (options != null) { + return options; + } + } return getIndentOptions(file.getFileType()); } @@ -699,6 +708,11 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea private IndentOptions getLanguageIndentOptions(@Nullable FileType fileType) { if (fileType == null || !(fileType instanceof LanguageFileType)) return null; Language lang = ((LanguageFileType)fileType).getLanguage(); + return getIndentOptions(lang); + } + + @Nullable + private IndentOptions getIndentOptions(Language lang) { CommonCodeStyleSettings langSettings = getCommonSettings(lang); return langSettings == this ? null : langSettings.getIndentOptions(); } diff --git a/platform/platform-api/src/com/intellij/openapi/editor/actionSystem/FreezeLogger.java b/platform/platform-api/src/com/intellij/openapi/editor/actionSystem/FreezeLogger.java index 9a520f616df6..31567aade6b0 100644 --- a/platform/platform-api/src/com/intellij/openapi/editor/actionSystem/FreezeLogger.java +++ b/platform/platform-api/src/com/intellij/openapi/editor/actionSystem/FreezeLogger.java @@ -32,6 +32,11 @@ public class FreezeLogger { private static final int MAX_ALLOWED_TIME = 500; public static void runUnderPerformanceMonitor(@Nullable Project project, @NotNull Runnable action) { + if (ApplicationManager.getApplication().isUnitTestMode()) { + action.run(); + return; + } + final ModalityState initial = ModalityState.current(); ALARM.cancelAllRequests(); ALARM.addRequest(() -> dumpThreads(project, initial), MAX_ALLOWED_TIME); diff --git a/plugins/hg4idea/resources/python/prompthooks.py b/plugins/hg4idea/resources/python/prompthooks.py index 5c5251cc2426..49de5e811273 100644 --- a/plugins/hg4idea/resources/python/prompthooks.py +++ b/plugins/hg4idea/resources/python/prompthooks.py @@ -204,7 +204,9 @@ def find_user_password(self, realm, authuri): else: return None - newMerc = isNewer3_8_3() + # After mercurial 3.8.3 urllib2.HTTPPasswordmgrwithdefaultrealm.find_user_password etc were changed to appropriate methods + # in util.urlreq module with slightly different semantics + newMerc = False if isinstance(self, urllib2.HTTPPasswordMgrWithDefaultRealm) else True if newMerc: user, password = util.urlreq.httppasswordmgrwithdefaultrealm().find_user_password(realm, authuri) else: @@ -221,15 +223,4 @@ def find_user_password(self, realm, authuri): raise util.Abort(_('http authorization required')) user, passwd = retrievedPass pmWithRealm.add_password(realm, authuri, user, passwd) - return retrievedPass - - -def isNewer3_8_3(): - # After mercurial 3.8.3 urllib2.HTTPPasswordmgrwithdefaultrealm.find_user_password etc were changed to appropriate methods - # in util.urlreq module with slightly different semantics - try: - from mercurial.url import urlreq - return True - except ImportError: - pass - return False \ No newline at end of file + return retrievedPass \ No newline at end of file