Commit 90019de4 authored by Roman Shevchenko's avatar Roman Shevchenko
Browse files

Merge remote-tracking branch 'origin/master'

parents eb1d7fa6 3e3148d3
Showing with 58 additions and 34 deletions
+58 -34
......@@ -19,10 +19,15 @@ task setupAndroidSdk {
}
def zipFile = org.gradle.internal.os.OperatingSystem.current().familyName + ".zip"
def gradleFile = "gradle-3.3-bin.zip"
def archivePath = "$project.buildDir/android-sdk/" + zipFile
def gradlePath = "$project.buildDir/android-sdk/" + gradleFile
def outputDir ="$project.buildDir/android-sdk/prebuilts/studio/sdk"
def outputGradle ="$project.buildDir/android-sdk/tools/external/gradle"
outputs.dir(outputDir)
outputs.dir(outputGradle)
outputs.file(archivePath)
outputs.file(gradlePath)
doFirst {
download {
......@@ -30,6 +35,11 @@ task setupAndroidSdk {
dest archivePath
onlyIfNewer true
}
download {
src "http://repo.labs.intellij.net/thirdparty/gradle/" + gradleFile
dest gradlePath
onlyIfNewer true
}
}
doLast {
logger.info("Unpacking android sdk into " + archivePath)
......@@ -37,5 +47,9 @@ task setupAndroidSdk {
from zipTree(file(archivePath))
into outputDir
}
copy {
from file(gradlePath)
into outputGradle
}
}
}
......@@ -17,7 +17,6 @@ package com.intellij.ide.hierarchy.call;
import com.intellij.ide.hierarchy.HierarchyNodeDescriptor;
import com.intellij.ide.hierarchy.HierarchyTreeStructure;
import com.intellij.ide.projectView.impl.nodes.ProjectViewDirectoryHelper;
import com.intellij.openapi.project.Project;
import com.intellij.psi.*;
import com.intellij.psi.search.searches.OverridingMethodsSearch;
......@@ -40,10 +39,6 @@ public final class CalleeMethodsTreeStructure extends HierarchyTreeStructure {
@NotNull
protected final Object[] buildChildren(@NotNull final HierarchyNodeDescriptor descriptor) {
return ProjectViewDirectoryHelper.calculateYieldingToWriteAction(() -> calcChildren(descriptor));
}
private Object[] calcChildren(@NotNull HierarchyNodeDescriptor descriptor) {
final PsiMember enclosingElement = ((CallHierarchyNodeDescriptor)descriptor).getEnclosingElement();
if (!(enclosingElement instanceof PsiMethod)) {
return ArrayUtil.EMPTY_OBJECT_ARRAY;
......
......@@ -17,7 +17,6 @@ package com.intellij.ide.hierarchy.call;
import com.intellij.ide.hierarchy.HierarchyNodeDescriptor;
import com.intellij.ide.hierarchy.HierarchyTreeStructure;
import com.intellij.ide.projectView.impl.nodes.ProjectViewDirectoryHelper;
import com.intellij.ide.util.treeView.NodeDescriptor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.*;
......@@ -46,10 +45,6 @@ public final class CallerMethodsTreeStructure extends HierarchyTreeStructure {
@NotNull
@Override
protected final Object[] buildChildren(@NotNull final HierarchyNodeDescriptor descriptor) {
return ProjectViewDirectoryHelper.calculateYieldingToWriteAction(() -> calcChildren(descriptor));
}
private Object[] calcChildren(@NotNull HierarchyNodeDescriptor descriptor) {
PsiMember enclosingElement = ((CallHierarchyNodeDescriptor)descriptor).getEnclosingElement();
HierarchyNodeDescriptor nodeDescriptor = getBaseDescriptor();
......
......@@ -554,11 +554,14 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
HighlightInfoType type = new HighlightInfoType.HighlightInfoTypeImpl(level.getSeverity(element), level.getAttributesKey());
final String plainMessage = message.startsWith("<html>") ? StringUtil.unescapeXml(XmlStringUtil.stripHtml(message).replaceAll("<[^>]*>", "")) : message;
@NonNls final String link = " <a "
+"href=\"#inspection/" + tool.getShortName() + "\""
+ (UIUtil.isUnderDarcula() ? " color=\"7AB4C9\" " : "")
+">" + DaemonBundle.message("inspection.extended.description")
+"</a> " + myShortcutText;
@NonNls String link = "";
if (showToolDescription(tool)) {
link = " <a "
+ "href=\"#inspection/" + tool.getShortName() + "\""
+ (UIUtil.isUnderDarcula() ? " color=\"7AB4C9\" " : "")
+ ">" + DaemonBundle.message("inspection.extended.description")
+ "</a> " + myShortcutText;
}
@NonNls String tooltip = null;
if (descriptor.showTooltip()) {
......@@ -572,6 +575,10 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
return info;
}
private static boolean showToolDescription(@NotNull LocalInspectionToolWrapper tool) {
return tool.getStaticDescription() == null || !tool.getStaticDescription().isEmpty();
}
private static void registerQuickFixes(@NotNull LocalInspectionToolWrapper tool,
@NotNull HighlightInfo highlightInfo,
@NotNull List<IntentionAction> quickFixes) {
......
......@@ -16,6 +16,7 @@
package com.intellij.ide.hierarchy;
import com.intellij.ide.projectView.impl.nodes.ProjectViewDirectoryHelper;
import com.intellij.ide.util.treeView.AbstractTreeStructure;
import com.intellij.ide.util.treeView.NodeDescriptor;
import com.intellij.openapi.project.IndexNotReadyException;
......@@ -95,7 +96,7 @@ public abstract class HierarchyTreeStructure extends AbstractTreeStructure {
if (cachedChildren == null) {
if (descriptor.isValid()) {
try {
descriptor.setCachedChildren(buildChildren(descriptor));
descriptor.setCachedChildren(ProjectViewDirectoryHelper.calculateYieldingToWriteAction(() ->buildChildren(descriptor)));
}
catch (IndexNotReadyException e) {
return ArrayUtil.EMPTY_OBJECT_ARRAY;
......
/*
* Copyright 2000-2016 JetBrains s.r.o.
* Copyright 2000-2017 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.
......@@ -23,6 +23,7 @@ import com.intellij.openapi.editor.ex.FoldingListener;
import com.intellij.openapi.editor.ex.FoldingModelEx;
import com.intellij.openapi.editor.markup.TextAttributes;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.ModificationTracker;
import com.intellij.openapi.util.TextRange;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
......@@ -34,7 +35,7 @@ import java.util.List;
/**
* @author cdr
*/
class FoldingModelWindow implements FoldingModelEx{
class FoldingModelWindow implements FoldingModelEx, ModificationTracker {
private final FoldingModelEx myDelegate;
private final DocumentWindow myDocumentWindow;
private final EditorWindow myEditorWindow;
......@@ -206,4 +207,9 @@ class FoldingModelWindow implements FoldingModelEx{
public void clearFoldRegions() {
myDelegate.clearFoldRegions();
}
@Override
public long getModificationCount() {
return myDelegate instanceof ModificationTracker ? ((ModificationTracker)myDelegate).getModificationCount() : 0;
}
}
......@@ -408,7 +408,8 @@ public class AbstractTreeUi {
myBusyAlarm.cancelAllRequests();
if (!myWasEverShown) return;
// ask for termination of background children calculation
if (myProgress != null && myProgress.isRunning()) myProgress.cancel();
if (!isReady()) {
cancelUpdate();
myUpdateFromRootRequested = true;
......@@ -918,7 +919,7 @@ public class AbstractTreeUi {
while(true) {
try (LockToken ignored = attemptLock()) {
if (ignored == null) { // async children calculation is in progress under lock
if (!myProgress.isCanceled()) myProgress.cancel();
if (myProgress != null && myProgress.isRunning()) myProgress.cancel();
continue;
}
final AtomicBoolean update = new AtomicBoolean();
......
......@@ -101,9 +101,13 @@ public class IdeaWideProxySelector extends ProxySelector {
ProxySelector pacProxySelector = pair.first;
if (pacProxySelector != null) {
List<Proxy> select = pacProxySelector.select(uri);
LOG.debug("Autodetected proxies: ", select);
return select;
try {
List<Proxy> select = pacProxySelector.select(uri);
LOG.debug("Autodetected proxies: ", select);
return select;
} catch (StackOverflowError ignore) {
LOG.debug("Too large PAC script (JRE-247)");
}
}
else {
LOG.debug("No proxies detected");
......
......@@ -1059,7 +1059,7 @@ ide.projectView.globalOptions.description=Make Project View options such as auto
ide.projectView.ProjectViewPaneTreeStructure.BuildChildrenInBackground=true
ide.projectView.ProjectViewPaneTreeStructure.BuildChildrenInBackground.description=Temporary ability to control a tree building for the Project View pane
ide.projectView.ProjectViewPaneTreeStructure.BuildChildrenInBackgroundYieldingToWriteAction=false
ide.projectView.ProjectViewPaneTreeStructure.BuildChildrenInBackgroundYieldingToWriteAction=true
ide.projectView.ProjectViewPaneTreeStructure.BuildChildrenInBackgroundYieldingToWriteAction.description=Temporary ability to control a interruptible tree building for the Project View pane
ide.projectView.show.visibility=false
......
......@@ -22,13 +22,14 @@ import com.intellij.codeInspection.ex.InspectionToolRegistrar;
import com.intellij.codeInspection.ex.InspectionToolWrapper;
import com.intellij.codeInspection.ex.LocalInspectionToolWrapper;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.AtomicNullableLazyValue;
import com.intellij.psi.PsiElementVisitor;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import static com.intellij.openapi.util.AtomicNullableLazyValue.createValue;
import static com.intellij.util.ObjectUtils.notNull;
import static com.intellij.util.containers.ContainerUtil.find;
......@@ -36,10 +37,7 @@ public class CommitMessageSpellCheckingInspection extends BaseCommitMessageInspe
private static final Logger LOG = Logger.getInstance(CommitMessageSpellCheckingInspection.class);
private static final LocalInspectionTool ourSpellCheckingInspection = createSpellCheckingInspection();
@Nullable
private static LocalInspectionTool createSpellCheckingInspection() {
private static final AtomicNullableLazyValue<LocalInspectionTool> ourSpellCheckingInspection = createValue(() -> {
LocalInspectionTool result = null;
List<InspectionToolWrapper> tools = InspectionToolRegistrar.getInstance().createTools();
InspectionToolWrapper spellCheckingWrapper = find(tools, wrapper -> wrapper.getShortName().equals("SpellCheckingInspection"));
......@@ -55,15 +53,14 @@ public class CommitMessageSpellCheckingInspection extends BaseCommitMessageInspe
}
return result;
}
});
@NotNull
@Override
public PsiElementVisitor buildVisitor(@NotNull ProblemsHolder holder, boolean isOnTheFly) {
return ourSpellCheckingInspection != null
? ourSpellCheckingInspection.buildVisitor(holder, isOnTheFly)
: super.buildVisitor(holder, isOnTheFly);
LocalInspectionTool tool = ourSpellCheckingInspection.getValue();
return tool != null ? tool.buildVisitor(holder, isOnTheFly) : super.buildVisitor(holder, isOnTheFly);
}
@Nls
......
......@@ -6,14 +6,17 @@ import com.jetbrains.edu.learning.StudySettings;
import icons.PythonEducationalIcons;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class CustomizeEduStepPanel extends AbstractCustomizeWizardStep {
public CustomizeEduStepPanel() {
int iconSize = 180;
final JPanel studentPanel = new JPanel(new VerticalFlowLayout());
final JButton student = new JButton(PythonEducationalIcons.Student);
student.setPreferredSize(new Dimension(iconSize, iconSize));
student.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
......@@ -25,6 +28,7 @@ public class CustomizeEduStepPanel extends AbstractCustomizeWizardStep {
add(studentPanel);
final JButton teacher = new JButton(PythonEducationalIcons.Teacher);
teacher.setPreferredSize(new Dimension(iconSize, iconSize));
final JPanel teacherPanel = new JPanel(new VerticalFlowLayout());
teacherPanel.add(teacher);
teacherPanel.add(new JLabel("Teacher", SwingConstants.CENTER));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment