mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge branch 'master' of git@git.labs.intellij.net:idea/community
This commit is contained in:
@@ -81,6 +81,7 @@ public class DebuggerExpressionComboBox extends DebuggerEditorImpl {
|
||||
myComboBox.setSelectedIndex(0);
|
||||
}
|
||||
|
||||
myComboBox.getEditor().setItem(item);
|
||||
myItem = item;
|
||||
}
|
||||
|
||||
@@ -158,6 +159,7 @@ public class DebuggerExpressionComboBox extends DebuggerEditorImpl {
|
||||
|
||||
setText(new TextWithImportsImpl(CodeFragmentKind.EXPRESSION, ""));
|
||||
myItem = createText("");
|
||||
setEnabled(true);
|
||||
}
|
||||
|
||||
public JComponent getPreferredFocusedComponent() {
|
||||
|
||||
@@ -34,7 +34,7 @@ public class AnonymousToInnerAction extends BaseRefactoringAction {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean isAvailableOnElementInEditorAndFile(final PsiElement element, final Editor editor, PsiFile file) {
|
||||
protected boolean isAvailableOnElementInEditorAndFile(final PsiElement element, final Editor editor, PsiFile file, DataContext context) {
|
||||
final PsiElement targetElement = file.findElementAt(editor.getCaretModel().getOffset());
|
||||
if (PsiTreeUtil.getParentOfType(targetElement, PsiAnonymousClass.class) != null) {
|
||||
return true;
|
||||
@@ -49,4 +49,4 @@ public class AnonymousToInnerAction extends BaseRefactoringAction {
|
||||
public RefactoringActionHandler getHandler(DataContext dataContext) {
|
||||
return new AnonymousToInnerHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ChangeSignatureAction extends BaseRefactoringAction {
|
||||
return elements.length == 1 && (elements[0] instanceof PsiMethod || elements[0] instanceof PsiClass);
|
||||
}
|
||||
|
||||
protected boolean isAvailableOnElementInEditorAndFile(final PsiElement element, final Editor editor, PsiFile file) {
|
||||
protected boolean isAvailableOnElementInEditorAndFile(final PsiElement element, final Editor editor, PsiFile file, DataContext context) {
|
||||
PsiElement targetMember = findTargetMember(file, editor);
|
||||
if (targetMember == null) return false;
|
||||
final ChangeSignatureHandler targetHandler = getChangeSignatureHandler(targetMember.getLanguage());
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ public class ConvertToInstanceMethodAction extends BaseRefactoringAction {
|
||||
return elements.length == 1 && elements[0] instanceof PsiMethod;
|
||||
}
|
||||
|
||||
protected boolean isAvailableOnElementInEditorAndFile(PsiElement element, final Editor editor, PsiFile file) {
|
||||
protected boolean isAvailableOnElementInEditorAndFile(PsiElement element, final Editor editor, PsiFile file, DataContext context) {
|
||||
if (element instanceof PsiIdentifier) element = element.getParent();
|
||||
return element instanceof PsiMethod && ((PsiMethod) element).hasModifierProperty(PsiModifier.STATIC);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class InvertBooleanAction extends BaseRefactoringAction {
|
||||
return elements.length == 1 && (elements[0] instanceof PsiMethod || elements[0] instanceof PsiVariable);
|
||||
}
|
||||
|
||||
protected boolean isAvailableOnElementInEditorAndFile(final PsiElement element, final Editor editor, PsiFile file) {
|
||||
protected boolean isAvailableOnElementInEditorAndFile(final PsiElement element, final Editor editor, PsiFile file, DataContext context) {
|
||||
if (element instanceof PsiVariable) {
|
||||
return PsiType.BOOLEAN.equals(((PsiVariable) element).getType());
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class MakeStaticAction extends BaseRefactoringAction {
|
||||
return (elements.length == 1) && (elements[0] instanceof PsiMethod) && !((PsiMethod)elements[0]).isConstructor();
|
||||
}
|
||||
|
||||
protected boolean isAvailableOnElementInEditorAndFile(PsiElement element, final Editor editor, PsiFile file) {
|
||||
protected boolean isAvailableOnElementInEditorAndFile(PsiElement element, final Editor editor, PsiFile file, DataContext context) {
|
||||
if (element instanceof PsiIdentifier) {
|
||||
element = element.getParent();
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class TempWithQueryAction extends BaseRefactoringAction{
|
||||
return new TempWithQueryHandler();
|
||||
}
|
||||
|
||||
protected boolean isAvailableOnElementInEditorAndFile(final PsiElement element, final Editor editor, PsiFile file) {
|
||||
protected boolean isAvailableOnElementInEditorAndFile(final PsiElement element, final Editor editor, PsiFile file, DataContext context) {
|
||||
return element instanceof PsiLocalVariable && ((PsiLocalVariable) element).getInitializer() != null;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -34,7 +34,7 @@ public class ChangeTypeSignatureAction extends BaseRefactoringAction {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected boolean isAvailableOnElementInEditorAndFile(final PsiElement element, final Editor editor, PsiFile file) {
|
||||
protected boolean isAvailableOnElementInEditorAndFile(final PsiElement element, final Editor editor, PsiFile file, DataContext context) {
|
||||
final PsiElement psiElement = file.findElementAt(editor.getCaretModel().getOffset());
|
||||
final PsiReferenceParameterList referenceParameterList = PsiTreeUtil.getParentOfType(psiElement, PsiReferenceParameterList.class);
|
||||
if (referenceParameterList != null) {
|
||||
@@ -46,4 +46,4 @@ public class ChangeTypeSignatureAction extends BaseRefactoringAction {
|
||||
public RefactoringActionHandler getHandler(DataContext dataContext) {
|
||||
return new ChangeTypeSignatureHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author mike
|
||||
*
|
||||
* @deprecated use {@link com.intellij.psi.impl.include.FileIncludeManager} instead
|
||||
*/
|
||||
public interface PsiIncludeManager {
|
||||
ExtensionPointName<PsiIncludeHandler> EP_NAME = new ExtensionPointName<PsiIncludeHandler>("com.intellij.psi.includeHandler");
|
||||
|
||||
@@ -207,8 +207,8 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable
|
||||
}
|
||||
|
||||
public void insertString(final int offset, @NotNull CharSequence s) {
|
||||
LOG.assertTrue(offset >= myShreds.get(0).prefix.length());
|
||||
LOG.assertTrue(offset <= getTextLength() - myShreds.get(myShreds.size() - 1).suffix.length());
|
||||
LOG.assertTrue(offset >= myShreds.get(0).prefix.length(), myShreds.get(0).prefix);
|
||||
LOG.assertTrue(offset <= getTextLength() - myShreds.get(myShreds.size() - 1).suffix.length(), myShreds.get(myShreds.size() - 1).suffix);
|
||||
if (isOneLine()) {
|
||||
s = StringUtil.replace(s.toString(), "\n", "");
|
||||
}
|
||||
|
||||
+7
@@ -20,10 +20,12 @@ import com.intellij.lang.LanguageRefactoringSupport;
|
||||
import com.intellij.lang.refactoring.RefactoringSupportProvider;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.actionSystem.LangDataKeys;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.extensions.ExtensionPointListener;
|
||||
import com.intellij.openapi.extensions.PluginDescriptor;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.refactoring.RefactoringActionHandler;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -77,6 +79,11 @@ public abstract class BasePlatformRefactoringAction extends BaseRefactoringActio
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isAvailableOnElementInEditorAndFile(PsiElement element, Editor editor, PsiFile file, DataContext context) {
|
||||
return getHandler(context) != null;
|
||||
}
|
||||
|
||||
protected boolean isAvailableForLanguage(final Language language) {
|
||||
List<RefactoringSupportProvider> providers = LanguageRefactoringSupport.INSTANCE.allForLanguage(language);
|
||||
return ContainerUtil.find(providers, myCondition) != null;
|
||||
|
||||
@@ -48,7 +48,7 @@ public abstract class BaseRefactoringAction extends AnAction {
|
||||
|
||||
protected abstract boolean isEnabledOnElements(PsiElement[] elements);
|
||||
|
||||
protected boolean isAvailableOnElementInEditorAndFile(final PsiElement element, final Editor editor, PsiFile file) {
|
||||
protected boolean isAvailableOnElementInEditorAndFile(final PsiElement element, final Editor editor, PsiFile file, DataContext context) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ public abstract class BaseRefactoringAction extends AnAction {
|
||||
|
||||
boolean isVisible = ContainerUtil.find(languages, myLanguageCondition) != null;
|
||||
if (isVisible) {
|
||||
boolean isEnabled = isAvailableOnElementInEditorAndFile(element, editor, file);
|
||||
boolean isEnabled = isAvailableOnElementInEditorAndFile(element, editor, file, dataContext);
|
||||
if (!isEnabled) {
|
||||
disableAction(e);
|
||||
}
|
||||
@@ -211,4 +211,4 @@ public abstract class BaseRefactoringAction extends AnAction {
|
||||
return filtered == null ? psiElements : filtered.toArray(new PsiElement[filtered.size()]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.intellij.lang.Language;
|
||||
import com.intellij.lang.refactoring.InlineActionHandler;
|
||||
import com.intellij.lang.refactoring.InlineHandlers;
|
||||
import com.intellij.lang.refactoring.RefactoringSupportProvider;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.psi.PsiElement;
|
||||
@@ -46,7 +47,7 @@ public class InlineAction extends BasePlatformRefactoringAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isAvailableOnElementInEditorAndFile(PsiElement element, Editor editor, PsiFile file) {
|
||||
protected boolean isAvailableOnElementInEditorAndFile(PsiElement element, Editor editor, PsiFile file, DataContext context) {
|
||||
return hasInlineActionHandler(element, PsiUtilBase.getLanguageInEditor(editor, element.getProject()), editor);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public class SafeDeleteAction extends BaseRefactoringAction {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected boolean isAvailableOnElementInEditorAndFile(final PsiElement element, final Editor editor, PsiFile file) {
|
||||
protected boolean isAvailableOnElementInEditorAndFile(final PsiElement element, final Editor editor, PsiFile file, DataContext context) {
|
||||
return SafeDeleteProcessor.validElement(element);
|
||||
}
|
||||
|
||||
@@ -53,4 +53,4 @@ public class SafeDeleteAction extends BaseRefactoringAction {
|
||||
return new SafeDeleteHandler();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,5 +21,6 @@ public enum EffectType {
|
||||
BOXED,
|
||||
STRIKEOUT,
|
||||
BOLD_LINE_UNDERSCORE,
|
||||
BOLD_DOTTED_LINE
|
||||
BOLD_DOTTED_LINE,
|
||||
SEARCH_MATCH
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import javax.swing.*;
|
||||
import javax.swing.border.Border;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -284,8 +285,8 @@ public class SimpleColoredComponent extends JComponent implements Accessible {
|
||||
|
||||
for (int i = 0; i < myAttributes.size(); i++) {
|
||||
SimpleTextAttributes attributes = myAttributes.get(i);
|
||||
if (font.getStyle() != attributes.getStyle()) { // derive font only if it is necessary
|
||||
font = font.deriveFont(attributes.getStyle());
|
||||
if (font.getStyle() != attributes.getFontStyle()) { // derive font only if it is necessary
|
||||
font = font.deriveFont(attributes.getFontStyle());
|
||||
}
|
||||
final FontMetrics metrics = getFontMetrics(font);
|
||||
width += metrics.stringWidth(myFragments.get(i));
|
||||
@@ -332,8 +333,8 @@ public class SimpleColoredComponent extends JComponent implements Accessible {
|
||||
|
||||
for (int i = 0; i < myAttributes.size(); i++) {
|
||||
SimpleTextAttributes attributes = myAttributes.get(i);
|
||||
if (font.getStyle() != attributes.getStyle()) { // derive font only if it is necessary
|
||||
font = font.deriveFont(attributes.getStyle());
|
||||
if (font.getStyle() != attributes.getFontStyle()) { // derive font only if it is necessary
|
||||
font = font.deriveFont(attributes.getFontStyle());
|
||||
}
|
||||
final FontMetrics metrics = getFontMetrics(font);
|
||||
final int curWidth = metrics.stringWidth(myFragments.get(i));
|
||||
@@ -401,16 +402,18 @@ public class SimpleColoredComponent extends JComponent implements Accessible {
|
||||
int textStart = xOffset;
|
||||
xOffset += myBorder.getBorderInsets(this).left;
|
||||
|
||||
final List<Object[]> searchMatches = new ArrayList<Object[]>();
|
||||
|
||||
// Paint text
|
||||
UIUtil.applyRenderingHints(g);
|
||||
for (int i = 0; i < myFragments.size(); i++) {
|
||||
final SimpleTextAttributes attributes = myAttributes.get(i);
|
||||
Font font = getFont();
|
||||
if (font.getStyle() != attributes.getStyle()) { // derive font only if it is necessary
|
||||
font = font.deriveFont(attributes.getStyle());
|
||||
Font font = g.getFont();
|
||||
if (font.getStyle() != attributes.getFontStyle()) { // derive font only if it is necessary
|
||||
font = font.deriveFont(attributes.getFontStyle());
|
||||
}
|
||||
g.setFont(font);
|
||||
final FontMetrics metrics = getFontMetrics(font);
|
||||
final FontMetrics metrics = g.getFontMetrics(font);
|
||||
|
||||
final String fragment = myFragments.get(i);
|
||||
final int fragmentWidth = metrics.stringWidth(fragment);
|
||||
@@ -431,7 +434,8 @@ public class SimpleColoredComponent extends JComponent implements Accessible {
|
||||
g.setColor(color);
|
||||
|
||||
final int textBaseline = (getHeight() - metrics.getHeight()) / 2 + metrics.getAscent();
|
||||
g.drawString(fragment, xOffset, textBaseline);
|
||||
|
||||
if (!attributes.isSearchMatch()) g.drawString(fragment, xOffset, textBaseline);
|
||||
|
||||
// 1. Strikeout effect
|
||||
if (attributes.isStrikeout()) {
|
||||
@@ -461,6 +465,10 @@ public class SimpleColoredComponent extends JComponent implements Accessible {
|
||||
UIUtil.drawBoldDottedLine((Graphics2D)g, xOffset, xOffset + fragmentWidth, dottedAt, bgColor, lineColor, isOpaque());
|
||||
}
|
||||
|
||||
if (attributes.isSearchMatch()) {
|
||||
searchMatches.add(new Object[] {xOffset, xOffset + fragmentWidth, textBaseline, fragment, g.getFont()});
|
||||
}
|
||||
|
||||
final Integer fixedWidth = myAligns.get(i);
|
||||
if (fixedWidth != null && fragmentWidth < fixedWidth.intValue()) {
|
||||
//if (fixedWidth != null) {
|
||||
@@ -479,6 +487,14 @@ public class SimpleColoredComponent extends JComponent implements Accessible {
|
||||
myBorder.paintBorder(this, g, textStart, 0, getWidth() - textStart, getHeight());
|
||||
}
|
||||
}
|
||||
|
||||
// draw search matches after all
|
||||
for (final Object[] info: searchMatches) {
|
||||
UIUtil.drawSearchMatch((Graphics2D)g, (Integer) info[0], (Integer) info[1], getHeight());
|
||||
g.setFont((Font) info[4]);
|
||||
g.setColor(new Color(50, 50, 50));
|
||||
g.drawString((String) info[3], (Integer) info[0], (Integer) info[2]);
|
||||
}
|
||||
}
|
||||
|
||||
private static void checkCanPaint(Graphics g) {
|
||||
|
||||
@@ -34,6 +34,7 @@ public final class SimpleTextAttributes {
|
||||
public static final int STYLE_WAVED = STYLE_STRIKEOUT << 1;
|
||||
public static final int STYLE_UNDERLINE = STYLE_WAVED << 1;
|
||||
public static final int STYLE_BOLD_DOTTED_LINE = STYLE_UNDERLINE << 1;
|
||||
public static final int STYLE_SEARCH_MATCH = STYLE_BOLD_DOTTED_LINE << 1;
|
||||
|
||||
private final Color myBgColor;
|
||||
private final Color myFgColor;
|
||||
@@ -68,9 +69,10 @@ public final class SimpleTextAttributes {
|
||||
}
|
||||
|
||||
public SimpleTextAttributes(final Color bgColor, final Color fgColor, final Color waveColor, final int style) {
|
||||
if((~(STYLE_PLAIN | STYLE_BOLD | STYLE_ITALIC | STYLE_STRIKEOUT | STYLE_WAVED | STYLE_UNDERLINE | STYLE_BOLD_DOTTED_LINE) & style) != 0){
|
||||
if((~(STYLE_PLAIN | STYLE_BOLD | STYLE_ITALIC | STYLE_STRIKEOUT | STYLE_WAVED | STYLE_UNDERLINE | STYLE_BOLD_DOTTED_LINE | STYLE_SEARCH_MATCH) & style) != 0){
|
||||
throw new IllegalArgumentException("wrong style: "+style);
|
||||
}
|
||||
|
||||
myFgColor = fgColor;
|
||||
myWaveColor = waveColor;
|
||||
myStyle = style;
|
||||
@@ -130,6 +132,10 @@ public final class SimpleTextAttributes {
|
||||
return (myStyle & STYLE_BOLD_DOTTED_LINE) != 0;
|
||||
}
|
||||
|
||||
public boolean isSearchMatch() {
|
||||
return (myStyle & STYLE_SEARCH_MATCH) != 0;
|
||||
}
|
||||
|
||||
public static SimpleTextAttributes fromTextAttributes(TextAttributes attributes) {
|
||||
if (attributes == null) return REGULAR_ATTRIBUTES;
|
||||
|
||||
@@ -151,6 +157,9 @@ public final class SimpleTextAttributes {
|
||||
else if (effectType == EffectType.BOLD_DOTTED_LINE) {
|
||||
style |= STYLE_UNDERLINE;
|
||||
}
|
||||
else if (effectType == EffectType.SEARCH_MATCH) {
|
||||
style |= STYLE_SEARCH_MATCH;
|
||||
}
|
||||
else{
|
||||
// not supported
|
||||
}
|
||||
@@ -158,6 +167,10 @@ public final class SimpleTextAttributes {
|
||||
return new SimpleTextAttributes(attributes.getBackgroundColor(), foregroundColor, attributes.getEffectColor(), style);
|
||||
}
|
||||
|
||||
public int getFontStyle() {
|
||||
return myStyle & FONT_MASK;
|
||||
}
|
||||
|
||||
public TextAttributes toTextAttributes() {
|
||||
Color effectColor;
|
||||
EffectType effectType;
|
||||
@@ -176,6 +189,10 @@ public final class SimpleTextAttributes {
|
||||
effectColor = myWaveColor;
|
||||
effectType = EffectType.BOLD_DOTTED_LINE;
|
||||
}
|
||||
else if (isSearchMatch()) {
|
||||
effectColor = myWaveColor;
|
||||
effectType = EffectType.SEARCH_MATCH;
|
||||
}
|
||||
else{
|
||||
effectColor = null;
|
||||
effectType = null;
|
||||
|
||||
@@ -32,7 +32,6 @@ import com.intellij.ui.components.JBList;
|
||||
import com.intellij.util.Alarm;
|
||||
import com.intellij.util.Consumer;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -408,13 +407,15 @@ public class SearchUtil {
|
||||
int idx = 0;
|
||||
for (String word : selectedWords) {
|
||||
text = text.substring(idx);
|
||||
textRenderer.append(text.substring(0, text.indexOf(word)), new SimpleTextAttributes(background, foreground, null, style));
|
||||
final String before = text.substring(0, text.indexOf(word));
|
||||
if (before.length() > 0) textRenderer.append(before, new SimpleTextAttributes(background, foreground, null, style));
|
||||
idx = text.indexOf(word) + word.length();
|
||||
textRenderer.append(text.substring(idx - word.length(), idx), new SimpleTextAttributes(UIUtil.getTreeSelectionBackground(),
|
||||
UIUtil.getTreeSelectionForeground(), null,
|
||||
style));
|
||||
textRenderer.append(text.substring(idx - word.length(), idx), new SimpleTextAttributes(background,
|
||||
foreground, null,
|
||||
style | SimpleTextAttributes.STYLE_SEARCH_MATCH));
|
||||
}
|
||||
textRenderer.append(text.substring(idx, text.length()), new SimpleTextAttributes(background, foreground, null, style));
|
||||
final String after = text.substring(idx, text.length());
|
||||
if (after.length() > 0) textRenderer.append(after, new SimpleTextAttributes(background, foreground, null, style));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@
|
||||
<extensionPoint name="hectorComponentProvider" interface="com.intellij.openapi.editor.HectorComponentPanelsProvider" area="IDEA_PROJECT"/>
|
||||
<extensionPoint name="scopeTreeExpander" interface="com.intellij.ide.scopeView.ScopeTreeStructureExpander" area="IDEA_PROJECT"/>
|
||||
|
||||
<extensionPoint name="lang.elementManipulator" interface="com.intellij.openapi.fileTypes.ClassExtensionPoint"/>
|
||||
<extensionPoint name="lang.elementManipulator" beanClass="com.intellij.openapi.fileTypes.ClassExtensionPoint"/>
|
||||
<extensionPoint name="fileContextProvider" interface="com.intellij.psi.FileContextProvider" area="IDEA_PROJECT"/>
|
||||
<extensionPoint name="psi.fileReferenceHelper" interface="com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReferenceHelper"/>
|
||||
|
||||
@@ -260,9 +260,9 @@
|
||||
|
||||
<extensionPoint name="pom.declarationSearcher" interface="com.intellij.pom.PomDeclarationSearcher"/>
|
||||
|
||||
<extensionPoint name="statistician" interface="com.intellij.psi.statistics.StatisticsExtensionPoint"/>
|
||||
<extensionPoint name="weigher" interface="com.intellij.psi.WeigherExtensionPoint"/>
|
||||
<extensionPoint name="completion.contributor" interface="com.intellij.codeInsight.completion.CompletionContributorEP"/>
|
||||
<extensionPoint name="statistician" beanClass="com.intellij.psi.statistics.StatisticsExtensionPoint"/>
|
||||
<extensionPoint name="weigher" beanClass="com.intellij.psi.WeigherExtensionPoint"/>
|
||||
<extensionPoint name="completion.contributor" beanClass="com.intellij.codeInsight.completion.CompletionContributorEP"/>
|
||||
<extensionPoint name="completion.skip" interface="com.intellij.codeInsight.completion.CompletionPreselectSkipper"/>
|
||||
<extensionPoint name="lookup.charFilter" interface="com.intellij.codeInsight.lookup.CharFilter"/>
|
||||
<extensionPoint name="lookup.actionProvider" interface="com.intellij.codeInsight.lookup.LookupActionProvider"/>
|
||||
@@ -277,7 +277,6 @@
|
||||
beanClass="com.intellij.lang.LanguageExtensionPoint"/>
|
||||
<extensionPoint name="lang.lineWrapStrategy"
|
||||
beanClass="com.intellij.lang.LanguageExtensionPoint"/>
|
||||
<extensionPoint name="psi.includeHandler" interface="com.intellij.psi.PsiIncludeManager$PsiIncludeHandler" area="IDEA_PROJECT"/>
|
||||
|
||||
<extensionPoint name="gotoDeclarationHandler"
|
||||
interface="com.intellij.codeInsight.navigation.actions.GotoDeclarationHandler"/>
|
||||
@@ -304,7 +303,7 @@
|
||||
<extensionPoint name="readWriteAccessDetector" interface="com.intellij.codeInsight.highlighting.ReadWriteAccessDetector"/>
|
||||
|
||||
<extensionPoint name="scopeParserExtension" interface="com.intellij.psi.search.scope.packageSet.PackageSetParserExtension"/>
|
||||
<extensionPoint name="referenceProviderType" interface="com.intellij.util.KeyedLazyInstanceEP"/>
|
||||
<extensionPoint name="referenceProviderType" beanClass="com.intellij.util.KeyedLazyInstanceEP"/>
|
||||
<extensionPoint name="colorSettingsPage"
|
||||
interface="com.intellij.openapi.options.colors.ColorSettingsPage"/>
|
||||
|
||||
@@ -343,7 +342,7 @@
|
||||
<extensionPoint name="codeInsight.lineMarkerProvider" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
|
||||
<extensionPoint name="codeInsight.surroundWithRangeAdjuster" interface="com.intellij.codeInsight.generation.surroundWith.SurroundWithRangeAdjuster"/>
|
||||
|
||||
<extensionPoint name="lang.substitutor" interface="com.intellij.lang.LanguageExtensionPoint"/>
|
||||
<extensionPoint name="lang.substitutor" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
|
||||
|
||||
<extensionPoint name="createFromTemplateActionReplacer"
|
||||
interface="com.intellij.ide.fileTemplates.CreateFromTemplateActionReplacer"/>
|
||||
@@ -380,9 +379,9 @@
|
||||
interface="com.intellij.openapi.roots.ui.configuration.ModuleConfigurationEditorProvider"
|
||||
area="IDEA_MODULE"/>
|
||||
|
||||
<extensionPoint name="callHierarchyProvider" interface="com.intellij.lang.LanguageExtensionPoint"/>
|
||||
<extensionPoint name="methodHierarchyProvider" interface="com.intellij.lang.LanguageExtensionPoint"/>
|
||||
<extensionPoint name="typeHierarchyProvider" interface="com.intellij.lang.LanguageExtensionPoint"/>
|
||||
<extensionPoint name="callHierarchyProvider" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
|
||||
<extensionPoint name="methodHierarchyProvider" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
|
||||
<extensionPoint name="typeHierarchyProvider" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
|
||||
|
||||
<extensionPoint name="editorAppearanceConfigurable" interface="com.intellij.openapi.options.UnnamedConfigurable"/>
|
||||
<extensionPoint name="editorSmartKeysConfigurable" interface="com.intellij.openapi.options.UnnamedConfigurable"/>
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
interface="com.intellij.projectImport.ProjectOpenProcessor"/>
|
||||
|
||||
<extensionPoint name="codeInsight.linkHandler"
|
||||
interface="com.intellij.codeInsight.hint.TooltipLinkHandlerEP"/>
|
||||
beanClass="com.intellij.codeInsight.hint.TooltipLinkHandlerEP"/>
|
||||
|
||||
<extensionPoint name="directoryProjectConfigurator"
|
||||
interface="com.intellij.platform.DirectoryProjectConfigurator"/>
|
||||
|
||||
@@ -233,8 +233,6 @@
|
||||
<syntaxHighlighter key="IDEA_WORKSPACE" implementationClass="com.intellij.ide.highlighter.XmlFileHighlighter"/>
|
||||
<syntaxHighlighter key="GUI_DESIGNER_FORM" implementationClass="com.intellij.ide.highlighter.XmlFileHighlighter"/>
|
||||
|
||||
<psi.includeHandler implementation="com.intellij.xml.util.XmlIncludeHandler"/>
|
||||
|
||||
<enterHandlerDelegate implementation="com.intellij.codeInsight.editorActions.EnterBetweenXmlTagsHandler" id="xmlEnter"/>
|
||||
|
||||
<declarationRangeHandler key="com.intellij.psi.xml.XmlTag"
|
||||
|
||||
+6
-3
@@ -29,7 +29,7 @@ import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
|
||||
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings;
|
||||
import com.intellij.codeInsight.daemon.HighlightDisplayKey;
|
||||
import com.intellij.codeInsight.daemon.impl.*;
|
||||
import com.intellij.codeInsight.highlighting.HighlightUsagesHandler;
|
||||
import com.intellij.codeInsight.highlighting.actions.HighlightUsagesAction;
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler;
|
||||
import com.intellij.codeInsight.lookup.LookupElement;
|
||||
@@ -621,7 +621,7 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
public Presentation testAction(AnAction action) {
|
||||
DataContext context = DataManager.getInstance().getDataContext(getEditor().getComponent());
|
||||
TestActionEvent e = new TestActionEvent(context, action);
|
||||
action.update(e);
|
||||
action.beforeActionPerformedUpdate(e);
|
||||
if (e.getPresentation().isVisible() && e.getPresentation().isVisible()) {
|
||||
action.actionPerformed(e);
|
||||
}
|
||||
@@ -653,8 +653,11 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
|
||||
public RangeHighlighter[] testHighlightUsages(final String... files) {
|
||||
configureByFiles(files);
|
||||
testAction(new HighlightUsagesAction());
|
||||
final Editor editor = getEditor();
|
||||
HighlightUsagesHandler.invoke(getProject(), editor, getFile());
|
||||
//final Editor editor = PlatformDataKeys.EDITOR.getData(DataManager.getInstance().getDataContext());
|
||||
//assert editor != null;
|
||||
//HighlightUsagesHandler.invoke(getProject(), editor, getFile());
|
||||
return editor.getMarkupModel().getAllHighlighters();
|
||||
}
|
||||
|
||||
|
||||
@@ -721,6 +721,20 @@ public class UIUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static void drawSearchMatch(final Graphics2D g,
|
||||
final int startX,
|
||||
final int endX,
|
||||
final int height) {
|
||||
g.setColor(new Color(100, 100, 100, 50));
|
||||
g.fillRoundRect(startX - 2, 2, endX - startX + 4, height - 4, 4, 4);
|
||||
|
||||
g.setPaint(new GradientPaint(startX, 2, new Color(255, 234, 162), startX, height - 5, new Color(255, 208, 66)));
|
||||
g.fillRoundRect(startX - 2, 2, endX - startX + 3, height - 5, 6, 6);
|
||||
|
||||
g.setColor(new Color(170, 170, 170, 200));
|
||||
g.drawRoundRect(startX - 2, 2, endX - startX + 3, height - 5, 4, 4);
|
||||
}
|
||||
|
||||
private static void drawBoringDottedLine(final Graphics2D g,
|
||||
final int startX,
|
||||
final int endX,
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
<extensionPoint name="positionManagerDelegate" interface="org.jetbrains.plugins.groovy.extensions.debugger.ScriptPositionManagerHelper"/>
|
||||
<extensionPoint name="compilerExtension" interface="org.jetbrains.plugins.groovy.compiler.GroovyCompilerExtension"/>
|
||||
<extensionPoint name="scriptType" interface="org.jetbrains.plugins.groovy.extensions.GroovyScriptTypeEP"/>
|
||||
<extensionPoint name="scriptType" beanClass="org.jetbrains.plugins.groovy.extensions.GroovyScriptTypeEP"/>
|
||||
|
||||
<!-- Groovy DSL extension points -->
|
||||
<extensionPoint name="psiEnhancerCategory" interface="org.jetbrains.plugins.groovy.dsl.psi.PsiEnhancerCategory"/>
|
||||
|
||||
+2
-2
@@ -46,7 +46,7 @@ public class GroovyCodeStyleFormatterTest extends GroovyFormatterTestCase {
|
||||
final String[] strings = matcher.group(1).split("=");
|
||||
String name = strings[0];
|
||||
final CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
|
||||
final Field field = CodeStyleSettings.class.getDeclaredField(name);
|
||||
final Field field = CodeStyleSettings.class.getField(name);
|
||||
final String value = strings[1];
|
||||
if ("true".equals(value) || "false".equals(value)) {
|
||||
field.set(settings, Boolean.parseBoolean(value));
|
||||
@@ -55,7 +55,7 @@ public class GroovyCodeStyleFormatterTest extends GroovyFormatterTestCase {
|
||||
field.set(settings, Integer.parseInt(value));
|
||||
}
|
||||
catch (NumberFormatException e) {
|
||||
field.set(settings, CodeStyleSettings.class.getDeclaredField(value).get(value));
|
||||
field.set(settings, CodeStyleSettings.class.getField(value).get(value));
|
||||
}
|
||||
}
|
||||
input = input.substring(matcher.end());
|
||||
|
||||
+3
-3
@@ -72,8 +72,8 @@ public class ExtractManagedDependenciesAction extends BaseRefactoringAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isAvailableOnElementInEditorAndFile(PsiElement element, Editor editor, PsiFile file) {
|
||||
if (!super.isAvailableOnElementInEditorAndFile(element, editor, file)) return false;
|
||||
protected boolean isAvailableOnElementInEditorAndFile(PsiElement element, Editor editor, PsiFile file, DataContext context) {
|
||||
if (!super.isAvailableOnElementInEditorAndFile(element, editor, file, context)) return false;
|
||||
return findDependencyAndParent(file, editor) != null;
|
||||
}
|
||||
|
||||
@@ -254,4 +254,4 @@ public class ExtractManagedDependenciesAction extends BaseRefactoringAction {
|
||||
myExtractExclusions = extractExclusions;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -75,8 +75,8 @@ public class IntroducePropertyAction extends BaseRefactoringAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isAvailableOnElementInEditorAndFile(PsiElement element, Editor editor, PsiFile file) {
|
||||
if (!super.isAvailableOnElementInEditorAndFile(element, editor, file)) return false;
|
||||
protected boolean isAvailableOnElementInEditorAndFile(PsiElement element, Editor editor, PsiFile file, DataContext context) {
|
||||
if (!super.isAvailableOnElementInEditorAndFile(element, editor, file, context)) return false;
|
||||
return getSelectedElementAndTextRange(editor, file) != null;
|
||||
}
|
||||
|
||||
@@ -359,4 +359,4 @@ public class IntroducePropertyAction extends BaseRefactoringAction {
|
||||
}
|
||||
return isInsideProperty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
interface="com.intellij.util.xml.DomFileDescription"/>
|
||||
|
||||
<extensionPoint name="dom.implementation"
|
||||
interface="com.intellij.util.xml.impl.DomImplementationClassEP"/>
|
||||
beanClass="com.intellij.util.xml.impl.DomImplementationClassEP"/>
|
||||
|
||||
<extensionPoint name="dom.extender"
|
||||
interface="com.intellij.util.xml.reflect.DomExtenderEP"/>
|
||||
beanClass="com.intellij.util.xml.reflect.DomExtenderEP"/>
|
||||
|
||||
<extensionPoint name="dom.customAnnotationChecker"
|
||||
interface="com.intellij.util.xml.highlighting.DomCustomAnnotationChecker"/>
|
||||
|
||||
Reference in New Issue
Block a user