Merge remote branch 'origin/master'
@@ -63,6 +63,7 @@
|
||||
<module fileurl="file://$PROJECT_DIR$/platform/indexing-api/indexing-api.iml" filepath="$PROJECT_DIR$/platform/indexing-api/indexing-api.iml" group="platform" />
|
||||
<module fileurl="file://$PROJECT_DIR$/platform/indexing-impl/indexing-impl.iml" filepath="$PROJECT_DIR$/platform/indexing-impl/indexing-impl.iml" group="platform" />
|
||||
<module fileurl="file://$PROJECT_DIR$/java/compiler/instrumentation-util/instrumentation-util.iml" filepath="$PROJECT_DIR$/java/compiler/instrumentation-util/instrumentation-util.iml" group="java/compiler" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/IntelliLang/intellilang-jps-plugin/intellilang-jps-plugin.iml" filepath="$PROJECT_DIR$/plugins/IntelliLang/intellilang-jps-plugin/intellilang-jps-plugin.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/java-i18n/java-i18n.iml" filepath="$PROJECT_DIR$/plugins/java-i18n/java-i18n.iml" group="plugins" />
|
||||
<module fileurl="file://$PROJECT_DIR$/java/java-impl/java-impl.iml" filepath="$PROJECT_DIR$/java/java-impl/java-impl.iml" group="java" />
|
||||
<module fileurl="file://$PROJECT_DIR$/java/java-indexing-api/java-indexing-api.iml" filepath="$PROJECT_DIR$/java/java-indexing-api/java-indexing-api.iml" group="java" />
|
||||
|
||||
@@ -192,6 +192,9 @@ def layoutFull(String home, String targetDirectory, String patchedDescriptorDir
|
||||
module("IntelliLang-xml")
|
||||
module("IntelliLang-javaee")
|
||||
}
|
||||
jar("intellilang-jps-plugin.jar") {
|
||||
module("intellilang-jps-plugin")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -259,6 +262,7 @@ public def layoutCommunityPlugins(String home) {
|
||||
jar("gradle.jar") {
|
||||
module("gradle")
|
||||
}
|
||||
fileset(dir: "$home/plugins/gradle/lib") { include(name: "*.jar") }
|
||||
}
|
||||
|
||||
layoutPlugin("git4idea") {
|
||||
|
||||
@@ -9,7 +9,11 @@
|
||||
<package code="__PACKAGE_CODE__"/>
|
||||
<names product="IDEA" fullname="IntelliJ IDEA" script="idea"/>
|
||||
|
||||
<welcome-screen caption-url="/welcomeCaption_community.png" slogan-url="/developSlogan_community.png"/>
|
||||
<welcome-screen logo-url="/Logo_welcomeScreen.png"
|
||||
caption-url="/welcomeCaption_community.png"
|
||||
slogan-url="/developSlogan_community.png"/>
|
||||
|
||||
<editor background-url="/idea_logo_background.png"/>
|
||||
|
||||
<update-urls check="http://www.jetbrains.com/updates/updates.xml"
|
||||
patches="http://download.jetbrains.com/idea/"/>
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
<package code="__PACKAGE_CODE__"/>
|
||||
<names product="IDEA" fullname="IntelliJ IDEA"/>
|
||||
|
||||
<welcome-screen caption-url="/welcomeCaption_community.png" slogan-url="/developSlogan_community.png"/>
|
||||
<welcome-screen logo-url="/Logo_welcomeScreen.png"
|
||||
caption-url="/welcomeCaption_community.png"
|
||||
slogan-url="/developSlogan_community.png"/>
|
||||
|
||||
<update-urls check="http://www.jetbrains.com/updates/updates.xml"
|
||||
patches="http://download.jetbrains.com/idea/"/>
|
||||
|
||||
|
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 394 KiB After Width: | Height: | Size: 41 KiB |
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.compiler.options.CompilerUIConfigurable">
|
||||
<grid id="1663f" binding="myPanel" layout-manager="GridLayoutManager" row-count="10" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="1663f" binding="myPanel" layout-manager="GridLayoutManager" row-count="10" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="28" y="24" width="883" height="379"/>
|
||||
@@ -10,13 +10,13 @@
|
||||
<children>
|
||||
<vspacer id="67edf">
|
||||
<constraints>
|
||||
<grid row="9" column="0" row-span="1" col-span="2" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
<grid row="9" column="0" row-span="1" col-span="3" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<grid id="b341d" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="5" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
@@ -55,7 +55,7 @@
|
||||
</grid>
|
||||
<component id="889a8" class="javax.swing.JCheckBox" binding="myCbClearOutputDirectory">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="1" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/CompilerBundle" key="label.option.clear.output.directory.on.rebuild"/>
|
||||
@@ -63,7 +63,7 @@
|
||||
</component>
|
||||
<component id="366e" class="javax.swing.JCheckBox" binding="myCbAssertNotNull">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="2" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/CompilerBundle" key="add.notnull.assertions"/>
|
||||
@@ -71,7 +71,7 @@
|
||||
</component>
|
||||
<component id="348ee" class="javax.swing.JCheckBox" binding="myCbAutoShowFirstError">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="3" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/CompilerBundle" key="label.option.autoshow.first.error"/>
|
||||
@@ -87,7 +87,7 @@
|
||||
</component>
|
||||
<component id="b9b2d" class="javax.swing.JCheckBox" binding="myCbEnableAutomake">
|
||||
<constraints>
|
||||
<grid row="5" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Make project automatically"/>
|
||||
@@ -103,7 +103,7 @@
|
||||
</component>
|
||||
<component id="a28b8" class="javax.swing.JTextField" binding="myHeapSizeField">
|
||||
<constraints>
|
||||
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<grid row="7" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="6" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="50" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -119,7 +119,7 @@
|
||||
</component>
|
||||
<component id="b5547" class="javax.swing.JTextField" binding="myVMOptionsField">
|
||||
<constraints>
|
||||
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="8" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -135,12 +135,20 @@
|
||||
</component>
|
||||
<component id="91979" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="6" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="(may require larger heap size)"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="732b1" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="5" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="(only works while not running / debugging)"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
|
||||
@@ -100,7 +100,25 @@ public class InstrumentationClassFinder {
|
||||
if (aClass != null) {
|
||||
return aClass;
|
||||
}
|
||||
|
||||
|
||||
final InputStream is = getClassBytesAsStream(internalName);
|
||||
|
||||
if (is == null) {
|
||||
throw new ClassNotFoundException("Class not found: " + internalName);
|
||||
}
|
||||
|
||||
try {
|
||||
final PseudoClass result = loadPseudoClass(is);
|
||||
myLoaded.put(internalName, result);
|
||||
return result;
|
||||
}
|
||||
finally {
|
||||
is.close();
|
||||
}
|
||||
}
|
||||
|
||||
public InputStream getClassBytesAsStream(String className) throws IOException {
|
||||
final String internalName = className.replace('.', '/'); // normalize
|
||||
InputStream is = null;
|
||||
// first look into platformCp
|
||||
final String resourceName = internalName + CLASS_RESOURCE_EXTENSION;
|
||||
@@ -123,19 +141,7 @@ public class InstrumentationClassFinder {
|
||||
if (is == null) {
|
||||
is = lookupClassAfterClasspath(internalName);
|
||||
}
|
||||
|
||||
if (is == null) {
|
||||
throw new ClassNotFoundException("Class not found: " + internalName);
|
||||
}
|
||||
|
||||
try {
|
||||
final PseudoClass result = loadPseudoClass(is);
|
||||
myLoaded.put(internalName, result);
|
||||
return result;
|
||||
}
|
||||
finally {
|
||||
is.close();
|
||||
}
|
||||
return is;
|
||||
}
|
||||
|
||||
public InputStream getResourceAsStream(String resourceName) throws IOException {
|
||||
|
||||
@@ -36,7 +36,6 @@ import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.FileTypeManager;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
@@ -83,8 +82,8 @@ public class ToggleFieldBreakpointAction extends AnAction {
|
||||
}
|
||||
|
||||
RequestManagerImpl.createRequests(fieldBreakpoint);
|
||||
DialogWrapper dialog = manager.createConfigurationDialog(fieldBreakpoint, null);
|
||||
dialog.show();
|
||||
|
||||
manager.editBreakpoint(fieldBreakpoint, PlatformDataKeys.EDITOR.getData(e.getDataContext()));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -31,7 +31,6 @@ import com.intellij.openapi.editor.markup.RangeHighlighter;
|
||||
import com.intellij.openapi.options.Configurable;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.xdebugger.AbstractDebuggerSession;
|
||||
@@ -42,7 +41,6 @@ import com.intellij.xdebugger.impl.actions.DebuggerActionHandler;
|
||||
import com.intellij.xdebugger.impl.actions.DebuggerToggleActionHandler;
|
||||
import com.intellij.xdebugger.impl.actions.EditBreakpointActionHandler;
|
||||
import com.intellij.xdebugger.impl.actions.MarkObjectActionHandler;
|
||||
import com.intellij.xdebugger.impl.breakpoints.ui.AbstractBreakpointPanel;
|
||||
import com.intellij.xdebugger.impl.breakpoints.ui.BreakpointPanelProvider;
|
||||
import com.intellij.xdebugger.impl.evaluate.quick.common.QuickEvaluateHandler;
|
||||
import com.intellij.xdebugger.impl.settings.DebuggerSettingsPanelProvider;
|
||||
@@ -189,21 +187,6 @@ public class JavaDebuggerSupport extends DebuggerSupport {
|
||||
private static class JavaBreakpointPanelProvider extends BreakpointPanelProvider<Breakpoint> {
|
||||
private List<MyBreakpointManagerListener> myListeners = ContainerUtil.createEmptyCOWList();
|
||||
|
||||
@NotNull
|
||||
public Collection<AbstractBreakpointPanel<Breakpoint>> getBreakpointPanels(@NotNull final Project project,
|
||||
@NotNull final DialogWrapper parentDialog) {
|
||||
List<AbstractBreakpointPanel<Breakpoint>> panels = new ArrayList<AbstractBreakpointPanel<Breakpoint>>();
|
||||
final BreakpointFactory[] allFactories = BreakpointFactory.getBreakpointFactories();
|
||||
for (BreakpointFactory factory : allFactories) {
|
||||
BreakpointPanel panel = factory.createBreakpointPanel(project, parentDialog);
|
||||
if (panel != null) {
|
||||
panel.setupPanelUI();
|
||||
panels.add(panel);
|
||||
}
|
||||
}
|
||||
return panels;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnAction[] getAddBreakpointActions(@NotNull Project project) {
|
||||
List<AnAction> result = new ArrayList<AnAction>();
|
||||
|
||||
@@ -23,7 +23,6 @@ package com.intellij.debugger.ui.breakpoints;
|
||||
import com.intellij.codeInsight.folding.impl.actions.ExpandRegionAction;
|
||||
import com.intellij.debugger.DebuggerBundle;
|
||||
import com.intellij.debugger.DebuggerInvocationUtil;
|
||||
import com.intellij.debugger.DebuggerManagerEx;
|
||||
import com.intellij.debugger.SourcePosition;
|
||||
import com.intellij.debugger.engine.DebugProcessImpl;
|
||||
import com.intellij.debugger.engine.DebuggerUtils;
|
||||
@@ -34,8 +33,7 @@ import com.intellij.debugger.impl.DebuggerContextImpl;
|
||||
import com.intellij.debugger.impl.DebuggerContextListener;
|
||||
import com.intellij.debugger.impl.DebuggerManagerImpl;
|
||||
import com.intellij.debugger.impl.DebuggerSession;
|
||||
import com.intellij.debugger.ui.DebuggerExpressionComboBox;
|
||||
import com.intellij.debugger.ui.DebuggerExpressionTextField;
|
||||
import com.intellij.debugger.ui.JavaDebuggerSupport;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ModalityState;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
@@ -43,6 +41,7 @@ import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.EditorFactory;
|
||||
import com.intellij.openapi.editor.event.*;
|
||||
import com.intellij.openapi.editor.markup.GutterIconRenderer;
|
||||
import com.intellij.openapi.editor.markup.MarkupEditorFilterFactory;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.fileEditor.FileEditor;
|
||||
@@ -52,7 +51,6 @@ import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.startup.StartupManager;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.MessageType;
|
||||
import com.intellij.openapi.util.*;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
@@ -63,8 +61,8 @@ import com.intellij.util.EventDispatcher;
|
||||
import com.intellij.util.IJSwingUtilities;
|
||||
import com.intellij.util.containers.HashMap;
|
||||
import com.intellij.xdebugger.XDebuggerUtil;
|
||||
import com.intellij.xdebugger.impl.DebuggerSupport;
|
||||
import com.intellij.xdebugger.impl.XDebugSessionImpl;
|
||||
import com.intellij.xdebugger.impl.breakpoints.ui.BreakpointsConfigurationDialogFactory;
|
||||
import com.sun.jdi.Field;
|
||||
import com.sun.jdi.InternalException;
|
||||
import com.sun.jdi.ObjectReference;
|
||||
@@ -93,8 +91,6 @@ public class BreakpointManager implements JDOMExternalizable {
|
||||
private final Map<String, String> myUIProperties = new java.util.HashMap<String, String>();
|
||||
private final Map<Key<? extends Breakpoint>, BreakpointDefaults> myBreakpointDefaults = new HashMap<Key<? extends Breakpoint>, BreakpointDefaults>();
|
||||
|
||||
private BreakpointsConfigurationDialogFactory myBreakpointsConfigurable;
|
||||
|
||||
private final EventDispatcher<BreakpointManagerListener> myDispatcher = EventDispatcher.create(BreakpointManagerListener.class);
|
||||
|
||||
private final StartupManager myStartupManager;
|
||||
@@ -309,7 +305,8 @@ public class BreakpointManager implements JDOMExternalizable {
|
||||
DebuggerInvocationUtil.invokeLater(myProject, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Breakpoint breakpoint = toggleBreakpoint(e.getMouseEvent().isAltDown(), line);
|
||||
final Breakpoint breakpoint = toggleBreakpoint(e.getMouseEvent().isAltDown(), line);
|
||||
|
||||
|
||||
if (e.getMouseEvent().isShiftDown() && breakpoint != null) {
|
||||
breakpoint.LOG_EXPRESSION_ENABLED = true;
|
||||
@@ -318,14 +315,16 @@ public class BreakpointManager implements JDOMExternalizable {
|
||||
breakpoint.getDisplayName());
|
||||
breakpoint.setLogMessage(new TextWithImportsImpl(CodeFragmentKind.EXPRESSION, text));
|
||||
breakpoint.SUSPEND = false;
|
||||
editBreakpoint(breakpoint, editor);
|
||||
|
||||
DialogWrapper dialog = DebuggerManagerEx.getInstanceEx(myProject).getBreakpointManager()
|
||||
.createConfigurationDialog(breakpoint, BreakpointPropertiesPanel.CONTROL_LOG_MESSAGE);
|
||||
dialog.show();
|
||||
|
||||
if (!dialog.isOK()) {
|
||||
removeBreakpoint(breakpoint);
|
||||
}
|
||||
//DialogWrapper dialog = DebuggerManagerEx.getInstanceEx(myProject).getBreakpointManager()
|
||||
// .createConfigurationDialog(breakpoint, BreakpointPropertiesPanel.CONTROL_LOG_MESSAGE);
|
||||
//dialog.show();
|
||||
//
|
||||
//if (!dialog.isOK()) {
|
||||
// removeBreakpoint(breakpoint);
|
||||
//}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -367,26 +366,17 @@ public class BreakpointManager implements JDOMExternalizable {
|
||||
eventMulticaster.addDocumentListener(myDocumentListener, myProject);
|
||||
}
|
||||
|
||||
public DialogWrapper createConfigurationDialog(@Nullable Breakpoint initialBreakpoint, @Nullable String selectComponent) {
|
||||
if (myBreakpointsConfigurable == null) {
|
||||
myBreakpointsConfigurable = BreakpointsConfigurationDialogFactory.getInstance(myProject);
|
||||
}
|
||||
BreakpointsConfigurationDialogFactory.BreakpointsConfigurationDialog dialog = myBreakpointsConfigurable.createDialog(initialBreakpoint);
|
||||
if (initialBreakpoint != null && selectComponent != null) {
|
||||
final JComponent component = ((BreakpointPanel)dialog.getSelectedPanel()).getControl(selectComponent);
|
||||
dialog.setPreferredFocusedComponent(component, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (component instanceof DebuggerExpressionComboBox) {
|
||||
((DebuggerExpressionComboBox)component).selectAll();
|
||||
}
|
||||
else if (component instanceof DebuggerExpressionTextField) {
|
||||
((DebuggerExpressionTextField)component).selectAll();
|
||||
}
|
||||
public void editBreakpoint(final Breakpoint breakpoint, final Editor editor) {
|
||||
DebuggerInvocationUtil.swingInvokeLater(myProject, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final GutterIconRenderer renderer = ((BreakpointWithHighlighter)breakpoint).getHighlighter().getGutterIconRenderer();
|
||||
if (renderer != null) {
|
||||
DebuggerSupport.getDebuggerSupport(JavaDebuggerSupport.class).getEditBreakpointAction()
|
||||
.editBreakpoint(myProject, editor, breakpoint, renderer);
|
||||
}
|
||||
});
|
||||
}
|
||||
return dialog;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.intellij.debugger.DebuggerBundle;
|
||||
import com.intellij.ide.util.ClassFilter;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.ui.IdeBorderFactory;
|
||||
import com.intellij.util.ui.DialogUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -48,6 +49,9 @@ public class ExceptionBreakpointPropertiesPanel extends BreakpointPropertiesPane
|
||||
|
||||
myNotifyCaughtCheckBox = new JCheckBox(DebuggerBundle.message("label.exception.breakpoint.properties.panel.caught.exception"));
|
||||
myNotifyUncaughtCheckBox = new JCheckBox(DebuggerBundle.message("label.exception.breakpoint.properties.panel.uncaught.exception"));
|
||||
DialogUtil.registerMnemonic(myNotifyCaughtCheckBox);
|
||||
DialogUtil.registerMnemonic(myNotifyUncaughtCheckBox);
|
||||
|
||||
|
||||
Box notificationsBox = Box.createVerticalBox();
|
||||
JPanel _panel = new JPanel(new BorderLayout());
|
||||
|
||||
@@ -23,6 +23,7 @@ package com.intellij.debugger.ui.breakpoints;
|
||||
import com.intellij.debugger.DebuggerBundle;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.ui.IdeBorderFactory;
|
||||
import com.intellij.util.ui.DialogUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -43,6 +44,8 @@ public class FieldBreakpointPropertiesPanel extends BreakpointPropertiesPanel {
|
||||
JPanel _panel0;
|
||||
myWatchAccessCheckBox = new JCheckBox(DebuggerBundle.message("label.filed.breakpoint.properties.panel.field.access"));
|
||||
myWatchModificationCheckBox = new JCheckBox(DebuggerBundle.message("label.filed.breakpoint.properties.panel.field.modification"));
|
||||
DialogUtil.registerMnemonic(myWatchAccessCheckBox);
|
||||
DialogUtil.registerMnemonic(myWatchModificationCheckBox);
|
||||
|
||||
|
||||
Box watchBox = Box.createVerticalBox();
|
||||
|
||||
@@ -23,6 +23,7 @@ package com.intellij.debugger.ui.breakpoints;
|
||||
import com.intellij.debugger.DebuggerBundle;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.ui.IdeBorderFactory;
|
||||
import com.intellij.util.ui.DialogUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -43,6 +44,9 @@ public class MethodBreakpointPropertiesPanel extends BreakpointPropertiesPanel {
|
||||
|
||||
myWatchEntryCheckBox = new JCheckBox(DebuggerBundle.message("label.method.breakpoint.properties.panel.method.entry"));
|
||||
myWatchExitCheckBox = new JCheckBox(DebuggerBundle.message("label.method.breakpoint.properties.panel.method.exit"));
|
||||
DialogUtil.registerMnemonic(myWatchEntryCheckBox);
|
||||
DialogUtil.registerMnemonic(myWatchExitCheckBox);
|
||||
|
||||
|
||||
Box watchBox = Box.createVerticalBox();
|
||||
_panel = new JPanel(new BorderLayout());
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright 2000-2012 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @author max
|
||||
*/
|
||||
package com.intellij.ide.actions;
|
||||
|
||||
import com.intellij.execution.actions.EditRunConfigurationsAction;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.openapi.actionSystem.DefaultActionGroup;
|
||||
import com.intellij.openapi.actionSystem.Presentation;
|
||||
|
||||
public class TemplateProjectSettingsGroup extends DefaultActionGroup {
|
||||
public TemplateProjectSettingsGroup() {
|
||||
setPopup(true);
|
||||
Presentation presentation = getTemplatePresentation();
|
||||
|
||||
presentation.setText("Template Project");
|
||||
presentation.setIcon(AllIcons.General.TemplateProjectSettings);
|
||||
|
||||
add(new TemplateProjectPropertiesAction() {{
|
||||
Presentation p = getTemplatePresentation();
|
||||
p.setText("Settings");
|
||||
p.setIcon(AllIcons.General.TemplateProjectSettings);
|
||||
}});
|
||||
|
||||
add(new TemplateProjectStructureAction(){{
|
||||
Presentation p = getTemplatePresentation();
|
||||
p.setText("Project Structure");
|
||||
p.setIcon(AllIcons.General.TemplateProjectStructure);
|
||||
}});
|
||||
|
||||
add(new EditRunConfigurationsAction() {{
|
||||
Presentation p = getTemplatePresentation();
|
||||
p.setText("Run Configurations");
|
||||
p.setIcon(AllIcons.General.CreateNewProjectfromExistingFiles);
|
||||
}});
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,6 @@ import com.intellij.psi.jsp.JspElementType;
|
||||
import com.intellij.psi.templateLanguages.OuterLanguageElement;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.intellij.util.Consumer;
|
||||
import com.intellij.util.ProcessingContext;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
@@ -484,7 +483,9 @@ public class JavaCompletionData extends JavaAwareCompletionData {
|
||||
}
|
||||
}
|
||||
|
||||
if (isInsideParameterList(position) && !psiElement().afterLeaf(PsiKeyword.FINAL).accepts(position) && !AFTER_DOT.accepts(position)) {
|
||||
if ((isInsideParameterList(position) || isAtResourceVariableStart(position)) &&
|
||||
!psiElement().afterLeaf(PsiKeyword.FINAL).accepts(position) &&
|
||||
!AFTER_DOT.accepts(position)) {
|
||||
result.addElement(TailTypeDecorator.withTail(createKeyword(position, PsiKeyword.FINAL), TailType.HUMBLE_SPACE_BEFORE_WORD));
|
||||
}
|
||||
|
||||
@@ -632,6 +633,10 @@ public class JavaCompletionData extends JavaAwareCompletionData {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isAtResourceVariableStart(PsiElement position) {
|
||||
return psiElement().insideStarting(psiElement(PsiTypeElement.class).withParent(PsiResourceList.class)).accepts(position);
|
||||
}
|
||||
|
||||
private static void addBreakContinue(CompletionResultSet result, PsiElement position) {
|
||||
PsiLoopStatement loop = PsiTreeUtil.getParentOfType(position, PsiLoopStatement.class);
|
||||
|
||||
|
||||
@@ -492,8 +492,13 @@ public class GenericsHighlightUtil {
|
||||
MethodSignatureBackedByPsiMethod sameErasure = sameErasureMethods.get(signatureToErase);
|
||||
HighlightInfo info;
|
||||
if (sameErasure != null) {
|
||||
info = checkSameErasureNotSubSignatureOrSameClass(sameErasure, signature, aClass, method);
|
||||
if (info != null) return info;
|
||||
if (aClass instanceof PsiTypeParameter ||
|
||||
MethodSignatureUtil.findMethodBySuperMethod(aClass, sameErasure.getMethod(), false) != null ||
|
||||
!(InheritanceUtil.isInheritorOrSelf(sameErasure.getMethod().getContainingClass(), method.getContainingClass(), true) ||
|
||||
InheritanceUtil.isInheritorOrSelf(method.getContainingClass(), sameErasure.getMethod().getContainingClass(), true))) {
|
||||
info = checkSameErasureNotSubSignatureOrSameClass(sameErasure, signature, aClass, method);
|
||||
if (info != null) return info;
|
||||
}
|
||||
}
|
||||
else {
|
||||
sameErasureMethods.put(signatureToErase, signature);
|
||||
@@ -522,7 +527,7 @@ public class GenericsHighlightUtil {
|
||||
}
|
||||
else if (superMethod.isConstructor()) return null;
|
||||
|
||||
final boolean atLeast17 = JavaVersionService.getInstance().isAtLeast(checkMethod, JavaSdkVersion.JDK_1_7);
|
||||
final boolean atLeast17 = JavaVersionService.getInstance().isAtLeast(aClass, JavaSdkVersion.JDK_1_7);
|
||||
if (checkMethod.hasModifierProperty(PsiModifier.STATIC) && !checkEqualsSuper && !atLeast17) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public class StaticImportMethodFix implements IntentionAction {
|
||||
final PsiMethod psiMethod = (PsiMethod)psiElement;
|
||||
final PsiParameter[] parameters = psiMethod.getParameterList().getParameters();
|
||||
final int idx = ArrayUtilRt.find(((PsiExpressionList)parent).getExpressions(), PsiResolveHelperImpl.skipParenthesizedExprUp(methodCall));
|
||||
if (idx > -1) {
|
||||
if (idx > -1 && parameters.length > 0) {
|
||||
PsiType parameterType = parameters[Math.min(idx, parameters.length - 1)].getType();
|
||||
if (idx >= parameters.length - 1) {
|
||||
final PsiParameter lastParameter = parameters[parameters.length - 1];
|
||||
|
||||
@@ -46,11 +46,12 @@ public final class CallerMethodsTreeStructure extends HierarchyTreeStructure {
|
||||
@Override
|
||||
protected final Object[] buildChildren(final HierarchyNodeDescriptor descriptor) {
|
||||
final PsiMember enclosingElement = ((CallHierarchyNodeDescriptor)descriptor).getEnclosingElement();
|
||||
if (!(enclosingElement instanceof PsiMethod)) {
|
||||
HierarchyNodeDescriptor nodeDescriptor = getBaseDescriptor();
|
||||
if (!(enclosingElement instanceof PsiMethod) || nodeDescriptor == null) {
|
||||
return ArrayUtil.EMPTY_OBJECT_ARRAY;
|
||||
}
|
||||
final PsiMethod method = (PsiMethod)enclosingElement;
|
||||
final PsiMethod baseMethod = (PsiMethod)((CallHierarchyNodeDescriptor)getBaseDescriptor()).getTargetElement();
|
||||
final PsiMethod baseMethod = (PsiMethod)((CallHierarchyNodeDescriptor)nodeDescriptor).getTargetElement();
|
||||
final SearchScope searchScope = getSearchScope(myScopeType, baseMethod.getContainingClass());
|
||||
|
||||
final PsiClass originalClass = method.getContainingClass();
|
||||
|
||||
@@ -618,7 +618,7 @@ public class JavaDocumentationProvider implements CodeDocumentationProvider, Ext
|
||||
}
|
||||
}
|
||||
|
||||
if (urls == null) {
|
||||
if (urls == null || urls.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -101,7 +101,7 @@ public class LanguageLevelProjectExtensionImpl extends LanguageLevelProjectExten
|
||||
}
|
||||
myLanguageLevel = languageLevel;
|
||||
|
||||
if (!willReload() && DirectoryIndex.getInstance(myProject).isInitialized()) {
|
||||
if (!willReload() && !myProject.isDefault() && DirectoryIndex.getInstance(myProject).isInitialized()) {
|
||||
JavaLanguageLevelPusher.pushLanguageLevel(myProject);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import com.intellij.psi.impl.light.LightTypeElement;
|
||||
import com.intellij.psi.impl.source.*;
|
||||
import com.intellij.psi.impl.source.codeStyle.CodeEditUtil;
|
||||
import com.intellij.psi.impl.source.parsing.ParseUtilBase;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.intellij.util.CharTable;
|
||||
@@ -171,6 +172,9 @@ public class JavaTreeGenerator implements TreeGenerator {
|
||||
LightTypeElement te = new LightTypeElement(original.getManager(), ((PsiIntersectionType)type).getRepresentative());
|
||||
return ChangeUtil.generateTreeElement(te, table, manager);
|
||||
}
|
||||
if (type instanceof PsiMethodReferenceType || type instanceof PsiLambdaExpressionType) {
|
||||
type = PsiType.getJavaLangObject(manager, GlobalSearchScope.projectScope(manager.getProject()));
|
||||
}
|
||||
|
||||
PsiClassType classType = (PsiClassType)type;
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.source.javadoc.PsiDocParamRef;
|
||||
import com.intellij.psi.impl.source.resolve.JavaResolveUtil;
|
||||
import com.intellij.psi.javadoc.PsiDocTagValue;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.search.LocalSearchScope;
|
||||
@@ -138,8 +137,7 @@ public class ConvertToInstanceMethodProcessor extends BaseRefactoringProcessor {
|
||||
MultiMap<PsiElement, String> conflicts = new MultiMap<PsiElement, String>();
|
||||
final Set<PsiMember> methods = Collections.singleton((PsiMember)myMethod);
|
||||
if (!myTargetClass.isInterface()) {
|
||||
final String original = VisibilityUtil.getVisibilityModifier(myMethod.getModifierList());
|
||||
RefactoringConflictsUtil.analyzeAccessibilityConflicts(methods, myTargetClass, conflicts, original);
|
||||
RefactoringConflictsUtil.analyzeAccessibilityConflicts(methods, myTargetClass, conflicts, myNewVisibility);
|
||||
}
|
||||
else {
|
||||
for (final UsageInfo usage : usagesIn) {
|
||||
@@ -168,50 +166,9 @@ public class ConvertToInstanceMethodProcessor extends BaseRefactoringProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
addInaccessibilityConflicts(usagesIn, conflicts);
|
||||
}
|
||||
catch (IncorrectOperationException e) {
|
||||
LOG.error(e);
|
||||
}
|
||||
|
||||
return showConflicts(conflicts, usagesIn);
|
||||
}
|
||||
|
||||
private void addInaccessibilityConflicts(final UsageInfo[] usages, final MultiMap<PsiElement, String> conflicts) throws IncorrectOperationException {
|
||||
final PsiModifierList copy = (PsiModifierList)myMethod.getModifierList().copy();
|
||||
if (myNewVisibility != null) {
|
||||
if (myNewVisibility.equals(VisibilityUtil.ESCALATE_VISIBILITY)) {
|
||||
VisibilityUtil.setVisibility(copy, PsiModifier.PUBLIC);
|
||||
}
|
||||
else {
|
||||
VisibilityUtil.setVisibility(copy, myNewVisibility);
|
||||
}
|
||||
}
|
||||
|
||||
for (UsageInfo usage : usages) {
|
||||
if (usage instanceof MethodCallUsageInfo) {
|
||||
final PsiMethodCallExpression call = ((MethodCallUsageInfo)usage).getMethodCall();
|
||||
final PsiExpression[] arguments = call.getArgumentList().getExpressions();
|
||||
final int index = myMethod.getParameterList().getParameterIndex(myTargetParameter);
|
||||
LOG.assertTrue(index >= 0);
|
||||
PsiClass accessObjectClass = null;
|
||||
if (index < arguments.length) {
|
||||
final PsiExpression argument = arguments[index];
|
||||
final PsiType argumentType = argument.getType();
|
||||
if (argumentType instanceof PsiClassType) accessObjectClass = ((PsiClassType)argumentType).resolve();
|
||||
}
|
||||
if (!JavaResolveUtil.isAccessible(myMethod, myTargetClass, copy, call, accessObjectClass, null)) {
|
||||
final String newVisibility = myNewVisibility == null ? VisibilityUtil.getVisibilityStringToDisplay(myMethod) : myNewVisibility;
|
||||
String message = RefactoringBundle.message("0.with.1.visibility.is.not.accessible.from.2",
|
||||
RefactoringUIUtil.getDescription(myMethod, true), newVisibility,
|
||||
RefactoringUIUtil.getDescription(ConflictsUtil.getContainer(call), true));
|
||||
conflicts.putValue(myMethod, message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void performRefactoring(UsageInfo[] usages) {
|
||||
if (!CommonRefactoringUtil.checkReadOnlyStatus(myProject, myTargetClass)) return;
|
||||
LocalHistoryAction a = LocalHistory.getInstance().startAction(getCommandName());
|
||||
|
||||
@@ -726,16 +726,23 @@ public abstract class BaseExpressionToFieldHandler extends IntroduceHandlerBase
|
||||
PsiMember anchorMember = finalAnchorElement instanceof PsiMember ? (PsiMember)finalAnchorElement : null;
|
||||
|
||||
if (anchorMember instanceof PsiEnumConstant && destClass == anchorMember.getContainingClass()) {
|
||||
String constantsClassName = "Constants";
|
||||
final String initialName = "Constants";
|
||||
String constantsClassName = initialName;
|
||||
|
||||
int i = 1;
|
||||
while (destClass.findInnerClassByName(constantsClassName, true) != null) {
|
||||
constantsClassName += constantsClassName + i++;
|
||||
PsiClass innerClass = destClass.findInnerClassByName(constantsClassName, true);
|
||||
if (innerClass == null || !isConstantsClass(innerClass)) {
|
||||
int i = 1;
|
||||
while (destClass.findInnerClassByName(constantsClassName, true) != null) {
|
||||
constantsClassName = initialName + i++;
|
||||
}
|
||||
|
||||
PsiClass psiClass = JavaPsiFacade.getElementFactory(myProject).createClass(constantsClassName);
|
||||
PsiUtil.setModifierProperty(psiClass, PsiModifier.PRIVATE, true);
|
||||
PsiUtil.setModifierProperty(psiClass, PsiModifier.STATIC, true);
|
||||
destClass = (PsiClass)destClass.add(psiClass);
|
||||
} else {
|
||||
destClass = innerClass;
|
||||
}
|
||||
|
||||
PsiClass psiClass = JavaPsiFacade.getElementFactory(myProject).createClass(constantsClassName);
|
||||
PsiUtil.setModifierProperty(psiClass, PsiModifier.PRIVATE, true);
|
||||
destClass = (PsiClass)destClass.add(psiClass);
|
||||
anchorMember = null;
|
||||
}
|
||||
myField = appendField(initializer, initializerPlace, destClass, myParentClass, myField, anchorMember);
|
||||
@@ -842,6 +849,14 @@ public abstract class BaseExpressionToFieldHandler extends IntroduceHandlerBase
|
||||
}
|
||||
}
|
||||
|
||||
static boolean isConstantsClass(PsiClass innerClass) {
|
||||
if (innerClass.getMethods().length != 0) return false;
|
||||
for (PsiField field : innerClass.getFields()) {
|
||||
if (!field.hasModifierProperty(PsiModifier.STATIC) || !field.hasModifierProperty(PsiModifier.FINAL)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static PsiField appendField(final PsiExpression initializer,
|
||||
InitializationPlace initializerPlace, final PsiClass destClass,
|
||||
final PsiClass parentClass,
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.intellij.psi.codeStyle.JavaCodeStyleManager;
|
||||
import com.intellij.psi.codeStyle.VariableKind;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.intellij.refactoring.JavaRefactoringSettings;
|
||||
import com.intellij.refactoring.RefactoringActionHandler;
|
||||
import com.intellij.refactoring.ui.TypeSelectorManagerImpl;
|
||||
import com.intellij.refactoring.util.occurrences.OccurrenceManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -222,6 +223,11 @@ public class InplaceIntroduceConstantPopup extends AbstractInplaceIntroduceField
|
||||
return super.performRefactoring();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean startsOnTheSameElement(RefactoringActionHandler handler, PsiElement element) {
|
||||
return super.startsOnTheSameElement(handler, element) && handler instanceof IntroduceConstantHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void performIntroduce() {
|
||||
final BaseExpressionToFieldHandler.Settings settings =
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.intellij.psi.codeStyle.VariableKind;
|
||||
import com.intellij.psi.util.PsiExpressionTrimRenderer;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.intellij.refactoring.JavaRefactoringSettings;
|
||||
import com.intellij.refactoring.RefactoringActionHandler;
|
||||
import com.intellij.refactoring.ui.TypeSelectorManagerImpl;
|
||||
import com.intellij.refactoring.util.occurrences.OccurrenceManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -164,6 +165,11 @@ public class InplaceIntroduceFieldPopup extends AbstractInplaceIntroduceFieldPop
|
||||
myIntroduceFieldPanel.saveFinalState();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean startsOnTheSameElement(RefactoringActionHandler handler, PsiElement element) {
|
||||
return super.startsOnTheSameElement(handler, element) && handler instanceof IntroduceFieldHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JComponent getComponent() {
|
||||
myIntroduceFieldPanel.addOccurrenceListener(new ItemListener() {
|
||||
|
||||
@@ -117,10 +117,6 @@ public class IntroduceConstantHandler extends BaseExpressionToFieldHandler {
|
||||
|
||||
final AbstractInplaceIntroducer activeIntroducer = AbstractInplaceIntroducer.getActiveIntroducer(editor);
|
||||
if (activeIntroducer != null) {
|
||||
if (!(activeIntroducer instanceof InplaceIntroduceConstantPopup) || !activeIntroducer.startsOnTheSameElement(expr, localVariable)) {
|
||||
AbstractInplaceIntroducer.unableToStartWarning(project, editor, activeIntroducer);
|
||||
return null;
|
||||
}
|
||||
activeIntroducer.stopIntroduce(editor);
|
||||
expr = (PsiExpression)activeIntroducer.getExpr();
|
||||
localVariable = (PsiLocalVariable)activeIntroducer.getLocalVariable();
|
||||
|
||||
@@ -88,10 +88,6 @@ public class IntroduceFieldHandler extends BaseExpressionToFieldHandler {
|
||||
String enteredName = null;
|
||||
boolean replaceAll = false;
|
||||
if (activeIntroducer != null) {
|
||||
if (!(activeIntroducer instanceof InplaceIntroduceFieldPopup) || !activeIntroducer.startsOnTheSameElement(expr, localVariable)) {
|
||||
AbstractInplaceIntroducer.unableToStartWarning(project, editor, activeIntroducer);
|
||||
return null;
|
||||
}
|
||||
activeIntroducer.stopIntroduce(editor);
|
||||
expr = (PsiExpression)activeIntroducer.getExpr();
|
||||
localVariable = (PsiLocalVariable)activeIntroducer.getLocalVariable();
|
||||
|
||||
@@ -81,6 +81,7 @@ public abstract class AbstractJavaInplaceIntroducer extends AbstractInplaceIntro
|
||||
return parent.replace(JavaPsiFacade.getElementFactory(myProject).createStatementFromText(parent.getText() + ";", parent));
|
||||
}
|
||||
})).getExpression();
|
||||
myEditor.getCaretModel().moveToOffset(myExpr.getTextRange().getStartOffset());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,15 +29,14 @@ import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.codeStyle.JavaCodeStyleManager;
|
||||
import com.intellij.psi.codeStyle.VariableKind;
|
||||
import com.intellij.psi.search.LocalSearchScope;
|
||||
import com.intellij.psi.search.SearchScope;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.intellij.refactoring.JavaRefactoringSettings;
|
||||
import com.intellij.refactoring.RefactoringActionHandler;
|
||||
import com.intellij.refactoring.ui.TypeSelectorManagerImpl;
|
||||
import com.intellij.usageView.UsageInfo;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import gnu.trove.TIntArrayList;
|
||||
import gnu.trove.TIntProcedure;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -171,6 +170,11 @@ public class InplaceIntroduceParameterPopup extends AbstractJavaInplaceIntroduce
|
||||
return getParameter();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean startsOnTheSameElement(RefactoringActionHandler handler, PsiElement element) {
|
||||
return super.startsOnTheSameElement(handler, element) && handler instanceof IntroduceParameterHandler;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void saveSettings(@NotNull PsiVariable psiVariable) {
|
||||
|
||||
@@ -388,10 +388,6 @@ public class IntroduceParameterHandler extends IntroduceHandlerBase {
|
||||
|
||||
final AbstractInplaceIntroducer activeIntroducer = AbstractInplaceIntroducer.getActiveIntroducer(myEditor);
|
||||
if (activeIntroducer != null) {
|
||||
if (!(activeIntroducer instanceof InplaceIntroduceParameterPopup) || !activeIntroducer.startsOnTheSameElement(myExpr, myLocalVar)) {
|
||||
AbstractInplaceIntroducer.unableToStartWarning(myProject, myEditor, activeIntroducer);
|
||||
return;
|
||||
}
|
||||
activeIntroducer.stopIntroduce(myEditor);
|
||||
myExpr = (PsiExpression)activeIntroducer.getExpr();
|
||||
myLocalVar = (PsiLocalVariable)activeIntroducer.getLocalVariable();
|
||||
|
||||
@@ -42,6 +42,7 @@ import javax.swing.*;
|
||||
* @author max
|
||||
*/
|
||||
public class ClassGroupingRule implements UsageGroupingRule {
|
||||
@Override
|
||||
public UsageGroup groupUsage(@NotNull Usage usage) {
|
||||
if (!(usage instanceof PsiElementUsage)) {
|
||||
return null;
|
||||
@@ -105,13 +106,14 @@ public class ClassGroupingRule implements UsageGroupingRule {
|
||||
private final String myQName;
|
||||
private final Icon myIcon;
|
||||
|
||||
public ClassUsageGroup(PsiClass aClass) {
|
||||
public ClassUsageGroup(@NotNull PsiClass aClass) {
|
||||
myQName = aClass.getQualifiedName();
|
||||
myText = createText(aClass);
|
||||
myClassPointer = SmartPointerManager.getInstance(aClass.getProject()).createSmartPsiElementPointer(aClass);
|
||||
myIcon = getPsiClass().getIcon(Iconable.ICON_FLAG_VISIBILITY | Iconable.ICON_FLAG_READ_STATUS);
|
||||
myIcon = aClass.getIcon(Iconable.ICON_FLAG_VISIBILITY | Iconable.ICON_FLAG_READ_STATUS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
}
|
||||
|
||||
@@ -125,15 +127,18 @@ public class ClassGroupingRule implements UsageGroupingRule {
|
||||
return text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(boolean isOpen) {
|
||||
return myIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getText(UsageView view) {
|
||||
return myText;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileStatus getFileStatus() {
|
||||
return isValid() ? NavigationItemFileStatus.get(getPsiClass()) : null;
|
||||
}
|
||||
@@ -142,6 +147,7 @@ public class ClassGroupingRule implements UsageGroupingRule {
|
||||
return (PsiClass)myClassPointer.getElement();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
PsiClass psiClass = getPsiClass();
|
||||
return psiClass != null && psiClass.isValid();
|
||||
@@ -155,24 +161,29 @@ public class ClassGroupingRule implements UsageGroupingRule {
|
||||
return object instanceof ClassUsageGroup && myQName.equals(((ClassUsageGroup)object).myQName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void navigate(boolean focus) throws UnsupportedOperationException {
|
||||
if (canNavigate()) {
|
||||
getPsiClass().navigate(focus);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canNavigate() {
|
||||
return isValid();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canNavigateToSource() {
|
||||
return canNavigate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(UsageGroup usageGroup) {
|
||||
return getText(null).compareToIgnoreCase(usageGroup.getText(null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(final DataKey key, final DataSink sink) {
|
||||
if (!isValid()) return;
|
||||
if (LangDataKeys.PSI_ELEMENT == key) {
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.intellij.psi.util.PsiFormatUtil;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.util.ConcurrencyUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.StringBuilderSpinAllocator;
|
||||
import com.intellij.util.ThreeState;
|
||||
import com.intellij.util.containers.ConcurrentSoftHashMap;
|
||||
import com.intellij.util.containers.ConcurrentSoftValueHashMap;
|
||||
@@ -72,33 +71,28 @@ public class BaseExternalAnnotationsManager extends ExternalAnnotationsManager {
|
||||
@Nullable
|
||||
protected static String getNormalizedExternalName(@NotNull PsiModifierListOwner owner) {
|
||||
String externalName = getExternalName(owner, true);
|
||||
if (externalName != null) {
|
||||
if (owner instanceof PsiParameter && owner.getParent() instanceof PsiParameterList) {
|
||||
final PsiMethod method = PsiTreeUtil.getParentOfType(owner, PsiMethod.class);
|
||||
if (method != null) {
|
||||
externalName =
|
||||
externalName.substring(0, externalName.lastIndexOf(' ') + 1) + method.getParameterList().getParameterIndex((PsiParameter)owner);
|
||||
}
|
||||
}
|
||||
final int idx = externalName.indexOf('(');
|
||||
if (idx == -1) return externalName;
|
||||
final StringBuilder buf = StringBuilderSpinAllocator.alloc();
|
||||
try {
|
||||
final int rightIdx = externalName.indexOf(')');
|
||||
final String[] params = externalName.substring(idx + 1, rightIdx).split(",");
|
||||
buf.append(externalName.substring(0, idx + 1));
|
||||
for (String param : params) {
|
||||
param = param.trim();
|
||||
final int spaceIdx = param.indexOf(' ');
|
||||
buf.append(spaceIdx > -1 ? param.substring(0, spaceIdx) : param).append(", ");
|
||||
}
|
||||
return StringUtil.trimEnd(buf.toString(), ", ") + externalName.substring(rightIdx);
|
||||
}
|
||||
finally {
|
||||
StringBuilderSpinAllocator.dispose(buf);
|
||||
if (externalName == null) {
|
||||
return null;
|
||||
}
|
||||
if (owner instanceof PsiParameter && owner.getParent() instanceof PsiParameterList) {
|
||||
final PsiMethod method = PsiTreeUtil.getParentOfType(owner, PsiMethod.class);
|
||||
if (method != null) {
|
||||
externalName =
|
||||
externalName.substring(0, externalName.lastIndexOf(' ') + 1) + method.getParameterList().getParameterIndex((PsiParameter)owner);
|
||||
}
|
||||
}
|
||||
return externalName;
|
||||
final int idx = externalName.indexOf('(');
|
||||
if (idx == -1) return externalName;
|
||||
StringBuilder buf = new StringBuilder();
|
||||
int rightIdx = externalName.indexOf(')');
|
||||
String[] params = externalName.substring(idx + 1, rightIdx).split(",");
|
||||
buf.append(externalName.substring(0, idx + 1));
|
||||
for (String param : params) {
|
||||
param = param.trim();
|
||||
final int spaceIdx = param.indexOf(' ');
|
||||
buf.append(spaceIdx > -1 ? param.substring(0, spaceIdx) : param).append(", ");
|
||||
}
|
||||
return StringUtil.trimEnd(buf.toString(), ", ") + externalName.substring(rightIdx);
|
||||
}
|
||||
|
||||
protected boolean hasAnyAnnotationsRoots() {
|
||||
@@ -151,56 +145,54 @@ public class BaseExternalAnnotationsManager extends ExternalAnnotationsManager {
|
||||
return map;
|
||||
}
|
||||
|
||||
private static final MultiMap<String, AnnotationData> EMPTY = new MultiMap<String, AnnotationData>();
|
||||
private ConcurrentMap<PsiFile, Pair<MultiMap<String, AnnotationData>, Long>> annotationsFileToDataAndModificationStamp = new ConcurrentSoftHashMap<PsiFile, Pair<MultiMap<String, AnnotationData>, Long>>();
|
||||
private final ConcurrentMap<PsiFile, Pair<MultiMap<String, AnnotationData>, Long>> annotationsFileToDataAndModificationStamp = new ConcurrentSoftHashMap<PsiFile, Pair<MultiMap<String, AnnotationData>, Long>>();
|
||||
@NotNull
|
||||
private MultiMap<String, AnnotationData> getDataFromFile(@NotNull PsiFile file) {
|
||||
Pair<MultiMap<String, AnnotationData>, Long> cached = annotationsFileToDataAndModificationStamp.get(file);
|
||||
if (cached != null && cached.getSecond() == file.getModificationStamp()) {
|
||||
return cached.getFirst();
|
||||
}
|
||||
Document document;
|
||||
MultiMap<String, AnnotationData> data = new MultiMap<String, AnnotationData>();
|
||||
try {
|
||||
VirtualFile virtualFile = file.getVirtualFile();
|
||||
if (virtualFile == null) return EMPTY;
|
||||
document = JDOMUtil.loadDocument(escapeAttributes(StreamUtil.readText(virtualFile.getInputStream())));
|
||||
if (virtualFile != null) {
|
||||
Document document = JDOMUtil.loadDocument(escapeAttributes(StreamUtil.readText(virtualFile.getInputStream())));
|
||||
Element rootElement = document.getRootElement();
|
||||
if (rootElement != null) {
|
||||
//noinspection unchecked
|
||||
for (Element element : (List<Element>) rootElement.getChildren()) {
|
||||
String ownerName = element.getAttributeValue("name");
|
||||
if (ownerName == null) continue;
|
||||
//noinspection unchecked
|
||||
for (Element annotationElement : (List<Element>) element.getChildren()) {
|
||||
String annotationFQN = annotationElement.getAttributeValue("name");
|
||||
if (StringUtil.isEmpty(annotationFQN)) continue;
|
||||
StringBuilder buf = new StringBuilder();
|
||||
//noinspection unchecked
|
||||
for (Element annotationParameter : (List<Element>) annotationElement.getChildren()) {
|
||||
buf.append(",");
|
||||
String nameValue = annotationParameter.getAttributeValue("name");
|
||||
if (nameValue != null) {
|
||||
buf.append(nameValue).append("=");
|
||||
}
|
||||
buf.append(annotationParameter.getAttributeValue("val"));
|
||||
}
|
||||
String annotationText = "@" + annotationFQN + (buf.length() > 0 ? "(" + StringUtil.trimStart(buf.toString(), ",") + ")" : "");
|
||||
data.putValue(ownerName, new AnnotationData(annotationFQN, annotationText));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
LOG.error(e);
|
||||
return EMPTY;
|
||||
}
|
||||
catch (JDOMException e) {
|
||||
LOG.error(e);
|
||||
return EMPTY;
|
||||
}
|
||||
Element rootElement = document.getRootElement();
|
||||
if (rootElement == null) return EMPTY;
|
||||
|
||||
MultiMap<String, AnnotationData> data = new MultiMap<String, AnnotationData>();
|
||||
|
||||
//noinspection unchecked
|
||||
for (Element element : (List<Element>) rootElement.getChildren()) {
|
||||
String ownerName = element.getAttributeValue("name");
|
||||
if (ownerName == null) continue;
|
||||
//noinspection unchecked
|
||||
for (Element annotationElement : (List<Element>) element.getChildren()) {
|
||||
String annotationFQN = annotationElement.getAttributeValue("name");
|
||||
if (StringUtil.isEmpty(annotationFQN)) continue;
|
||||
StringBuilder buf = new StringBuilder();
|
||||
//noinspection unchecked
|
||||
for (Element annotationParameter : (List<Element>) annotationElement.getChildren()) {
|
||||
buf.append(",");
|
||||
String nameValue = annotationParameter.getAttributeValue("name");
|
||||
if (nameValue != null) {
|
||||
buf.append(nameValue).append("=");
|
||||
}
|
||||
buf.append(annotationParameter.getAttributeValue("val"));
|
||||
}
|
||||
String annotationText = "@" + annotationFQN + (buf.length() > 0 ? "(" + StringUtil.trimStart(buf.toString(), ",") + ")" : "");
|
||||
data.putValue(ownerName, new AnnotationData(annotationFQN, annotationText));
|
||||
}
|
||||
if (data.isEmpty()) {
|
||||
data = MultiMap.emptyInstance();
|
||||
}
|
||||
|
||||
Pair<MultiMap<String, AnnotationData>, Long> pair = Pair.create(data, file.getModificationStamp());
|
||||
pair = ConcurrencyUtil.cacheOrGet(annotationsFileToDataAndModificationStamp, file, pair);
|
||||
data = pair.first;
|
||||
|
||||
@@ -386,7 +386,7 @@ public class LambdaUtil {
|
||||
else if (parent instanceof PsiVariable) {
|
||||
return ((PsiVariable)parent).getType();
|
||||
}
|
||||
else if (parent instanceof PsiAssignmentExpression) {
|
||||
else if (parent instanceof PsiAssignmentExpression && expression instanceof PsiExpression && !PsiUtil.isOnAssignmentLeftHand((PsiExpression)expression)) {
|
||||
final PsiExpression lExpression = ((PsiAssignmentExpression)parent).getLExpression();
|
||||
return lExpression.getType();
|
||||
}
|
||||
|
||||
@@ -73,13 +73,13 @@ public class PsiTypeVisitor<A> {
|
||||
final PsiLambdaExpression lambdaExpression = lambdaExpressionType.getExpression();
|
||||
final PsiType interfaceType = lambdaExpression.getFunctionalInterfaceType();
|
||||
if (interfaceType != null) return interfaceType.accept(this);
|
||||
return visitType(interfaceType);
|
||||
return visitType(lambdaExpressionType);
|
||||
}
|
||||
|
||||
public A visitMethodReferenceType(PsiMethodReferenceType methodReferenceType) {
|
||||
final PsiMethodReferenceExpression expression = methodReferenceType.getExpression();
|
||||
final PsiType interfaceType = expression.getFunctionalInterfaceType();
|
||||
if (interfaceType != null) return interfaceType.accept(this);
|
||||
return visitType(interfaceType);
|
||||
return visitType(methodReferenceType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class JavaCoreApplicationEnvironment extends CoreApplicationEnvironment {
|
||||
myApplication.registerService(PsiPackageImplementationHelper.class, new CorePsiPackageImplementationHelper());
|
||||
|
||||
myApplication.registerService(EmptySubstitutor.class, new EmptySubstitutorImpl());
|
||||
myApplication.registerService(JavaDirectoryService.class, new CoreJavaDirectoryService());
|
||||
myApplication.registerService(JavaDirectoryService.class, createJavaDirectoryService());
|
||||
myApplication.registerService(JavaVersionService.class, new JavaVersionService());
|
||||
|
||||
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiPackage.class, new PackagePresentationProvider());
|
||||
@@ -80,6 +80,10 @@ public class JavaCoreApplicationEnvironment extends CoreApplicationEnvironment {
|
||||
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiParameter.class, new VariablePresentationProvider());
|
||||
}
|
||||
|
||||
protected CoreJavaDirectoryService createJavaDirectoryService() {
|
||||
return new CoreJavaDirectoryService();
|
||||
}
|
||||
|
||||
public <T> void addExplicitExtension(final ClassExtension<T> instance, final Class clazz, final T object) {
|
||||
instance.addExplicitExtension(clazz, object);
|
||||
Disposer.register(getParentDisposable(), new Disposable() {
|
||||
|
||||
@@ -456,8 +456,8 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
PsiType[] types1 = new PsiType[max];
|
||||
PsiType[] types2 = new PsiType[max];
|
||||
for (int i = 0; i < max; i++) {
|
||||
PsiType type1 = params1[Math.min(i, params1.length - 1)].getType();
|
||||
PsiType type2 = params2[Math.min(i, params2.length - 1)].getType();
|
||||
PsiType type1 = params1.length > 0 ? params1[Math.min(i, params1.length - 1)].getType() : null;
|
||||
PsiType type2 = params2.length > 0 ? params2[Math.min(i, params2.length - 1)].getType() : null;
|
||||
if (applicabilityLevel == MethodCandidateInfo.ApplicabilityLevel.VARARGS) {
|
||||
if (type1 instanceof PsiEllipsisType && type2 instanceof PsiEllipsisType &&
|
||||
(!JavaVersionService.getInstance().isAtLeast(class1, JavaSdkVersion.JDK_1_7) || ((PsiArrayType)type1).getComponentType().equalsToText(CommonClassNames.JAVA_LANG_OBJECT) || ((PsiArrayType)type2).getComponentType().equalsToText(CommonClassNames.JAVA_LANG_OBJECT))) {
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
class LifeUniverseEverythingEntity {}
|
||||
class LifeUniverseEverythingManager {}
|
||||
|
||||
class FooFooFooFooFoo {
|
||||
{
|
||||
LifeUniverseEverything<caret>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
public class Util {
|
||||
void foo() {
|
||||
try (<caret>)
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import java.lang.annotation.Target;
|
||||
@Target(value={ElementType.<caret>})
|
||||
@interface Annotation {
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import java.lang.annotation.Retention;
|
||||
@Retention(RetentionPolicy.<caret>)
|
||||
@interface Annotation {
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import java.lang.annotation.Retention;
|
||||
@Retention(value=RetentionPolicy.<caret>)
|
||||
@interface Annotation {
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target(ElementType.<caret>)
|
||||
public @interface Test {
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
class MyEnum {
|
||||
public static final MyEnum Foo;
|
||||
public static final MyEnum Bar;
|
||||
}
|
||||
|
||||
class Bar {
|
||||
MyEnum getEnum();
|
||||
}
|
||||
|
||||
class Foo {
|
||||
|
||||
Bar my;
|
||||
|
||||
{
|
||||
MyEnum cl = MyEnum.<caret>
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
interface Func<TIn, TOut>{
|
||||
TOut run(TIn in);
|
||||
}
|
||||
|
||||
|
||||
class Main {
|
||||
|
||||
public static void main(final String[] args) {
|
||||
Func<Integer, String> func = Integer::toString;
|
||||
System.out.println(func.run(6));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import java.util.*;
|
||||
|
||||
class LambdaTest {
|
||||
public void testR() {
|
||||
<error descr="Incompatible types. Found: 'java.lang.String', required: '<method reference>'">new ArrayList<String>() :: size = ""</error>;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class Test {
|
||||
{
|
||||
foo(new Bar());
|
||||
}
|
||||
private static void <caret>foo(Bar b){}
|
||||
|
||||
}
|
||||
|
||||
class Bar {
|
||||
|
||||
}
|
||||
@@ -3,4 +3,8 @@ enum TestEnum {
|
||||
|
||||
TestEnum(String str) {
|
||||
}
|
||||
|
||||
private class Constants {
|
||||
void foo(){}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
enum TestEnum {
|
||||
ONE("te<caret>stString");
|
||||
|
||||
TestEnum(String str) {
|
||||
}
|
||||
|
||||
private static class Constants {
|
||||
public static final String FOO = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
enum TestEnum {
|
||||
ONE(Constants.xxx);
|
||||
|
||||
TestEnum(String str) {
|
||||
}
|
||||
|
||||
private static class Constants {
|
||||
public static final String FOO = "";
|
||||
public static final String xxx = "testString";
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,14 @@
|
||||
enum TestEnum {
|
||||
ONE(Constants.xxx);
|
||||
ONE(Constants1.xxx);
|
||||
|
||||
TestEnum(String str) {
|
||||
}
|
||||
|
||||
private class Constants {
|
||||
private static class Constants1 {
|
||||
public static final String xxx = "testString";
|
||||
}
|
||||
|
||||
private class Constants {
|
||||
void foo(){}
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,6 @@ public class ClassNameCompletionTest extends LightFixtureCompletionTestCase {
|
||||
String path = "/java/";
|
||||
configureByFile(path + getTestName(false) + ".java");
|
||||
complete();
|
||||
checkResultByFile(path + getTestName(false) + "_after.java");
|
||||
assertEquals(2, myItems.length);
|
||||
}
|
||||
|
||||
|
||||
@@ -108,6 +108,7 @@ public class KeywordCompletionTest extends LightCompletionTestCase {
|
||||
public void testReturnInTernary() throws Exception { doTest(1, "return"); }
|
||||
public void testFinalAfterParameterAnno() throws Exception { doTest(2, "final", "float", "class"); }
|
||||
public void testFinalAfterParameterAnno2() throws Exception { doTest(2, "final", "float", "class"); }
|
||||
public void testFinalInTryWithResources() throws Exception { doTest(1, "final", "float", "class"); }
|
||||
public void testClassInMethod() throws Exception { doTest(2, "class", "char"); }
|
||||
public void testIntInClassArray() throws Throwable { doTest(2, "int", "char", "final"); }
|
||||
public void testIntInClassArray2() throws Throwable { doTest(2, "int", "char", "final"); }
|
||||
|
||||
@@ -122,7 +122,6 @@ public class SecondSmartTypeCompletionTest extends LightFixtureCompletionTestCas
|
||||
myFixture.configureByFile(getTestName(false) + ".java");
|
||||
myFixture.complete(CompletionType.SMART);
|
||||
assertStringItems("MyEnum.Bar", "MyEnum.Foo");
|
||||
checkResult();
|
||||
myFixture.complete(CompletionType.SMART);
|
||||
assertStringItems("my.getEnum", "MyEnum.Bar", "MyEnum.Foo");
|
||||
}
|
||||
|
||||
@@ -839,7 +839,6 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase {
|
||||
|
||||
public void testAnnotation() throws Exception {
|
||||
configureByTestName();
|
||||
checkResultByTestName();
|
||||
assertStringItems("ElementType.ANNOTATION_TYPE", "ElementType.CONSTRUCTOR",
|
||||
"ElementType.FIELD", "ElementType.LOCAL_VARIABLE",
|
||||
"ElementType.METHOD", "ElementType.PACKAGE", "ElementType.PARAMETER",
|
||||
@@ -848,12 +847,10 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase {
|
||||
|
||||
public void testAnnotation2() throws Exception {
|
||||
configureByTestName();
|
||||
checkResultByTestName();
|
||||
assertStringItems("RetentionPolicy.CLASS", "RetentionPolicy.RUNTIME", "RetentionPolicy.SOURCE");
|
||||
}
|
||||
public void testAnnotation2_2() throws Exception {
|
||||
configureByTestName();
|
||||
checkResultByTestName();
|
||||
assertSameElements(myFixture.getLookupElementStrings(), "RetentionPolicy.CLASS", "RetentionPolicy.SOURCE", "RetentionPolicy.RUNTIME");
|
||||
}
|
||||
|
||||
@@ -881,8 +878,7 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase {
|
||||
|
||||
public void testAnnotation6() throws Exception {
|
||||
configureByTestName();
|
||||
checkResultByTestName();
|
||||
|
||||
|
||||
assertStringItems("ElementType.ANNOTATION_TYPE", "ElementType.CONSTRUCTOR",
|
||||
"ElementType.FIELD", "ElementType.LOCAL_VARIABLE",
|
||||
"ElementType.METHOD", "ElementType.PACKAGE", "ElementType.PARAMETER",
|
||||
|
||||
@@ -137,6 +137,10 @@ public class MethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSOE() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInferenceFromReturnType() throws Exception {
|
||||
doTest(true);
|
||||
}
|
||||
@@ -145,6 +149,10 @@ public class MethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testResolveConflicts() throws Exception {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
@@ -41,6 +41,12 @@ public class IntroduceConstantTest extends LightCodeInsightTestCase {
|
||||
new MockIntroduceConstantHandler(null).invoke(getProject(), getEditor(), getFile(), null);
|
||||
checkResultByFile(BASE_PATH + getTestName(false) + "_after.java");
|
||||
}
|
||||
|
||||
public void testFromEnumConstantInitializer1() throws Exception {
|
||||
configureByFile(BASE_PATH + getTestName(false) + ".java");
|
||||
new MockIntroduceConstantHandler(null).invoke(getProject(), getEditor(), getFile(), null);
|
||||
checkResultByFile(BASE_PATH + getTestName(false) + "_after.java");
|
||||
}
|
||||
|
||||
public void testEnumConstant() throws Exception {
|
||||
doTest(true);
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.intellij.JavaTestUtil;
|
||||
import com.intellij.codeInsight.TargetElementUtilBase;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiMethod;
|
||||
import com.intellij.psi.PsiModifier;
|
||||
import com.intellij.refactoring.BaseRefactoringProcessor;
|
||||
import com.intellij.refactoring.LightRefactoringTestCase;
|
||||
import com.intellij.util.VisibilityUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -33,15 +35,29 @@ public class ConvertToInstanceMethodTest extends LightRefactoringTestCase {
|
||||
public void testInterfaceTypeParameter() throws Exception { doTest(0); }
|
||||
|
||||
public void testJavadocParameter() throws Exception { doTest(0); }
|
||||
public void testVisibilityConflict() throws Exception {
|
||||
try {
|
||||
doTest(0, PsiModifier.PRIVATE);
|
||||
fail("Conflict was not detected");
|
||||
}
|
||||
catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
|
||||
assertEquals("Method <b><code>Test.foo(Bar)</code></b> is private and will not be accessible from instance initializer of class class <b><code>Test</code></b>.", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void doTest(final int targetParameter) throws Exception {
|
||||
doTest(targetParameter, VisibilityUtil.ESCALATE_VISIBILITY);
|
||||
}
|
||||
|
||||
private void doTest(final int targetParameter, final String visibility) throws Exception {
|
||||
final String filePath = "/refactoring/convertToInstanceMethod/" + getTestName(false) + ".java";
|
||||
configureByFile(filePath);
|
||||
final PsiElement targetElement = TargetElementUtilBase.findTargetElement(getEditor(), TargetElementUtilBase.ELEMENT_NAME_ACCEPTED);
|
||||
assertTrue("<caret> is not on method name", targetElement instanceof PsiMethod);
|
||||
PsiMethod method = (PsiMethod) targetElement;
|
||||
new ConvertToInstanceMethodProcessor(getProject(),
|
||||
method, method.getParameterList().getParameters()[targetParameter], VisibilityUtil.ESCALATE_VISIBILITY).run();
|
||||
method, method.getParameterList().getParameters()[targetParameter],
|
||||
visibility).run();
|
||||
checkResultByFile(filePath + ".after");
|
||||
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public abstract class BuildTarget<R extends BuildRootDescriptor> {
|
||||
return myTargetType;
|
||||
}
|
||||
|
||||
public abstract Collection<BuildTarget<?>> computeDependencies(BuildTargetRegistry targetRegistry);
|
||||
public abstract Collection<BuildTarget<?>> computeDependencies(BuildTargetRegistry targetRegistry, TargetOutputIndex outputIndex);
|
||||
|
||||
public void writeConfiguration(PrintWriter out, BuildDataPaths dataPaths, BuildRootIndex buildRootIndex) {
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package org.jetbrains.jps.builders;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jps.builders.impl.BuildTargetChunk;
|
||||
import org.jetbrains.jps.incremental.CompileContext;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -12,10 +12,7 @@ import java.util.Set;
|
||||
*/
|
||||
public interface BuildTargetIndex extends BuildTargetRegistry {
|
||||
|
||||
@NotNull
|
||||
Collection<BuildTarget<?>> getDependencies(@NotNull BuildTarget<?> target);
|
||||
List<BuildTargetChunk> getSortedTargetChunks(@NotNull CompileContext context);
|
||||
|
||||
List<BuildTargetChunk> getSortedTargetChunks();
|
||||
|
||||
Set<BuildTarget<?>> getDependenciesRecursively(BuildTarget<?> target);
|
||||
Set<BuildTarget<?>> getDependenciesRecursively(@NotNull BuildTarget<?> target, @NotNull CompileContext context);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,11 @@ public abstract class BuildTargetType<T extends BuildTarget<?>> {
|
||||
return myTypeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return obj instanceof BuildTargetType && ((BuildTargetType)obj).myTypeId.equals(myTypeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return myTypeId.hashCode();
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package org.jetbrains.jps.builders;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
public interface TargetOutputIndex {
|
||||
Collection<BuildTarget<?>> getTargetsByOutputFile(@NotNull File file);
|
||||
}
|
||||
@@ -9,11 +9,9 @@ import gnu.trove.THashMap;
|
||||
import gnu.trove.TIntArrayList;
|
||||
import gnu.trove.TIntProcedure;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jps.builders.BuildTarget;
|
||||
import org.jetbrains.jps.builders.BuildTargetIndex;
|
||||
import org.jetbrains.jps.builders.BuildTargetType;
|
||||
import org.jetbrains.jps.builders.ModuleBasedTarget;
|
||||
import org.jetbrains.jps.builders.*;
|
||||
import org.jetbrains.jps.incremental.BuilderRegistry;
|
||||
import org.jetbrains.jps.incremental.CompileContext;
|
||||
import org.jetbrains.jps.model.JpsModel;
|
||||
import org.jetbrains.jps.model.module.JpsModule;
|
||||
|
||||
@@ -88,20 +86,21 @@ public class BuildTargetIndexImpl implements BuildTargetIndex {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BuildTargetChunk> getSortedTargetChunks() {
|
||||
initializeChunks();
|
||||
public List<BuildTargetChunk> getSortedTargetChunks(@NotNull CompileContext context) {
|
||||
initializeChunks(context);
|
||||
return myTargetChunks;
|
||||
}
|
||||
|
||||
|
||||
private synchronized void initializeChunks() {
|
||||
private synchronized void initializeChunks(@NotNull CompileContext context) {
|
||||
if (myTargetChunks != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final List<? extends BuildTarget<?>> allTargets = getAllTargets();
|
||||
TargetOutputIndex outputIndex = new TargetOutputIndexImpl(allTargets, context);
|
||||
for (BuildTarget<?> target : allTargets) {
|
||||
myDependencies.put(target, target.computeDependencies(this));
|
||||
myDependencies.put(target, target.computeDependencies(this, outputIndex));
|
||||
}
|
||||
|
||||
GraphGenerator<BuildTarget<?>>
|
||||
@@ -143,8 +142,8 @@ public class BuildTargetIndexImpl implements BuildTargetIndex {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<BuildTarget<?>> getDependenciesRecursively(BuildTarget<?> target) {
|
||||
initializeChunks();
|
||||
public Set<BuildTarget<?>> getDependenciesRecursively(@NotNull BuildTarget<?> target, @NotNull CompileContext context) {
|
||||
initializeChunks(context);
|
||||
LinkedHashSet<BuildTarget<?>> result = new LinkedHashSet<BuildTarget<?>>();
|
||||
for (BuildTarget<?> dep : myDependencies.get(target)) {
|
||||
collectDependenciesRecursively(dep, result);
|
||||
@@ -159,11 +158,4 @@ public class BuildTargetIndexImpl implements BuildTargetIndex {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BuildTarget<?>> getDependencies(@NotNull BuildTarget<?> target) {
|
||||
initializeChunks();
|
||||
return myDependencies.get(target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package org.jetbrains.jps.builders.impl;
|
||||
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
import com.intellij.util.SmartList;
|
||||
import gnu.trove.THashMap;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jps.builders.BuildTarget;
|
||||
import org.jetbrains.jps.builders.TargetOutputIndex;
|
||||
import org.jetbrains.jps.incremental.CompileContext;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
public class TargetOutputIndexImpl implements TargetOutputIndex {
|
||||
private final Map<File, List<BuildTarget<?>>> myOutputToTargets;
|
||||
|
||||
public TargetOutputIndexImpl(Collection<? extends BuildTarget<?>> allTargets, CompileContext context) {
|
||||
myOutputToTargets = new THashMap<File, List<BuildTarget<?>>>(FileUtil.FILE_HASHING_STRATEGY);
|
||||
for (BuildTarget<?> target : allTargets) {
|
||||
Collection<File> roots = target.getOutputRoots(context);
|
||||
for (File root : roots) {
|
||||
List<BuildTarget<?>> targets = myOutputToTargets.get(root);
|
||||
if (targets == null) {
|
||||
targets = new SmartList<BuildTarget<?>>();
|
||||
myOutputToTargets.put(root, targets);
|
||||
}
|
||||
targets.add(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<BuildTarget<?>> getTargetsByOutputFile(@NotNull File file) {
|
||||
File current = file;
|
||||
Collection<BuildTarget<?>> result = null;
|
||||
while (current != null) {
|
||||
List<BuildTarget<?>> targets = myOutputToTargets.get(current);
|
||||
if (targets != null) {
|
||||
if (result == null) {
|
||||
result = targets;
|
||||
}
|
||||
else {
|
||||
result = new ArrayList<BuildTarget<?>>(result);
|
||||
result.addAll(targets);
|
||||
}
|
||||
}
|
||||
current = FileUtilRt.getParentFile(current);
|
||||
}
|
||||
return result != null ? result : Collections.<BuildTarget<?>>emptyList();
|
||||
}
|
||||
}
|
||||
@@ -70,7 +70,7 @@ public class FSOperations {
|
||||
// now mark all modules that depend on dirty modules
|
||||
final JpsJavaClasspathKind classpathKind = JpsJavaClasspathKind.compile(chunk.containsTests());
|
||||
boolean found = false;
|
||||
for (BuildTargetChunk targetChunk : context.getProjectDescriptor().getBuildTargetIndex().getSortedTargetChunks()) {
|
||||
for (BuildTargetChunk targetChunk : context.getProjectDescriptor().getBuildTargetIndex().getSortedTargetChunks(context)) {
|
||||
if (!found) {
|
||||
if (targetChunk.getTargets().equals(chunk.getTargets())) {
|
||||
found = true;
|
||||
|
||||
@@ -372,17 +372,21 @@ public class IncProjectBuilder {
|
||||
}
|
||||
|
||||
private static void registerTargetsWithClearedOutput(CompileContext context, Collection<? extends BuildTarget<?>> targets) {
|
||||
Set<BuildTarget<?>> data = context.getUserData(TARGET_WITH_CLEARED_OUTPUT);
|
||||
if (data == null) {
|
||||
data = new THashSet<BuildTarget<?>>();
|
||||
context.putUserData(TARGET_WITH_CLEARED_OUTPUT, data);
|
||||
synchronized (TARGET_WITH_CLEARED_OUTPUT) {
|
||||
Set<BuildTarget<?>> data = context.getUserData(TARGET_WITH_CLEARED_OUTPUT);
|
||||
if (data == null) {
|
||||
data = new THashSet<BuildTarget<?>>();
|
||||
context.putUserData(TARGET_WITH_CLEARED_OUTPUT, data);
|
||||
}
|
||||
data.addAll(targets);
|
||||
}
|
||||
data.addAll(targets);
|
||||
}
|
||||
|
||||
private static boolean isTargetOutputCleared(CompileContext context, BuildTarget<?> target) {
|
||||
Set<BuildTarget<?>> data = context.getUserData(TARGET_WITH_CLEARED_OUTPUT);
|
||||
return data != null && data.contains(target);
|
||||
synchronized (TARGET_WITH_CLEARED_OUTPUT) {
|
||||
Set<BuildTarget<?>> data = context.getUserData(TARGET_WITH_CLEARED_OUTPUT);
|
||||
return data != null && data.contains(target);
|
||||
}
|
||||
}
|
||||
|
||||
private void clearOutputs(CompileContext context) throws ProjectBuildException, IOException {
|
||||
@@ -473,7 +477,7 @@ public class IncProjectBuilder {
|
||||
BuildTargetIndex targetIndex = pd.getBuildTargetIndex();
|
||||
try {
|
||||
if (BuildRunner.PARALLEL_BUILD_ENABLED) {
|
||||
final List<ChunkGroup> chunkGroups = buildChunkGroups(targetIndex);
|
||||
final List<ChunkGroup> chunkGroups = buildChunkGroups(targetIndex, context);
|
||||
for (ChunkGroup group : chunkGroups) {
|
||||
final List<BuildTargetChunk> groupChunks = group.getChunks();
|
||||
final int chunkCount = groupChunks.size();
|
||||
@@ -546,7 +550,7 @@ public class IncProjectBuilder {
|
||||
}
|
||||
else {
|
||||
// non-parallel build
|
||||
for (BuildTargetChunk chunk : targetIndex.getSortedTargetChunks()) {
|
||||
for (BuildTargetChunk chunk : targetIndex.getSortedTargetChunks(context)) {
|
||||
try {
|
||||
buildChunkIfAffected(context, scope, chunk);
|
||||
}
|
||||
@@ -919,13 +923,13 @@ public class IncProjectBuilder {
|
||||
return doneSomething;
|
||||
}
|
||||
|
||||
private static List<ChunkGroup> buildChunkGroups(BuildTargetIndex index) {
|
||||
final List<BuildTargetChunk> allChunks = index.getSortedTargetChunks();
|
||||
private static List<ChunkGroup> buildChunkGroups(BuildTargetIndex index, CompileContext context) {
|
||||
final List<BuildTargetChunk> allChunks = index.getSortedTargetChunks(context);
|
||||
|
||||
// building aux dependencies map
|
||||
final Map<BuildTarget<?>, Set<BuildTarget<?>>> depsMap = new HashMap<BuildTarget<?>, Set<BuildTarget<?>>>();
|
||||
for (BuildTarget target : index.getAllTargets()) {
|
||||
depsMap.put(target, index.getDependenciesRecursively(target));
|
||||
depsMap.put(target, index.getDependenciesRecursively(target, context));
|
||||
}
|
||||
|
||||
final List<ChunkGroup> groups = new ArrayList<ChunkGroup>();
|
||||
|
||||
@@ -6,10 +6,7 @@ import com.intellij.util.SmartList;
|
||||
import gnu.trove.THashSet;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jps.builders.BuildRootIndex;
|
||||
import org.jetbrains.jps.builders.BuildTarget;
|
||||
import org.jetbrains.jps.builders.BuildTargetRegistry;
|
||||
import org.jetbrains.jps.builders.ModuleBasedTarget;
|
||||
import org.jetbrains.jps.builders.*;
|
||||
import org.jetbrains.jps.builders.java.ExcludedJavaSourceRootProvider;
|
||||
import org.jetbrains.jps.builders.java.JavaModuleBuildTargetType;
|
||||
import org.jetbrains.jps.builders.java.JavaSourceRootDescriptor;
|
||||
@@ -78,7 +75,7 @@ public final class ModuleBuildTarget extends JVMModuleBuildTarget<JavaSourceRoot
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<BuildTarget<?>> computeDependencies(BuildTargetRegistry targetRegistry) {
|
||||
public Collection<BuildTarget<?>> computeDependencies(BuildTargetRegistry targetRegistry, TargetOutputIndex outputIndex) {
|
||||
JpsJavaDependenciesEnumerator enumerator = JpsJavaExtensionService.dependencies(myModule).compileOnly();
|
||||
if (!isTests()) {
|
||||
enumerator.productionOnly();
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.jetbrains.jps.ProjectPaths;
|
||||
import org.jetbrains.jps.builders.BuildRootIndex;
|
||||
import org.jetbrains.jps.builders.BuildTarget;
|
||||
import org.jetbrains.jps.builders.BuildTargetRegistry;
|
||||
import org.jetbrains.jps.builders.TargetOutputIndex;
|
||||
import org.jetbrains.jps.builders.java.ExcludedJavaSourceRootProvider;
|
||||
import org.jetbrains.jps.builders.java.ResourceRootDescriptor;
|
||||
import org.jetbrains.jps.builders.java.ResourcesTargetType;
|
||||
@@ -71,7 +72,7 @@ public final class ResourcesTarget extends JVMModuleBuildTarget<ResourceRootDesc
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<BuildTarget<?>> computeDependencies(BuildTargetRegistry targetRegistry) {
|
||||
public Collection<BuildTarget<?>> computeDependencies(BuildTargetRegistry targetRegistry, TargetOutputIndex outputIndex) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,7 @@ import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.Processor;
|
||||
import com.intellij.util.SmartList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jps.builders.BuildRootIndex;
|
||||
import org.jetbrains.jps.builders.BuildTarget;
|
||||
import org.jetbrains.jps.builders.BuildTargetRegistry;
|
||||
import org.jetbrains.jps.builders.ModuleBasedTarget;
|
||||
import org.jetbrains.jps.builders.*;
|
||||
import org.jetbrains.jps.builders.storage.BuildDataPaths;
|
||||
import org.jetbrains.jps.incremental.CompileContext;
|
||||
import org.jetbrains.jps.incremental.artifacts.builders.LayoutElementBuildersRegistry;
|
||||
@@ -49,7 +46,7 @@ public class ArtifactBuildTarget extends BuildTarget<ArtifactRootDescriptor> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<BuildTarget<?>> computeDependencies(BuildTargetRegistry targetRegistry) {
|
||||
public Collection<BuildTarget<?>> computeDependencies(BuildTargetRegistry targetRegistry, final TargetOutputIndex outputIndex) {
|
||||
final LinkedHashSet<BuildTarget<?>> dependencies = new LinkedHashSet<BuildTarget<?>>();
|
||||
JpsArtifactUtil.processPackagingElements(myArtifact.getRootElement(), new Processor<JpsPackagingElement>() {
|
||||
@Override
|
||||
@@ -63,7 +60,7 @@ public class ArtifactBuildTarget extends BuildTarget<ArtifactRootDescriptor> {
|
||||
}
|
||||
}
|
||||
}
|
||||
dependencies.addAll(LayoutElementBuildersRegistry.getInstance().getDependencies(element));
|
||||
dependencies.addAll(LayoutElementBuildersRegistry.getInstance().getDependencies(element, outputIndex));
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.jetbrains.jps.incremental.artifacts.builders;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jps.builders.BuildTarget;
|
||||
import org.jetbrains.jps.builders.TargetOutputIndex;
|
||||
import org.jetbrains.jps.incremental.artifacts.instructions.ArtifactCompilerInstructionCreator;
|
||||
import org.jetbrains.jps.incremental.artifacts.instructions.ArtifactInstructionsBuilderContext;
|
||||
import org.jetbrains.jps.model.artifact.elements.JpsPackagingElement;
|
||||
@@ -21,7 +22,7 @@ public abstract class LayoutElementBuilderService<E extends JpsPackagingElement>
|
||||
|
||||
public abstract void generateInstructions(E element, ArtifactCompilerInstructionCreator instructionCreator, ArtifactInstructionsBuilderContext builderContext);
|
||||
|
||||
public Collection<? extends BuildTarget<?>> getDependencies(@NotNull E element) {
|
||||
public Collection<? extends BuildTarget<?>> getDependencies(@NotNull E element, TargetOutputIndex outputIndex) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.intellij.util.containers.ClassMap;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jps.builders.BuildTarget;
|
||||
import org.jetbrains.jps.builders.TargetOutputIndex;
|
||||
import org.jetbrains.jps.builders.java.JavaModuleBuildTargetType;
|
||||
import org.jetbrains.jps.incremental.ModuleBuildTarget;
|
||||
import org.jetbrains.jps.model.module.JpsModule;
|
||||
@@ -61,11 +62,11 @@ public class LayoutElementBuildersRegistry {
|
||||
generateInstructions(artifact.getRootElement(), creator, context);
|
||||
}
|
||||
|
||||
public Collection<BuildTarget<?>> getDependencies(JpsPackagingElement element) {
|
||||
public Collection<BuildTarget<?>> getDependencies(JpsPackagingElement element, TargetOutputIndex outputIndex) {
|
||||
LayoutElementBuilderService builder = getElementBuilder(element);
|
||||
if (builder != null) {
|
||||
//noinspection unchecked
|
||||
return builder.getDependencies(element);
|
||||
return builder.getDependencies(element, outputIndex);
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
@@ -160,12 +161,20 @@ public class LayoutElementBuildersRegistry {
|
||||
ArtifactInstructionsBuilderContext builderContext) {
|
||||
final String dirPath = element.getDirectoryPath();
|
||||
if (dirPath != null) {
|
||||
final File directory = new File(FileUtil.toSystemDependentName(dirPath));
|
||||
if (directory.isDirectory()) {
|
||||
instructionCreator.addDirectoryCopyInstructions(directory);
|
||||
}
|
||||
final File directory = new File(dirPath);
|
||||
instructionCreator.addDirectoryCopyInstructions(directory);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<? extends BuildTarget<?>> getDependencies(@NotNull JpsDirectoryCopyPackagingElement element,
|
||||
TargetOutputIndex outputIndex) {
|
||||
String dirPath = element.getDirectoryPath();
|
||||
if (dirPath != null) {
|
||||
return outputIndex.getTargetsByOutputFile(new File(dirPath));
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
private static class FileCopyElementBuilder extends LayoutElementBuilderService<JpsFileCopyPackagingElement> {
|
||||
@@ -178,13 +187,21 @@ public class LayoutElementBuildersRegistry {
|
||||
ArtifactInstructionsBuilderContext builderContext) {
|
||||
final String filePath = element.getFilePath();
|
||||
if (filePath != null) {
|
||||
final File file = new File(FileUtil.toSystemDependentName(filePath));
|
||||
if (file.isFile()) {
|
||||
final String fileName = element.getRenamedOutputFileName();
|
||||
instructionCreator.addFileCopyInstruction(file, fileName != null ? fileName : file.getName());
|
||||
}
|
||||
final File file = new File(filePath);
|
||||
final String fileName = element.getRenamedOutputFileName();
|
||||
instructionCreator.addFileCopyInstruction(file, fileName != null ? fileName : file.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<? extends BuildTarget<?>> getDependencies(@NotNull JpsFileCopyPackagingElement element,
|
||||
TargetOutputIndex outputIndex) {
|
||||
String filePath = element.getFilePath();
|
||||
if (filePath != null) {
|
||||
return outputIndex.getTargetsByOutputFile(new File(filePath));
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
private static class ExtractedDirectoryElementBuilder extends LayoutElementBuilderService<JpsExtractedDirectoryPackagingElement> {
|
||||
@@ -198,10 +215,7 @@ public class LayoutElementBuildersRegistry {
|
||||
ArtifactInstructionsBuilderContext builderContext) {
|
||||
final String jarPath = element.getFilePath();
|
||||
final String pathInJar = element.getPathInJar();
|
||||
File jarFile = new File(FileUtil.toSystemDependentName(jarPath));
|
||||
if (jarFile.isFile()) {
|
||||
instructionCreator.addExtractDirectoryInstruction(jarFile, pathInJar);
|
||||
}
|
||||
instructionCreator.addExtractDirectoryInstruction(new File(jarPath), pathInJar);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,7 +232,8 @@ public class LayoutElementBuildersRegistry {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<? extends BuildTarget<?>> getDependencies(@NotNull JpsProductionModuleOutputPackagingElement element) {
|
||||
public Collection<? extends BuildTarget<?>> getDependencies(@NotNull JpsProductionModuleOutputPackagingElement element,
|
||||
TargetOutputIndex outputIndex) {
|
||||
JpsModule module = element.getModuleReference().resolve();
|
||||
if (module != null) {
|
||||
return Collections.singletonList(new ModuleBuildTarget(module, JavaModuleBuildTargetType.PRODUCTION));
|
||||
@@ -240,7 +255,8 @@ public class LayoutElementBuildersRegistry {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<? extends BuildTarget<?>> getDependencies(@NotNull JpsTestModuleOutputPackagingElement element) {
|
||||
public Collection<? extends BuildTarget<?>> getDependencies(@NotNull JpsTestModuleOutputPackagingElement element,
|
||||
TargetOutputIndex outputIndex) {
|
||||
JpsModule module = element.getModuleReference().resolve();
|
||||
if (module != null) {
|
||||
return Collections.singletonList(new ModuleBuildTarget(module, JavaModuleBuildTargetType.TEST));
|
||||
@@ -288,7 +304,7 @@ public class LayoutElementBuildersRegistry {
|
||||
}
|
||||
|
||||
final JpsPackagingElement rootElement = artifact.getRootElement();
|
||||
final File outputDir = new File(FileUtil.toSystemDependentName(outputPath));
|
||||
final File outputDir = new File(outputPath);
|
||||
if (rootElement instanceof JpsArchivePackagingElement) {
|
||||
final String fileName = ((JpsArchivePackagingElement)rootElement).getArchiveName();
|
||||
instructionCreator.addFileCopyInstruction(new File(outputDir, fileName), fileName);
|
||||
|
||||
@@ -68,6 +68,7 @@ public class JarBasedArtifactRootDescriptor extends ArtifactRootDescriptor {
|
||||
final int rootIndex, final String outputPath,
|
||||
CompileContext context, final BuildOutputConsumer outputConsumer,
|
||||
final ArtifactOutputToSourceMapping outSrcMapping) throws IOException {
|
||||
if (!myRoot.isFile()) return;
|
||||
ProjectBuilderLogger logger = context.getLoggingManager().getProjectBuilderLogger();
|
||||
if (logger.isEnabled()) {
|
||||
logger.logCompiledPaths(Collections.singletonList(filePath), IncArtifactBuilder.BUILDER_NAME, "Extracting archive:");
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.util.*;
|
||||
public class ResourcesBuilder extends TargetBuilder<ResourceRootDescriptor, ResourcesTarget> {
|
||||
private static final Logger LOG = Logger.getInstance("#org.jetbrains.jps.incremental.resourses.ResourcesBuilder");
|
||||
public static final String BUILDER_NAME = "Resource Compiler";
|
||||
private static final List<StandardResourceBuilderEnabler> ourEnablers = new ArrayList<StandardResourceBuilderEnabler>();
|
||||
private static final List<StandardResourceBuilderEnabler> ourEnablers = Collections.synchronizedList(new ArrayList<StandardResourceBuilderEnabler>());
|
||||
|
||||
public ResourcesBuilder() {
|
||||
super(ResourcesTargetType.ALL_TYPES);
|
||||
@@ -70,7 +70,17 @@ public class ResourcesBuilder extends TargetBuilder<ResourceRootDescriptor, Reso
|
||||
|
||||
try {
|
||||
holder.processDirtyFiles(new FileProcessor<ResourceRootDescriptor, ResourcesTarget>() {
|
||||
private final Map<ResourceRootDescriptor, Boolean> mySkippedRoots = new HashMap<ResourceRootDescriptor, Boolean>();
|
||||
public boolean apply(ResourcesTarget target, final File file, final ResourceRootDescriptor sourceRoot) throws IOException {
|
||||
Boolean isSkipped = mySkippedRoots.get(sourceRoot);
|
||||
if (isSkipped == null) {
|
||||
final File outputDir = target.getOutputDir();
|
||||
isSkipped = Boolean.valueOf(outputDir == null || FileUtil.filesEqual(outputDir, sourceRoot.getRootFile()));
|
||||
mySkippedRoots.put(sourceRoot, isSkipped);
|
||||
}
|
||||
if (isSkipped.booleanValue()) {
|
||||
return true;
|
||||
}
|
||||
if (patterns.isResourceFile(file, sourceRoot.getRootFile())) {
|
||||
try {
|
||||
copyResource(context, sourceRoot, file, outputConsumer);
|
||||
@@ -120,9 +130,11 @@ public class ResourcesBuilder extends TargetBuilder<ResourceRootDescriptor, Reso
|
||||
}
|
||||
|
||||
private static boolean isResourceProcessingEnabled(JpsModule module) {
|
||||
for (StandardResourceBuilderEnabler enabler : ourEnablers) {
|
||||
if (!enabler.isResourceProcessingEnabled(module)) {
|
||||
return false;
|
||||
synchronized (ourEnablers) {
|
||||
for (StandardResourceBuilderEnabler enabler : ourEnablers) {
|
||||
if (!enabler.isResourceProcessingEnabled(module)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.Map;
|
||||
* Date: 10/7/11
|
||||
*/
|
||||
public class BuildDataManager implements StorageOwner {
|
||||
private static final int VERSION = 18;
|
||||
private static final int VERSION = 19;
|
||||
private static final Logger LOG = Logger.getInstance("#org.jetbrains.jps.incremental.storage.BuildDataManager");
|
||||
private static final String SRC_TO_FORM_STORAGE = "src-form";
|
||||
private static final String MAPPINGS_STORAGE = "mappings";
|
||||
|
||||
@@ -5,6 +5,9 @@ import gnu.trove.THashMap;
|
||||
import gnu.trove.THashSet;
|
||||
import org.jetbrains.jps.indices.ModuleExcludeIndex;
|
||||
import org.jetbrains.jps.model.JpsModel;
|
||||
import org.jetbrains.jps.model.java.JpsJavaExtensionService;
|
||||
import org.jetbrains.jps.model.java.JpsJavaModuleExtension;
|
||||
import org.jetbrains.jps.model.java.JpsJavaProjectExtension;
|
||||
import org.jetbrains.jps.model.module.JpsModule;
|
||||
import org.jetbrains.jps.util.JpsPathUtil;
|
||||
|
||||
@@ -24,11 +27,29 @@ public class ModuleExcludeIndexImpl implements ModuleExcludeIndex {
|
||||
final Collection<JpsModule> allModules = model.getProject().getModules();
|
||||
for (final JpsModule module : allModules) {
|
||||
final List<File> moduleExcludes = new ArrayList<File>();
|
||||
myModuleToExcludesMap.put(module, moduleExcludes);
|
||||
for (String url : module.getExcludeRootsList().getUrls()) {
|
||||
final File root = JpsPathUtil.urlToFile(url);
|
||||
myExcludedRoots.add(root);
|
||||
moduleExcludes.add(root);
|
||||
moduleExcludes.add(JpsPathUtil.urlToFile(url));
|
||||
}
|
||||
JpsJavaModuleExtension moduleExtension = JpsJavaExtensionService.getInstance().getModuleExtension(module);
|
||||
if (moduleExtension != null && !moduleExtension.isInheritOutput() && moduleExtension.isExcludeOutput()) {
|
||||
String outputUrl = moduleExtension.getOutputUrl();
|
||||
if (outputUrl != null) {
|
||||
moduleExcludes.add(JpsPathUtil.urlToFile(outputUrl));
|
||||
}
|
||||
String testOutputUrl = moduleExtension.getTestOutputUrl();
|
||||
if (testOutputUrl != null) {
|
||||
moduleExcludes.add(JpsPathUtil.urlToFile(testOutputUrl));
|
||||
}
|
||||
}
|
||||
myModuleToExcludesMap.put(module, moduleExcludes);
|
||||
myExcludedRoots.addAll(moduleExcludes);
|
||||
}
|
||||
|
||||
JpsJavaProjectExtension projectExtension = JpsJavaExtensionService.getInstance().getProjectExtension(model.getProject());
|
||||
if (projectExtension != null) {
|
||||
String url = projectExtension.getOutputUrl();
|
||||
if (url != null) {
|
||||
myExcludedRoots.add(JpsPathUtil.urlToFile(url));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ class JavacFileManager extends ForwardingJavaFileManager<StandardJavaFileManager
|
||||
}
|
||||
|
||||
public boolean isSameFile(FileObject a, FileObject b) {
|
||||
if (a instanceof OutputFileObject && b instanceof OutputFileObject) {
|
||||
if (a instanceof OutputFileObject || b instanceof OutputFileObject) {
|
||||
return a.equals(b);
|
||||
}
|
||||
return super.isSameFile(a, b);
|
||||
|
||||
@@ -279,6 +279,16 @@ public class ArtifactBuilderTest extends ArtifactBuilderTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testBuildModuleBeforeArtifactIfSomeDirectoryInsideModuleOutputIsCopiedToArtifact() {
|
||||
String src = PathUtil.getParentPath(PathUtil.getParentPath(createFile("src/x/A.java", "package x; class A{}")));
|
||||
JpsModule module = addModule("m", src);
|
||||
File output = JpsJavaExtensionService.getInstance().getOutputDirectory(module, false);
|
||||
JpsArtifact artifact = addArtifact(root().dirCopy(new File(output, "x").getAbsolutePath()));
|
||||
rebuildAll();
|
||||
assertOutput(module, fs().dir("x").file("A.class"));
|
||||
assertOutput(artifact, fs().file("A.class"));
|
||||
}
|
||||
|
||||
public void testClearOutputOnRebuild() throws IOException {
|
||||
String file = createFile("d/a.txt");
|
||||
JpsArtifact a = addArtifact(root().parentDirCopy(file));
|
||||
|
||||
@@ -15,11 +15,15 @@
|
||||
*/
|
||||
package org.jetbrains.jps.incremental.artifacts;
|
||||
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.util.PathUtil;
|
||||
import org.jetbrains.jps.builders.CompileScopeTestBuilder;
|
||||
import org.jetbrains.jps.model.artifact.JpsArtifact;
|
||||
import org.jetbrains.jps.model.artifact.elements.JpsPackagingElementFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import static com.intellij.util.io.TestFileSystemItem.fs;
|
||||
import static org.jetbrains.jps.incremental.artifacts.LayoutElementTestUtil.archive;
|
||||
import static org.jetbrains.jps.incremental.artifacts.LayoutElementTestUtil.root;
|
||||
@@ -100,6 +104,61 @@ public class IncrementalArtifactBuildingTest extends ArtifactBuilderTestCase {
|
||||
buildAllAndAssertUpToDate();
|
||||
}
|
||||
|
||||
public void testNonExistentFileRoot() throws IOException {
|
||||
String file = getAbsolutePath("a.txt");
|
||||
JpsArtifact a = addArtifact(root().fileCopy(file));
|
||||
buildArtifacts(a);
|
||||
assertEmptyOutput(a);
|
||||
buildAllAndAssertUpToDate();
|
||||
|
||||
FileUtil.createIfDoesntExist(new File(file));
|
||||
buildArtifacts(a);
|
||||
assertOutput(a, fs().file("a.txt"));
|
||||
buildAllAndAssertUpToDate();
|
||||
|
||||
delete(file);
|
||||
buildArtifacts(a);
|
||||
assertEmptyOutput(a);
|
||||
buildAllAndAssertUpToDate();
|
||||
}
|
||||
|
||||
public void testNonExistentDirectoryRoot() throws IOException {
|
||||
String dir = getAbsolutePath("d");
|
||||
JpsArtifact a = addArtifact(root().dirCopy(dir));
|
||||
buildArtifacts(a);
|
||||
assertEmptyOutput(a);
|
||||
buildAllAndAssertUpToDate();
|
||||
|
||||
FileUtil.createIfDoesntExist(new File(dir, "a.txt"));
|
||||
buildArtifacts(a);
|
||||
assertOutput(a, fs().file("a.txt"));
|
||||
buildAllAndAssertUpToDate();
|
||||
|
||||
delete(dir);
|
||||
buildArtifacts(a);
|
||||
assertEmptyOutput(a);
|
||||
buildAllAndAssertUpToDate();
|
||||
}
|
||||
|
||||
public void testExtractFileFromNonExistentJar() throws IOException {
|
||||
String jar = getAbsolutePath("junit.jar");
|
||||
JpsArtifact a = addArtifact(root().extractedDir(jar, "/junit/textui/"));
|
||||
buildArtifacts(a);
|
||||
assertEmptyOutput(a);
|
||||
buildAllAndAssertUpToDate();
|
||||
|
||||
FileUtil.copy(new File(getJUnitJarPath()), new File(jar));
|
||||
buildArtifacts(a);
|
||||
assertOutput(a, fs().file("ResultPrinter.class")
|
||||
.file("TestRunner.class"));
|
||||
buildAllAndAssertUpToDate();
|
||||
|
||||
delete(jar);
|
||||
buildArtifacts(a);
|
||||
assertEmptyOutput(a);
|
||||
buildAllAndAssertUpToDate();
|
||||
}
|
||||
|
||||
public void testOneFileInTwoArtifacts() {
|
||||
final String file = createFile("file.txt");
|
||||
final JpsArtifact a1 = addArtifact("a1", root().dir("dir").fileCopy(file));
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
package org.jetbrains.jps.indices;
|
||||
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import org.jetbrains.jps.indices.impl.ModuleExcludeIndexImpl;
|
||||
import org.jetbrains.jps.model.JpsJavaModelTestCase;
|
||||
import org.jetbrains.jps.model.java.JpsJavaModuleExtension;
|
||||
import org.jetbrains.jps.model.module.JpsModule;
|
||||
import org.jetbrains.jps.util.JpsPathUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
public class ModuleExcludeIndexTest extends JpsJavaModelTestCase {
|
||||
private File myRoot;
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
myRoot = FileUtil.createTempDirectory("excludes", null);
|
||||
}
|
||||
|
||||
public void testExcludeProjectOutput() throws IOException {
|
||||
File out = new File(myRoot, "out");
|
||||
getJavaService().getOrCreateProjectExtension(myProject).setOutputUrl(JpsPathUtil.pathToUrl(out.getAbsolutePath()));
|
||||
assertNotExcluded(myRoot);
|
||||
assertExcluded(out);
|
||||
}
|
||||
|
||||
public void testExcludeModuleOutput() {
|
||||
File out = new File(myRoot, "out");
|
||||
JpsModule module = addModule();
|
||||
JpsJavaModuleExtension extension = getJavaService().getOrCreateModuleExtension(module);
|
||||
extension.setExcludeOutput(true);
|
||||
extension.setOutputUrl(JpsPathUtil.pathToUrl(out.getAbsolutePath()));
|
||||
|
||||
assertNotExcluded(myRoot);
|
||||
assertExcluded(out);
|
||||
assertSameElements(getModuleExcludes(module), out);
|
||||
|
||||
extension.setExcludeOutput(false);
|
||||
assertNotExcluded(out);
|
||||
assertEmpty(getModuleExcludes(module));
|
||||
}
|
||||
|
||||
public void testExcludeExcludedFolder() {
|
||||
File exc = new File(myRoot, "exc");
|
||||
JpsModule module = addModule();
|
||||
module.getExcludeRootsList().addUrl(JpsPathUtil.pathToUrl(exc.getAbsolutePath()));
|
||||
|
||||
assertNotExcluded(myRoot);
|
||||
assertExcluded(exc);
|
||||
assertSameElements(getModuleExcludes(module), exc);
|
||||
}
|
||||
|
||||
private Collection<File> getModuleExcludes(JpsModule module) {
|
||||
return new ModuleExcludeIndexImpl(myModel).getModuleExcludes(module);
|
||||
}
|
||||
|
||||
private void assertExcluded(File file) {
|
||||
assertTrue(new ModuleExcludeIndexImpl(myModel).isExcluded(file));
|
||||
}
|
||||
|
||||
private void assertNotExcluded(File file) {
|
||||
assertFalse(new ModuleExcludeIndexImpl(myModel).isExcluded(file));
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase {
|
||||
|
||||
public void testLibraryScope() throws Exception {
|
||||
JpsLibraryDependency dependency = myModule.getDependenciesList().addLibraryDependency(createJDomLibrary());
|
||||
JpsJavaExtensionService.getInstance().getOrCreateDependencyExtension(dependency).setScope(JpsJavaDependencyScope.RUNTIME);
|
||||
getJavaService().getOrCreateDependencyExtension(dependency).setScope(JpsJavaDependencyScope.RUNTIME);
|
||||
JpsModuleRootModificationUtil.addDependency(myModule, createJDomLibrary(), JpsJavaDependencyScope.RUNTIME, false);
|
||||
|
||||
assertClassRoots(orderEntries(myModule).withoutSdk(), getJDomJar());
|
||||
@@ -190,16 +190,16 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase {
|
||||
final String output = setModuleOutput(myModule, false);
|
||||
final String testOutput = setModuleOutput(myModule, true);
|
||||
|
||||
assertClassRoots(JpsJavaExtensionService.getInstance().enumerateDependencies(Arrays.asList(myModule)).withoutSdk(),
|
||||
assertClassRoots(getJavaService().enumerateDependencies(Arrays.asList(myModule)).withoutSdk(),
|
||||
testOutput, output, getJDomJar());
|
||||
assertSourceRoots(JpsJavaExtensionService.getInstance().enumerateDependencies(Arrays.asList(myModule)).withoutSdk(),
|
||||
assertSourceRoots(getJavaService().enumerateDependencies(Arrays.asList(myModule)).withoutSdk(),
|
||||
srcRoot, testRoot, getJDomSources());
|
||||
}
|
||||
|
||||
private String setModuleOutput(JpsModule module, boolean tests) {
|
||||
try {
|
||||
File file = FileUtil.createTempDirectory(module.getName(), tests ? "testSrc" : "src");
|
||||
JpsJavaModuleExtension extension = JpsJavaExtensionService.getInstance().getOrCreateModuleExtension(module);
|
||||
JpsJavaModuleExtension extension = getJavaService().getOrCreateModuleExtension(module);
|
||||
String url = JpsPathUtil.getLibraryRootUrl(file);
|
||||
if (tests) {
|
||||
extension.setTestOutputUrl(url);
|
||||
|
||||
@@ -14,9 +14,9 @@ import java.util.List;
|
||||
public class JpsJavaExtensionTest extends JpsJavaModelTestCase {
|
||||
public void testModule() {
|
||||
final JpsModule module = addModule();
|
||||
final JpsJavaModuleExtension extension = JpsJavaExtensionService.getInstance().getOrCreateModuleExtension(module);
|
||||
final JpsJavaModuleExtension extension = getJavaService().getOrCreateModuleExtension(module);
|
||||
extension.setOutputUrl("file://path");
|
||||
JpsJavaModuleExtension moduleExtension = JpsJavaExtensionService.getInstance().getModuleExtension(module);
|
||||
JpsJavaModuleExtension moduleExtension = getJavaService().getModuleExtension(module);
|
||||
assertNotNull(moduleExtension);
|
||||
assertEquals("file://path", moduleExtension.getOutputUrl());
|
||||
}
|
||||
@@ -26,14 +26,14 @@ public class JpsJavaExtensionTest extends JpsJavaModelTestCase {
|
||||
final JpsModule module = model.getProject().addModule("m", JpsJavaModuleType.INSTANCE);
|
||||
final JpsLibrary library = model.getProject().addLibrary("l", JpsJavaLibraryType.INSTANCE);
|
||||
final JpsLibraryDependency dependency = module.getDependenciesList().addLibraryDependency(library);
|
||||
JpsJavaExtensionService.getInstance().getOrCreateDependencyExtension(dependency).setScope(JpsJavaDependencyScope.TEST);
|
||||
JpsJavaExtensionService.getInstance().getOrCreateDependencyExtension(dependency).setExported(true);
|
||||
getJavaService().getOrCreateDependencyExtension(dependency).setScope(JpsJavaDependencyScope.TEST);
|
||||
getJavaService().getOrCreateDependencyExtension(dependency).setExported(true);
|
||||
model.commit();
|
||||
|
||||
List<JpsDependencyElement> dependencies = assertOneElement(myProject.getModules()).getDependenciesList().getDependencies();
|
||||
assertEquals(2, dependencies.size());
|
||||
final JpsDependencyElement dep = dependencies.get(1);
|
||||
final JpsJavaDependencyExtension extension = JpsJavaExtensionService.getInstance().getDependencyExtension(dep);
|
||||
final JpsJavaDependencyExtension extension = getJavaService().getDependencyExtension(dep);
|
||||
assertNotNull(extension);
|
||||
assertTrue(extension.isExported());
|
||||
assertSame(JpsJavaDependencyScope.TEST, extension.getScope());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.jetbrains.jps.model;
|
||||
|
||||
import org.jetbrains.jps.model.java.JpsJavaExtensionService;
|
||||
import org.jetbrains.jps.model.java.JpsJavaLibraryType;
|
||||
import org.jetbrains.jps.model.java.JpsJavaModuleType;
|
||||
import org.jetbrains.jps.model.library.JpsLibrary;
|
||||
@@ -24,4 +25,8 @@ public abstract class JpsJavaModelTestCase extends JpsModelTestCase {
|
||||
protected JpsLibrary addLibrary(final String name) {
|
||||
return myProject.addLibrary(name, JpsJavaLibraryType.INSTANCE);
|
||||
}
|
||||
|
||||
protected JpsJavaExtensionService getJavaService() {
|
||||
return JpsJavaExtensionService.getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,14 +20,16 @@ package com.intellij.concurrency;
|
||||
*/
|
||||
public abstract class DoWhile {
|
||||
private AsyncFutureResult<Boolean> myResult;
|
||||
private SameThreadExecutorWithTrampoline myExecutor;
|
||||
|
||||
public DoWhile() {
|
||||
}
|
||||
|
||||
public AsyncFutureResult<Boolean> getResult() {
|
||||
if (myResult == null) {
|
||||
myExecutor = new SameThreadExecutorWithTrampoline();
|
||||
myResult = AsyncFutureFactory.getInstance().createAsyncFutureResult();
|
||||
body().addConsumer(SameThreadExecutor.INSTANCE, new MyConsumer());
|
||||
body().addConsumer(myExecutor, new MyConsumer());
|
||||
}
|
||||
return myResult;
|
||||
}
|
||||
@@ -50,7 +52,7 @@ public abstract class DoWhile {
|
||||
myResult.set(true);
|
||||
}
|
||||
else {
|
||||
body().addConsumer(SameThreadExecutor.INSTANCE, this);
|
||||
body().addConsumer(myExecutor, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2000-2012 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 com.intellij.concurrency;
|
||||
|
||||
import com.intellij.util.containers.Queue;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/**
|
||||
* Author: dmitrylomov
|
||||
*/
|
||||
public class SameThreadExecutorWithTrampoline implements Executor {
|
||||
|
||||
private ThreadLocal<Queue<Runnable>> myExecutionTrampoline = new ThreadLocal<Queue<Runnable>>();
|
||||
|
||||
public SameThreadExecutorWithTrampoline() {}
|
||||
|
||||
|
||||
@Override
|
||||
public void execute(@NotNull Runnable command) {
|
||||
if (myExecutionTrampoline.get() != null) {
|
||||
myExecutionTrampoline.get().addLast(command);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
final Queue<Runnable> queue = new Queue<Runnable>(2);
|
||||
myExecutionTrampoline.set(queue);
|
||||
queue.addLast(command);
|
||||
while(!queue.isEmpty()) {
|
||||
final Runnable runnable = queue.pullFirst();
|
||||
runnable.run();
|
||||
}
|
||||
} finally {
|
||||
myExecutionTrampoline.set(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
@@ -239,4 +239,9 @@ public class CompositeDocumentationProvider extends DocumentationProviderEx impl
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return myProviders.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.intellij.openapi.options.colors.EditorHighlightingProvidingColorSetti
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.util.Alarm;
|
||||
import com.intellij.util.EventDispatcher;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -176,12 +177,18 @@ public class SimpleEditorPreview implements PreviewPanel{
|
||||
}
|
||||
|
||||
private void updateHighlighters() {
|
||||
myEditor.getMarkupModel().removeAllHighlighters();
|
||||
HighlightData[] datum = myHighlightData;
|
||||
final Map<TextAttributesKey, String> displayText = ColorSettingsUtil.keyToDisplayTextMap(myPage);
|
||||
for (final HighlightData data : datum) {
|
||||
data.addHighlToView(myEditor, myOptions.getSelectedScheme(), displayText);
|
||||
}
|
||||
UIUtil.invokeLaterIfNeeded(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (myEditor.isDisposed()) return;
|
||||
myEditor.getMarkupModel().removeAllHighlighters();
|
||||
HighlightData[] datum = myHighlightData;
|
||||
final Map<TextAttributesKey, String> displayText = ColorSettingsUtil.keyToDisplayTextMap(myPage);
|
||||
for (final HighlightData data : datum) {
|
||||
data.addHighlToView(myEditor, myOptions.getSelectedScheme(), displayText);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static final int BLINK_COUNT = 3 * 2;
|
||||
|
||||
@@ -510,7 +510,12 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzer implements JDOMEx
|
||||
myAlarm.cancelAllRequests();
|
||||
boolean restart = toRestartAlarm && !myDisposed && myInitialized;
|
||||
if (restart) {
|
||||
myAlarm.addRequest(myUpdateRunnable, mySettings.AUTOREPARSE_DELAY);
|
||||
UIUtil.invokeLaterIfNeeded(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
myAlarm.addRequest(myUpdateRunnable, mySettings.AUTOREPARSE_DELAY);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -641,8 +641,8 @@ public class DocumentationComponent extends JPanel implements Disposable, DataPr
|
||||
|
||||
if (!processed) {
|
||||
final List<String> urls = provider.getUrlFor(element, originalElement);
|
||||
assert urls != null;
|
||||
assert !urls.isEmpty();
|
||||
assert urls != null : provider;
|
||||
assert !urls.isEmpty() : provider;
|
||||
ExternalJavaDocAction.showExternalJavadoc(urls);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@ import com.intellij.codeInspection.LocalQuickFix;
|
||||
import com.intellij.codeInspection.ex.QuickFixWrapper;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.impl.ApplicationImpl;
|
||||
import com.intellij.openapi.application.impl.ApplicationInfoImpl;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -340,7 +342,7 @@ class IntentionListStep implements ListPopupStep<IntentionActionWithTextCaching>
|
||||
@NotNull
|
||||
public String getTextFor(final IntentionActionWithTextCaching action) {
|
||||
final String text = action.getAction().getText();
|
||||
if (text.startsWith("<html>")) {
|
||||
if (LOG.isDebugEnabled() && text.startsWith("<html>")) {
|
||||
LOG.info("IntentionAction.getText() returned HTML: action=" + action + " text=" + text);
|
||||
}
|
||||
return text;
|
||||
|
||||
@@ -76,7 +76,7 @@ public class ViewOfflineResultsAction extends AnAction implements DumbAware {
|
||||
final Presentation presentation = event.getPresentation();
|
||||
final Project project = event.getData(PlatformDataKeys.PROJECT);
|
||||
presentation.setEnabled(project != null);
|
||||
presentation.setVisible(ActionPlaces.MAIN_MENU.equals(event.getPlace()) && !PlatformUtils.isCidr());
|
||||
presentation.setVisible(ActionPlaces.MAIN_MENU.equals(event.getPlace()) && !PlatformUtils.isAppCode());
|
||||
}
|
||||
|
||||
public void actionPerformed(AnActionEvent event) {
|
||||
|
||||
@@ -119,12 +119,14 @@ public class LocalInspectionToolWrapper extends InspectionToolWrapper<LocalInspe
|
||||
|
||||
@Override
|
||||
protected void addProblemElement(RefEntity refElement, boolean filterSuppressed, CommonProblemDescriptor... descriptions) {
|
||||
final GlobalInspectionContextImpl context = getContext();
|
||||
if (context == null) return;
|
||||
super.addProblemElement(refElement, filterSuppressed, descriptions);
|
||||
final InspectionResultsView view = getContext().getView();
|
||||
final InspectionResultsView view = context.getView();
|
||||
if (view != null && refElement instanceof RefElement) {
|
||||
if (myToolNode == null) {
|
||||
final HighlightSeverity currentSeverity = getCurrentSeverity((RefElement)refElement);
|
||||
view.addTool(this, HighlightDisplayLevel.find(currentSeverity), getContext().getUIOptions().GROUP_BY_SEVERITY);
|
||||
view.addTool(this, HighlightDisplayLevel.find(currentSeverity), context.getUIOptions().GROUP_BY_SEVERITY);
|
||||
} else if (myToolNode.getProblemCount() > 1000) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -170,12 +170,12 @@ public class ConsoleHistoryController {
|
||||
}
|
||||
|
||||
private static void cleanupOldFiles(final File dir) {
|
||||
final long keep2weeks = 2 * 1000L * 60 * 60 * 24 * 7;
|
||||
final long keep10weeks = 10 * 1000L * 60 * 60 * 24 * 7;
|
||||
final long curTime = System.currentTimeMillis();
|
||||
File[] files = dir.listFiles();
|
||||
if (files != null) {
|
||||
for (File file : files) {
|
||||
if (file.isFile() && file.getName().endsWith(".hist.xml") && curTime - file.lastModified() > keep2weeks) {
|
||||
if (file.isFile() && file.getName().endsWith(".hist.xml") && curTime - file.lastModified() > keep10weeks) {
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo
|
||||
@Override
|
||||
public void doRun() {
|
||||
flushDeferredText();
|
||||
if (myEditor == null) return;
|
||||
if (myEditor == null || myFlushAlarm.isDisposed()) return;
|
||||
myEditor.getCaretModel().moveToOffset(myEditor.getDocument().getTextLength());
|
||||
myEditor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE);
|
||||
}
|
||||
@@ -401,7 +401,7 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo
|
||||
|
||||
private void addFlushRequest(MyFlushRunnable flushRunnable, final int millis) {
|
||||
synchronized (myCurrentRequests) {
|
||||
if (myCurrentRequests.add(flushRunnable)) {
|
||||
if (!myFlushAlarm.isDisposed() && myCurrentRequests.add(flushRunnable)) {
|
||||
myFlushAlarm.addRequest(flushRunnable, millis, getStateForUpdate());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -647,7 +647,7 @@ public class FavoritesTreeViewPanel extends JPanel implements DataProvider {
|
||||
window.setTitleActions(collapseAction);
|
||||
|
||||
final DefaultActionGroup group = new DefaultActionGroup();
|
||||
if (!PlatformUtils.isCidr()) {
|
||||
if (!PlatformUtils.isAppCode()) {
|
||||
group.add(new FavoritesShowMembersAction(myProject, myBuilder));
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleUtil;
|
||||
import com.intellij.openapi.module.ModuleUtilCore;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ui.configuration.actions.ModuleDeleteProvider;
|
||||
import com.intellij.openapi.ui.Queryable;
|
||||
@@ -47,7 +47,7 @@ import com.intellij.openapi.util.AsyncResult;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.openapi.wm.ToolWindowManager;
|
||||
@@ -105,7 +105,7 @@ public class NavBarPanel extends JPanel implements DataProvider, PopupOwner, Dis
|
||||
private boolean myDisposed = false;
|
||||
private RelativePoint myLocationCache;
|
||||
|
||||
public NavBarPanel(final Project project, boolean docked) {
|
||||
public NavBarPanel(@NotNull Project project, boolean docked) {
|
||||
super(new FlowLayout(FlowLayout.LEFT, 0 , 0));
|
||||
myProject = project;
|
||||
myModel = createModel();
|
||||
@@ -119,6 +119,7 @@ public class NavBarPanel extends JPanel implements DataProvider, PopupOwner, Dis
|
||||
setBorder(new LineBorder(Gray._120, 1));
|
||||
}
|
||||
myCopyPasteDelegator = new CopyPasteDelegator(myProject, NavBarPanel.this) {
|
||||
@Override
|
||||
@NotNull
|
||||
protected PsiElement[] getSelectedElements() {
|
||||
final PsiElement element = getSelectedElement(PsiElement.class);
|
||||
@@ -251,10 +252,7 @@ public class NavBarPanel extends JPanel implements DataProvider, PopupOwner, Dis
|
||||
}
|
||||
|
||||
boolean isSelectedInPopup(Object object) {
|
||||
if (isNodePopupActive()) {
|
||||
return Arrays.asList(myNodePopup.getSelectedValues()).contains(object);
|
||||
}
|
||||
return false;
|
||||
return isNodePopupActive() && Arrays.asList(myNodePopup.getSelectedValues()).contains(object);
|
||||
}
|
||||
|
||||
static Object optimizeTarget(Object target) {
|
||||
@@ -393,12 +391,14 @@ public class NavBarPanel extends JPanel implements DataProvider, PopupOwner, Dis
|
||||
//installDnD(index, component);
|
||||
|
||||
ListenerUtil.addMouseListener(component, new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseReleased(final MouseEvent e) {
|
||||
if (SystemInfo.isWindows) {
|
||||
click(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mousePressed(final MouseEvent e) {
|
||||
if (!SystemInfo.isWindows) {
|
||||
click(e);
|
||||
@@ -532,6 +532,7 @@ public class NavBarPanel extends JPanel implements DataProvider, PopupOwner, Dis
|
||||
myUpdateQueue.queueRebuildUi();
|
||||
|
||||
myUpdateQueue.queueAfterAll(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
int index = myModel.indexOf(obj);
|
||||
if (index >= 0) {
|
||||
@@ -587,6 +588,7 @@ public class NavBarPanel extends JPanel implements DataProvider, PopupOwner, Dis
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Object getData(String dataId) {
|
||||
if (PlatformDataKeys.PROJECT.is(dataId)) {
|
||||
@@ -597,7 +599,7 @@ public class NavBarPanel extends JPanel implements DataProvider, PopupOwner, Dis
|
||||
if (module != null && !module.isDisposed()) return module;
|
||||
final PsiElement element = getSelectedElement(PsiElement.class);
|
||||
if (element != null) {
|
||||
return ModuleUtil.findModuleForPsiElement(element);
|
||||
return ModuleUtilCore.findModuleForPsiElement(element);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -606,7 +608,7 @@ public class NavBarPanel extends JPanel implements DataProvider, PopupOwner, Dis
|
||||
if (directory != null) {
|
||||
final VirtualFile dir = directory.getVirtualFile();
|
||||
if (ProjectRootsUtil.isModuleContentRoot(dir, myProject)) {
|
||||
return ModuleUtil.findModuleForPsiElement(directory);
|
||||
return ModuleUtilCore.findModuleForPsiElement(directory);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -642,7 +644,7 @@ public class NavBarPanel extends JPanel implements DataProvider, PopupOwner, Dis
|
||||
files.add(((PsiFileSystemItem)element).getVirtualFile());
|
||||
}
|
||||
}
|
||||
return files.size() > 0 ? VfsUtil.toVirtualFileArray(files) : null;
|
||||
return !files.isEmpty() ? VfsUtilCore.toVirtualFileArray(files) : null;
|
||||
}
|
||||
|
||||
if (PlatformDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
|
||||
@@ -712,6 +714,7 @@ public class NavBarPanel extends JPanel implements DataProvider, PopupOwner, Dis
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Point getBestPopupPosition() {
|
||||
int index = myModel.getSelectedIndex();
|
||||
final int modelSize = myModel.size();
|
||||
@@ -727,11 +730,13 @@ public class NavBarPanel extends JPanel implements DataProvider, PopupOwner, Dis
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addNotify() {
|
||||
super.addNotify();
|
||||
NavBarListener.subscribeTo(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeNotify() {
|
||||
super.removeNotify();
|
||||
Disposer.dispose(this);
|
||||
@@ -754,6 +759,7 @@ public class NavBarPanel extends JPanel implements DataProvider, PopupOwner, Dis
|
||||
panel.setBackground(UIUtil.isUnderGTKLookAndFeel() ? Color.WHITE : UIUtil.getListBackground());
|
||||
|
||||
myHint = new LightweightHint(panel) {
|
||||
@Override
|
||||
public void hide() {
|
||||
super.hide();
|
||||
cancelPopup();
|
||||
|
||||
@@ -672,7 +672,7 @@ public class ProjectViewImpl extends ProjectView implements PersistentStateCompo
|
||||
}).setAsSecondary(true);
|
||||
}
|
||||
|
||||
if (!PlatformUtils.isCidr()) {
|
||||
if (!PlatformUtils.isAppCode()) {
|
||||
myActionGroup.addAction(new PaneOptionAction(myShowMembers, IdeBundle.message("action.show.members"),
|
||||
IdeBundle.message("action.show.hide.members"),
|
||||
AllIcons.ObjectBrowser.ShowMembers, ourShowMembersDefaults))
|
||||
|
||||
@@ -59,7 +59,7 @@ public class PsiDirectoryNode extends BasePsiNode<PsiDirectory> implements Navig
|
||||
}
|
||||
|
||||
protected boolean shouldShowModuleName() {
|
||||
return !PlatformUtils.isCidr();
|
||||
return !PlatformUtils.isAppCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -136,7 +136,7 @@ public class PsiDirectoryNode extends BasePsiNode<PsiDirectory> implements Navig
|
||||
|
||||
protected void setupIcon(PresentationData data, PsiDirectory psiDirectory) {
|
||||
final VirtualFile virtualFile = psiDirectory.getVirtualFile();
|
||||
if (PlatformUtils.isCidr()) {
|
||||
if (PlatformUtils.isAppCode()) {
|
||||
final Icon icon = IconUtil.getIcon(virtualFile, 0, myProject);
|
||||
if (icon != null) {
|
||||
data.setIcon(patchIcon(icon, virtualFile));
|
||||
|
||||