mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
+2
-2
@@ -19,10 +19,10 @@ import com.intellij.codeInsight.completion.CompletionParameters;
|
||||
import com.intellij.codeInsight.completion.CompletionProvider;
|
||||
import com.intellij.codeInsight.completion.CompletionResultSet;
|
||||
import com.intellij.codeInsight.template.CustomTemplateCallback;
|
||||
import com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor;
|
||||
import com.intellij.codeInsight.template.postfix.settings.PostfixTemplatesSettings;
|
||||
import com.intellij.codeInsight.template.postfix.templates.PostfixLiveTemplate;
|
||||
import com.intellij.codeInsight.template.postfix.templates.PostfixTemplate;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.patterns.StandardPatterns;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.util.ProcessingContext;
|
||||
@@ -33,7 +33,7 @@ import static com.intellij.codeInsight.template.postfix.completion.PostfixTempla
|
||||
class PostfixTemplatesCompletionProvider extends CompletionProvider<CompletionParameters> {
|
||||
@Override
|
||||
protected void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet result) {
|
||||
if (!isCompletionEnabled(parameters) || Registry.is("show.live.templates.in.completion")) {
|
||||
if (!isCompletionEnabled(parameters) || LiveTemplateCompletionContributor.shouldShowAllTemplates()) {
|
||||
/**
|
||||
* disabled or covered with {@link com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor}
|
||||
*/
|
||||
|
||||
+4
-16
@@ -19,30 +19,18 @@ import com.intellij.JavaTestUtil;
|
||||
import com.intellij.codeInsight.completion.CompletionAutoPopupTestCase;
|
||||
import com.intellij.codeInsight.lookup.LookupElement;
|
||||
import com.intellij.codeInsight.lookup.impl.LookupImpl;
|
||||
import com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor;
|
||||
import com.intellij.codeInsight.template.postfix.settings.PostfixTemplatesSettings;
|
||||
import com.intellij.codeInsight.template.postfix.templates.*;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.util.registry.RegistryValue;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class TemplatesCompletionTest extends CompletionAutoPopupTestCase {
|
||||
|
||||
private boolean oldRegistryValue;
|
||||
|
||||
@Override
|
||||
public void setUp() {
|
||||
super.setUp();
|
||||
RegistryValue registryValue = Registry.get("show.live.templates.in.completion");
|
||||
oldRegistryValue = registryValue.asBoolean();
|
||||
registryValue.setValue(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tearDown() throws Exception {
|
||||
RegistryValue registryValue = Registry.get("show.live.templates.in.completion");
|
||||
registryValue.setValue(oldRegistryValue);
|
||||
LiveTemplateCompletionContributor.ourShowTemplatesInTests = false;
|
||||
|
||||
PostfixTemplatesSettings settings = PostfixTemplatesSettings.getInstance();
|
||||
assertNotNull(settings);
|
||||
@@ -53,13 +41,13 @@ public class TemplatesCompletionTest extends CompletionAutoPopupTestCase {
|
||||
}
|
||||
|
||||
public void testSimpleCompletionList() {
|
||||
Registry.get("show.live.templates.in.completion").setValue(true);
|
||||
LiveTemplateCompletionContributor.ourShowTemplatesInTests = true;
|
||||
|
||||
doAutoPopupTest("ins", InstanceofExpressionPostfixTemplate.class);
|
||||
}
|
||||
|
||||
public void testAutopopupWithEnabledLiveTemplatesInCompletion() {
|
||||
Registry.get("show.live.templates.in.completion").setValue(true);
|
||||
LiveTemplateCompletionContributor.ourShowTemplatesInTests = true;
|
||||
|
||||
configureByFile();
|
||||
type("instanceof");
|
||||
|
||||
@@ -22,14 +22,19 @@ import com.intellij.find.replaceInProject.ReplaceInProjectManager;
|
||||
import com.intellij.lang.properties.IProperty;
|
||||
import com.intellij.lang.properties.psi.PropertiesFile;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.Result;
|
||||
import com.intellij.openapi.application.ex.PathManagerEx;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.command.WriteCommandAction;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.fileTypes.FileTypes;
|
||||
import com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.util.ProperTextRange;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
@@ -279,6 +284,45 @@ public class FindManagerTest extends DaemonAnalyzerTestCase {
|
||||
assertSize(2, findUsages(findModel));
|
||||
}
|
||||
|
||||
public void testWholeWordsInNonIndexedFiles() throws Exception {
|
||||
createFile(myModule, "A.test123", "foo fo foo");
|
||||
|
||||
// don't use createFile here because it creates PsiFile and runs file type autodetection
|
||||
// in real life some files might not be autodetected as plain text until the search starts
|
||||
VirtualFile custom = new WriteCommandAction<VirtualFile>(myProject) {
|
||||
@Override
|
||||
protected void run(@NotNull Result<VirtualFile> result) throws Throwable {
|
||||
File dir = createTempDirectory();
|
||||
File file = new File(dir.getPath(), "A.test1234");
|
||||
file.createNewFile();
|
||||
FileUtil.writeToFile(file, "foo fo foo");
|
||||
addSourceContentToRoots(myModule, VfsUtil.findFileByIoFile(dir, true));
|
||||
result.setResult(VfsUtil.findFileByIoFile(file, true));
|
||||
}
|
||||
}.execute().getResultObject();
|
||||
|
||||
assertNull(FileDocumentManager.getInstance().getCachedDocument(custom));
|
||||
assertEquals(FileTypes.UNKNOWN, custom.getFileType());
|
||||
assertFalse(FileTypeManagerImpl.isFileTypeDetectedFromContent(custom));
|
||||
|
||||
FindModel findModel = new FindModel();
|
||||
findModel.setWholeWordsOnly(true);
|
||||
findModel.setFromCursor(false);
|
||||
findModel.setGlobal(true);
|
||||
findModel.setMultipleFiles(true);
|
||||
findModel.setProjectScope(true);
|
||||
|
||||
findModel.setStringToFind("fo");
|
||||
assertSize(2, findUsages(findModel));
|
||||
|
||||
// and we should get the same with text loaded
|
||||
assertNotNull(FileDocumentManager.getInstance().getDocument(custom));
|
||||
assertEquals(FileTypes.PLAIN_TEXT, custom.getFileType());
|
||||
assertTrue(FileTypeManagerImpl.isFileTypeDetectedFromContent(custom));
|
||||
|
||||
assertSize(2, findUsages(findModel));
|
||||
}
|
||||
|
||||
public void testReplaceRegexp() {
|
||||
FindModel findModel = new FindModel();
|
||||
findModel.setStringToFind("bug_(?=here)");
|
||||
|
||||
@@ -19,9 +19,11 @@ package com.intellij.psi.impl.source.tree;
|
||||
import com.intellij.lang.ASTFactory;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.tree.TokenSet;
|
||||
import com.intellij.reference.SoftReference;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.text.CharArrayUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -29,6 +31,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public abstract class LeafElement extends TreeElement {
|
||||
private static final Logger LOG = Logger.getInstance("com.intellij.psi.impl.source.tree.LeafElement");
|
||||
private static final Key<SoftReference<String>> CACHED_TEXT = Key.create("CACHED_TEXT");
|
||||
|
||||
private static final int TEXT_MATCHES_THRESHOLD = 5;
|
||||
|
||||
@@ -58,6 +61,15 @@ public abstract class LeafElement extends TreeElement {
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
if (myText.length() > 1000 && !(myText instanceof String)) { // e.g. a large text file
|
||||
String text = SoftReference.dereference(getUserData(CACHED_TEXT));
|
||||
if (text == null) {
|
||||
text = myText.toString();
|
||||
putUserData(CACHED_TEXT, new SoftReference<String>(text));
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
return myText.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ public interface RangeHighlighter extends RangeMarker {
|
||||
*
|
||||
* @return the highlighter target area.
|
||||
*/
|
||||
@NotNull
|
||||
HighlighterTargetArea getTargetArea();
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface RangeHighlighterEx extends RangeHighlighter, RangeMarkerEx {
|
||||
boolean isAfterEndOfLine();
|
||||
void setAfterEndOfLine(boolean val);
|
||||
void setAfterEndOfLine(boolean value);
|
||||
|
||||
int getAffectedAreaStartOffset();
|
||||
|
||||
|
||||
+3
-2
@@ -97,6 +97,7 @@ class RangeHighlighterImpl extends RangeMarkerImpl implements RangeHighlighterEx
|
||||
return node == null ? -1 : node.myLayer;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public HighlighterTargetArea getTargetArea() {
|
||||
return getData().getTargetArea();
|
||||
@@ -209,8 +210,8 @@ class RangeHighlighterImpl extends RangeMarkerImpl implements RangeHighlighterEx
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAfterEndOfLine(boolean afterEndOfLine) {
|
||||
getData().setAfterEndOfLine(afterEndOfLine);
|
||||
public void setAfterEndOfLine(boolean value) {
|
||||
getData().setAfterEndOfLine(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -122,7 +122,7 @@ public class IdIndex extends FileBasedIndexExtension<IdIndexEntry, Integer> {
|
||||
return myInputFilter;
|
||||
}
|
||||
|
||||
private static boolean isIndexable(FileType fileType) {
|
||||
public static boolean isIndexable(FileType fileType) {
|
||||
return fileType instanceof LanguageFileType ||
|
||||
fileType instanceof CustomSyntaxTableFileType ||
|
||||
IdTableBuilding.isIdIndexerRegistered(fileType) ||
|
||||
|
||||
+1
-1
@@ -199,7 +199,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
" will move caret down and up in the editor", null);
|
||||
}
|
||||
} else if (DumbService.isDumb(getProject())) {
|
||||
myLookup.addAdvertisement("Completion results might be incomplete until indexing is complete", MessageType.WARNING.getPopupBackground());
|
||||
myLookup.addAdvertisement("The results might be incomplete while indexing is in progress", MessageType.WARNING.getPopupBackground());
|
||||
}
|
||||
|
||||
ProgressManager.checkCanceled();
|
||||
|
||||
+11
-1
@@ -20,6 +20,7 @@ import com.intellij.codeInsight.lookup.LookupElement;
|
||||
import com.intellij.codeInsight.template.CustomLiveTemplate;
|
||||
import com.intellij.codeInsight.template.CustomTemplateCallback;
|
||||
import com.intellij.codeInsight.template.TemplateContextType;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
@@ -41,6 +42,15 @@ import static com.intellij.codeInsight.template.impl.ListTemplatesHandler.listAp
|
||||
* @author peter
|
||||
*/
|
||||
public class LiveTemplateCompletionContributor extends CompletionContributor {
|
||||
public static boolean ourShowTemplatesInTests = false;
|
||||
|
||||
public static boolean shouldShowAllTemplates() {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
return ourShowTemplatesInTests;
|
||||
}
|
||||
return Registry.is("show.live.templates.in.completion");
|
||||
}
|
||||
|
||||
public LiveTemplateCompletionContributor() {
|
||||
extend(CompletionType.BASIC, PlatformPatterns.psiElement(), new CompletionProvider<CompletionParameters>() {
|
||||
@Override
|
||||
@@ -84,7 +94,7 @@ public class LiveTemplateCompletionContributor extends CompletionContributor {
|
||||
|
||||
@SuppressWarnings("MethodMayBeStatic") //for Kotlin
|
||||
protected boolean showAllTemplates() {
|
||||
return Registry.is("show.live.templates.in.completion");
|
||||
return shouldShowAllTemplates();
|
||||
}
|
||||
|
||||
private static void ensureTemplatesShown(Ref<Boolean> templatesShown,
|
||||
|
||||
@@ -41,6 +41,8 @@ class ConsoleGutterComponent extends JComponent implements MouseMotionListener {
|
||||
addListeners();
|
||||
|
||||
addMouseMotionListener(this);
|
||||
|
||||
setOpaque(true);
|
||||
}
|
||||
|
||||
private void addListeners() {
|
||||
@@ -68,6 +70,8 @@ class ConsoleGutterComponent extends JComponent implements MouseMotionListener {
|
||||
}
|
||||
|
||||
private void computeMaxAnnotationWidth() {
|
||||
gutterContentProvider.beforeUiComponentUpdate(editor);
|
||||
|
||||
if (!gutterContentProvider.hasText()) {
|
||||
maxAnnotationWidth = 0;
|
||||
return;
|
||||
@@ -75,7 +79,6 @@ class ConsoleGutterComponent extends JComponent implements MouseMotionListener {
|
||||
|
||||
FontMetrics fontMetrics = editor.getFontMetrics(Font.PLAIN);
|
||||
int lineCount = editor.getDocument().getLineCount();
|
||||
gutterContentProvider.beforeUiComponentUpdate(editor);
|
||||
int gutterSize = 0;
|
||||
for (int i = 0; i < lineCount; i++) {
|
||||
String text = gutterContentProvider.getText(i, editor);
|
||||
@@ -101,9 +104,6 @@ class ConsoleGutterComponent extends JComponent implements MouseMotionListener {
|
||||
return;
|
||||
}
|
||||
|
||||
g.setColor(editor.getBackgroundColor());
|
||||
g.fillRect(clip.x, clip.y, clip.width, clip.height);
|
||||
|
||||
UISettings.setupAntialiasing(g);
|
||||
|
||||
Graphics2D g2 = (Graphics2D)g;
|
||||
|
||||
@@ -27,4 +27,8 @@ public abstract class GutterContentProvider {
|
||||
public abstract void doAction(int line, @NotNull Editor editor);
|
||||
|
||||
public abstract void drawIcon(int line, @NotNull Graphics g, int y, @NotNull Editor editor);
|
||||
|
||||
public boolean isShowSeparatorLine(int line, @NotNull Editor editor) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+294
-77
@@ -4,18 +4,26 @@ import com.intellij.execution.process.ProcessHandler;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.VisualPosition;
|
||||
import com.intellij.openapi.editor.colors.EditorColors;
|
||||
import com.intellij.openapi.editor.event.DocumentAdapter;
|
||||
import com.intellij.openapi.editor.event.DocumentEvent;
|
||||
import com.intellij.openapi.editor.ex.DocumentBulkUpdateListener;
|
||||
import com.intellij.openapi.editor.ex.DocumentEx;
|
||||
import com.intellij.openapi.editor.ex.EditorEx;
|
||||
import com.intellij.openapi.editor.ex.RangeHighlighterEx;
|
||||
import com.intellij.openapi.editor.impl.EditorComponentImpl;
|
||||
import com.intellij.openapi.editor.impl.EditorImpl;
|
||||
import com.intellij.openapi.editor.impl.RangeMarkerImpl;
|
||||
import com.intellij.openapi.editor.markup.*;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.Conditions;
|
||||
import com.intellij.openapi.util.Getter;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.components.JBLayeredPane;
|
||||
import com.intellij.util.Consumer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -112,40 +120,6 @@ public class LanguageConsoleBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
private static class GutteredEditorPanel extends JPanel {
|
||||
private final EditorEx editor;
|
||||
|
||||
public GutteredEditorPanel(EditorEx editor) {
|
||||
super(new BorderLayout());
|
||||
|
||||
this.editor = editor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
super.paint(g);
|
||||
|
||||
Rectangle clip = g.getClipBounds();
|
||||
if (clip.height < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
int lineHeight = editor.getLineHeight();
|
||||
int startLine = clip.y / lineHeight;
|
||||
int endLine = Math.min(((clip.y + clip.height) / lineHeight) + 1, ((EditorImpl)editor).getVisibleLineCount());
|
||||
if (startLine >= endLine) {
|
||||
return;
|
||||
}
|
||||
|
||||
int y = ((startLine + 1) * lineHeight);
|
||||
g.setColor(editor.getColorsScheme().getColor(EditorColors.INDENT_GUIDE_COLOR));
|
||||
for (int i = startLine; i < endLine; i++) {
|
||||
g.drawLine(ConsoleIconGutterComponent.ICON_AREA_WIDTH, y, clip.width, y);
|
||||
y += lineHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class MyLanguageConsole extends LanguageConsoleImpl {
|
||||
@Nullable
|
||||
private GutterContentProvider gutterContentProvider;
|
||||
@@ -155,7 +129,7 @@ public class LanguageConsoleBuilder {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setupEditorDefault(@NotNull EditorEx editor) {
|
||||
protected void setupEditorDefault(@NotNull final EditorEx editor) {
|
||||
super.setupEditorDefault(editor);
|
||||
|
||||
if (editor == getConsoleEditor()) {
|
||||
@@ -163,52 +137,53 @@ public class LanguageConsoleBuilder {
|
||||
editor.getSettings().setAdditionalLinesCount(1);
|
||||
}
|
||||
else if (gutterContentProvider != null) {
|
||||
JScrollPane scrollPane = editor.getScrollPane();
|
||||
JPanel panel = new GutteredEditorPanel(editor);
|
||||
|
||||
final ConsoleIconGutterComponent lineStartGutter = new ConsoleIconGutterComponent(editor, gutterContentProvider);
|
||||
panel.add(lineStartGutter, BorderLayout.LINE_START);
|
||||
|
||||
panel.add(scrollPane.getViewport().getView(), BorderLayout.CENTER);
|
||||
|
||||
final ConsoleGutterComponent lineEndGutter = new ConsoleGutterComponent(editor, gutterContentProvider);
|
||||
panel.add(lineEndGutter, BorderLayout.LINE_END);
|
||||
|
||||
scrollPane.setViewportView(panel);
|
||||
|
||||
getProject().getMessageBus().connect(this).subscribe(DocumentBulkUpdateListener.TOPIC, new DocumentBulkUpdateListener.Adapter() {
|
||||
JLayeredPane layeredPane = new JBLayeredPane() {
|
||||
@Override
|
||||
public void updateFinished(@NotNull Document document) {
|
||||
if (document.getTextLength() == 0) {
|
||||
gutterContentProvider.documentCleared(getHistoryViewer());
|
||||
}
|
||||
lineStartGutter.updateSize();
|
||||
lineEndGutter.updateSize();
|
||||
}
|
||||
});
|
||||
|
||||
editor.getDocument().addDocumentListener(new DocumentAdapter() {
|
||||
@Override
|
||||
public void documentChanged(DocumentEvent event) {
|
||||
EditorEx editor = getHistoryViewer();
|
||||
DocumentEx document = editor.getDocument();
|
||||
if (document.isInBulkUpdate()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (document.getTextLength() > 0) {
|
||||
int startDocLine = document.getLineNumber(event.getOffset());
|
||||
int endDocLine = document.getLineNumber(event.getOffset() + event.getNewLength());
|
||||
if (event.getOldLength() > event.getNewLength() || startDocLine != endDocLine || StringUtil.indexOf(event.getOldFragment(), '\n') != -1) {
|
||||
lineStartGutter.updateSize();
|
||||
lineEndGutter.updateSize();
|
||||
public void doLayout() {
|
||||
EditorComponentImpl editor = null;
|
||||
Component lineStartGutter = null;
|
||||
Component lineEndGutter = null;
|
||||
for (int i = getComponentCount() - 1; i >= 0; i--) {
|
||||
Component component = getComponent(i);
|
||||
if (component instanceof EditorComponentImpl) {
|
||||
editor = (EditorComponentImpl)component;
|
||||
}
|
||||
else if (getLayer(component) == JLayeredPane.DEFAULT_LAYER) {
|
||||
lineStartGutter = component;
|
||||
}
|
||||
else {
|
||||
lineEndGutter = component;
|
||||
}
|
||||
}
|
||||
else if (event.getOldLength() > 0) {
|
||||
gutterContentProvider.documentCleared(editor);
|
||||
}
|
||||
|
||||
assert editor != null && lineStartGutter != null && lineEndGutter != null;
|
||||
|
||||
int w = getWidth();
|
||||
int h = getHeight();
|
||||
Dimension lineStartGutterDimension = lineStartGutter.getPreferredSize();
|
||||
lineStartGutter.setBounds(0, 0, lineStartGutterDimension.width, h);
|
||||
|
||||
editor.setBounds(lineStartGutterDimension.width, 0, w - lineStartGutterDimension.width, h);
|
||||
|
||||
Dimension lineEndGutterDimension = lineEndGutter.getPreferredSize();
|
||||
lineEndGutter.setBounds(w - lineEndGutterDimension.width - editor.getEditor().getScrollPane().getVerticalScrollBar().getWidth(), 0, lineEndGutterDimension.width, h);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
ConsoleIconGutterComponent lineStartGutter = new ConsoleIconGutterComponent(editor, gutterContentProvider);
|
||||
layeredPane.add(lineStartGutter, JLayeredPane.DEFAULT_LAYER);
|
||||
|
||||
JScrollPane scrollPane = editor.getScrollPane();
|
||||
layeredPane.add(scrollPane.getViewport().getView(), JLayeredPane.DEFAULT_LAYER);
|
||||
|
||||
ConsoleGutterComponent lineEndGutter = new ConsoleGutterComponent(editor, gutterContentProvider);
|
||||
layeredPane.add(lineEndGutter, JLayeredPane.PALETTE_LAYER);
|
||||
|
||||
scrollPane.setViewportView(layeredPane);
|
||||
|
||||
GutterUpdateScheduler gutterUpdateScheduler = new GutterUpdateScheduler(lineStartGutter, lineEndGutter);
|
||||
getProject().getMessageBus().connect(this).subscribe(DocumentBulkUpdateListener.TOPIC, gutterUpdateScheduler);
|
||||
editor.getDocument().addDocumentListener(gutterUpdateScheduler);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,5 +196,247 @@ public class LanguageConsoleBuilder {
|
||||
gutterContentProvider.beforeEvaluate(getHistoryViewer());
|
||||
}
|
||||
}
|
||||
|
||||
private class GutterUpdateScheduler extends DocumentAdapter implements DocumentBulkUpdateListener {
|
||||
private final ConsoleIconGutterComponent lineStartGutter;
|
||||
private final ConsoleGutterComponent lineEndGutter;
|
||||
|
||||
private boolean lineSeparatorPainterAdded;
|
||||
|
||||
public GutterUpdateScheduler(@NotNull ConsoleIconGutterComponent lineStartGutter, @NotNull ConsoleGutterComponent lineEndGutter) {
|
||||
this.lineStartGutter = lineStartGutter;
|
||||
this.lineEndGutter = lineEndGutter;
|
||||
}
|
||||
|
||||
private void addLineSeparatorPainterIfNeed() {
|
||||
if (lineSeparatorPainterAdded) {
|
||||
return;
|
||||
}
|
||||
|
||||
lineSeparatorPainterAdded = true;
|
||||
|
||||
EditorEx editor = getHistoryViewer();
|
||||
editor.getMarkupModel().addRangeHighlighter(new MyRangeMarkerImpl(editor), 0, getDocument().getTextLength(), false, false, HighlighterLayer.ADDITIONAL_SYNTAX);
|
||||
}
|
||||
|
||||
private DocumentEx getDocument() {
|
||||
return getHistoryViewer().getDocument();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void documentChanged(DocumentEvent event) {
|
||||
DocumentEx document = getDocument();
|
||||
if (document.isInBulkUpdate()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (document.getTextLength() > 0) {
|
||||
addLineSeparatorPainterIfNeed();
|
||||
int startDocLine = document.getLineNumber(event.getOffset());
|
||||
int endDocLine = document.getLineNumber(event.getOffset() + event.getNewLength());
|
||||
if (event.getOldLength() > event.getNewLength() || startDocLine != endDocLine || StringUtil.indexOf(event.getOldFragment(), '\n') != -1) {
|
||||
lineStartGutter.updateSize();
|
||||
lineEndGutter.updateSize();
|
||||
}
|
||||
}
|
||||
else if (event.getOldLength() > 0) {
|
||||
assert gutterContentProvider != null;
|
||||
gutterContentProvider.documentCleared(getHistoryViewer());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStarted(@NotNull Document doc) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFinished(@NotNull Document doc) {
|
||||
if (getDocument().getTextLength() == 0) {
|
||||
assert gutterContentProvider != null;
|
||||
gutterContentProvider.documentCleared(getHistoryViewer());
|
||||
}
|
||||
else {
|
||||
addLineSeparatorPainterIfNeed();
|
||||
}
|
||||
lineStartGutter.updateSize();
|
||||
lineEndGutter.updateSize();
|
||||
}
|
||||
}
|
||||
|
||||
private class MyRangeMarkerImpl extends RangeMarkerImpl implements RangeHighlighterEx, Getter<RangeHighlighterEx> {
|
||||
private final CustomHighlighterRenderer renderer = new CustomHighlighterRenderer() {
|
||||
@Override
|
||||
public void paint(@NotNull Editor editor, @NotNull RangeHighlighter highlighter, @NotNull Graphics g) {
|
||||
Rectangle clip = g.getClipBounds();
|
||||
if (clip.height < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
int lineHeight = editor.getLineHeight();
|
||||
int startLine = clip.y / lineHeight;
|
||||
int endLine = Math.min(((clip.y + clip.height) / lineHeight) + 1, ((EditorImpl)editor).getVisibleLineCount());
|
||||
if (startLine >= endLine) {
|
||||
return;
|
||||
}
|
||||
|
||||
int y = ((startLine + 1) * lineHeight);
|
||||
g.setColor(editor.getColorsScheme().getColor(EditorColors.INDENT_GUIDE_COLOR));
|
||||
assert gutterContentProvider != null;
|
||||
for (int i = startLine; i < endLine; i++) {
|
||||
if (gutterContentProvider.isShowSeparatorLine(editor.visualToLogicalPosition(new VisualPosition(i, 0)).line, editor)) {
|
||||
g.drawLine(0, y, clip.width, y);
|
||||
}
|
||||
y += lineHeight;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public MyRangeMarkerImpl(@NotNull EditorEx editor) {
|
||||
super(editor.getDocument(), 0, 1, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void changedUpdateImpl(DocumentEvent e) {
|
||||
setIntervalEnd(myDocument.getTextLength());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAfterEndOfLine() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAfterEndOfLine(boolean value) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAffectedAreaStartOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAffectedAreaEndOffset() {
|
||||
return myDocument.getTextLength();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTextAttributes(@NotNull TextAttributes textAttributes) {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public HighlighterTargetArea getTargetArea() {
|
||||
return HighlighterTargetArea.EXACT_RANGE;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public TextAttributes getTextAttributes() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public LineMarkerRenderer getLineMarkerRenderer() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLineMarkerRenderer(@Nullable LineMarkerRenderer renderer) {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public CustomHighlighterRenderer getCustomRenderer() {
|
||||
return renderer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCustomRenderer(CustomHighlighterRenderer renderer) {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public GutterIconRenderer getGutterIconRenderer() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGutterIconRenderer(@Nullable GutterIconRenderer renderer) {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Color getErrorStripeMarkColor() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setErrorStripeMarkColor(@Nullable Color color) {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Object getErrorStripeTooltip() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setErrorStripeTooltip(@Nullable Object tooltipObject) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isThinErrorStripeMark() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setThinErrorStripeMark(boolean value) {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Color getLineSeparatorColor() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLineSeparatorColor(@Nullable Color color) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLineSeparatorRenderer(LineSeparatorRenderer renderer) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public LineSeparatorRenderer getLineSeparatorRenderer() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public SeparatorPlacement getLineSeparatorPlacement() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLineSeparatorPlacement(@Nullable SeparatorPlacement placement) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEditorFilter(@NotNull MarkupEditorFilter filter) {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public MarkupEditorFilter getEditorFilter() {
|
||||
return MarkupEditorFilter.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RangeHighlighterEx get() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -465,6 +465,7 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo
|
||||
|
||||
if (myEditor == null) {
|
||||
myEditor = createEditor();
|
||||
registerConsoleEditorActions();
|
||||
myEditor.getScrollPane().setBorder(null);
|
||||
myHyperlinks = new EditorHyperlinkSupport(myEditor, myProject);
|
||||
requestFlushImmediately();
|
||||
@@ -859,9 +860,6 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo
|
||||
editor.getSettings().setAllowSingleLogicalLineFolding(true); // We want to fold long soft-wrapped command lines
|
||||
editor.setHighlighter(createHighlighter());
|
||||
|
||||
if (!myIsViewer) {
|
||||
registerConsoleEditorActions(editor);
|
||||
}
|
||||
return editor;
|
||||
}
|
||||
});
|
||||
@@ -899,11 +897,17 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo
|
||||
return new MyHighlighter();
|
||||
}
|
||||
|
||||
private static void registerConsoleEditorActions(Editor editor) {
|
||||
new EnterHandler().registerCustomShortcutSet(CommonShortcuts.ENTER, editor.getContentComponent());
|
||||
registerActionHandler(editor, IdeActions.ACTION_EDITOR_PASTE, new PasteHandler());
|
||||
registerActionHandler(editor, IdeActions.ACTION_EDITOR_BACKSPACE, new BackSpaceHandler());
|
||||
registerActionHandler(editor, IdeActions.ACTION_EDITOR_DELETE, new DeleteHandler());
|
||||
private void registerConsoleEditorActions() {
|
||||
HyperlinkNavigationAction hyperlinkNavigationAction = new HyperlinkNavigationAction();
|
||||
hyperlinkNavigationAction.registerCustomShortcutSet(CommonShortcuts.ENTER, myEditor.getContentComponent());
|
||||
registerActionHandler(myEditor, IdeActions.ACTION_GOTO_DECLARATION, hyperlinkNavigationAction);
|
||||
|
||||
if (!myIsViewer) {
|
||||
new EnterHandler().registerCustomShortcutSet(CommonShortcuts.ENTER, myEditor.getContentComponent());
|
||||
registerActionHandler(myEditor, IdeActions.ACTION_EDITOR_PASTE, new PasteHandler());
|
||||
registerActionHandler(myEditor, IdeActions.ACTION_EDITOR_BACKSPACE, new BackSpaceHandler());
|
||||
registerActionHandler(myEditor, IdeActions.ACTION_EDITOR_DELETE, new DeleteHandler());
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerActionHandler(final Editor editor, final String actionId, final AnAction action) {
|
||||
@@ -1849,5 +1853,19 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo
|
||||
public Project getProject() {
|
||||
return myProject;
|
||||
}
|
||||
|
||||
private class HyperlinkNavigationAction extends DumbAwareAction {
|
||||
@Override
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
Runnable runnable = myHyperlinks.getLinkNavigationRunnable(myEditor.getCaretModel().getLogicalPosition());
|
||||
assert runnable != null;
|
||||
runnable.run();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(AnActionEvent e) {
|
||||
e.getPresentation().setEnabled(myHyperlinks.getLinkNavigationRunnable(myEditor.getCaretModel().getLogicalPosition()) != null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ import com.intellij.openapi.vfs.*;
|
||||
import com.intellij.openapi.vfs.ex.VirtualFileManagerEx;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.cache.CacheManager;
|
||||
import com.intellij.psi.impl.cache.impl.id.IdIndex;
|
||||
import com.intellij.psi.search.*;
|
||||
import com.intellij.ui.content.Content;
|
||||
import com.intellij.usageView.UsageInfo;
|
||||
@@ -69,6 +70,7 @@ import com.intellij.util.PatternUtil;
|
||||
import com.intellij.util.Processor;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.indexing.FileBasedIndex;
|
||||
import com.intellij.util.indexing.FileBasedIndexImpl;
|
||||
import gnu.trove.THashSet;
|
||||
import gnu.trove.TIntHashSet;
|
||||
import gnu.trove.TIntIterator;
|
||||
@@ -345,7 +347,7 @@ public class FindInProjectUtil {
|
||||
Pair<Boolean, Collection<PsiFile>> fastWords = getFilesForFastWordSearch(findModel, project, psiDirectory, fileMaskRegExp, module, fileIndex);
|
||||
final Collection<PsiFile> filesForFastWordSearch = fastWords.getSecond();
|
||||
|
||||
if (fastWords.getFirst() && canOptimizeForFastWordSearch(findModel)) return filesForFastWordSearch;
|
||||
final boolean useIdIndex = fastWords.getFirst() && canOptimizeForFastWordSearch(findModel);
|
||||
|
||||
SearchScope customScope = findModel.getCustomScope();
|
||||
final GlobalSearchScope globalCustomScope = toGlobal(project, customScope);
|
||||
@@ -357,13 +359,19 @@ public class FindInProjectUtil {
|
||||
@Override
|
||||
public boolean processFile(@NotNull VirtualFile virtualFile) {
|
||||
ProgressManager.checkCanceled();
|
||||
if (!virtualFile.isDirectory() &&
|
||||
(fileMaskRegExp == null || fileMaskRegExp.matcher(virtualFile.getName()).matches()) &&
|
||||
(globalCustomScope == null || globalCustomScope.contains(virtualFile))) {
|
||||
final PsiFile psiFile = findFile(psiManager, virtualFile);
|
||||
if (psiFile != null && !filesForFastWordSearch.contains(psiFile)) {
|
||||
myFiles.add(psiFile);
|
||||
}
|
||||
if (virtualFile.isDirectory() ||
|
||||
(fileMaskRegExp != null && !fileMaskRegExp.matcher(virtualFile.getName()).matches()) ||
|
||||
(globalCustomScope != null && !globalCustomScope.contains(virtualFile))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (useIdIndex && isCoveredByIdIndex(virtualFile)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
PsiFile psiFile = findFile(psiManager, virtualFile);
|
||||
if (psiFile != null && !(psiFile instanceof PsiBinaryFile)) {
|
||||
myFiles.add(psiFile);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -414,6 +422,11 @@ public class FindInProjectUtil {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
private static boolean isCoveredByIdIndex(VirtualFile file) {
|
||||
return IdIndex.isIndexable(FileBasedIndexImpl.getFileType(file)) &&
|
||||
((FileBasedIndexImpl)FileBasedIndex.getInstance()).isIndexingCandidate(file, IdIndex.NAME);
|
||||
}
|
||||
|
||||
private static boolean iterateAll(@NotNull VirtualFile[] files, @NotNull final GlobalSearchScope searchScope, @NotNull final ContentIterator iterator) {
|
||||
final FileTypeManager fileTypeManager = FileTypeManager.getInstance();
|
||||
final VirtualFileFilter contentFilter = new VirtualFileFilter() {
|
||||
|
||||
@@ -39,7 +39,6 @@ import com.intellij.openapi.editor.impl.EditorImpl;
|
||||
import com.intellij.openapi.editor.impl.SoftWrapModelImpl;
|
||||
import com.intellij.openapi.editor.impl.TextDrawingCallback;
|
||||
import com.intellij.openapi.editor.impl.softwrap.SoftWrapAppliancePlaces;
|
||||
import com.intellij.openapi.editor.markup.MarkupModel;
|
||||
import com.intellij.openapi.editor.markup.TextAttributes;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
@@ -57,7 +56,7 @@ import java.awt.*;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.util.*;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -109,7 +108,7 @@ public class EditorWindowImpl extends UserDataHolderBase implements EditorWindow
|
||||
myOneLine = oneLine;
|
||||
myCaretModelDelegate = new CaretModelWindow(myDelegate.getCaretModel(), this);
|
||||
mySelectionModelDelegate = new SelectionModelWindow(myDelegate, myDocumentWindow,this);
|
||||
myMarkupModelDelegate = new MarkupModelWindow((MarkupModelEx)myDelegate.getMarkupModel(), myDocumentWindow);
|
||||
myMarkupModelDelegate = new MarkupModelWindow(myDelegate.getMarkupModel(), myDocumentWindow);
|
||||
myFoldingModelWindow = new FoldingModelWindow(delegate.getFoldingModel(), documentWindow, this);
|
||||
mySoftWrapModel = new SoftWrapModelImpl(this);
|
||||
Disposer.register(myDocumentWindow, mySoftWrapModel);
|
||||
@@ -249,7 +248,7 @@ public class EditorWindowImpl extends UserDataHolderBase implements EditorWindow
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public MarkupModel getMarkupModel() {
|
||||
public MarkupModelEx getMarkupModel() {
|
||||
return myMarkupModelDelegate;
|
||||
}
|
||||
|
||||
|
||||
@@ -1766,7 +1766,7 @@ public class FileBasedIndexImpl extends FileBasedIndex {
|
||||
}
|
||||
}
|
||||
|
||||
private static FileType getFileType(VirtualFile file) {
|
||||
public static FileType getFileType(VirtualFile file) {
|
||||
FileType fileType = file.getFileType();
|
||||
if (fileType == FileTypes.PLAIN_TEXT && FileTypeManagerImpl.isFileTypeDetectedFromContent(file)) {
|
||||
fileType = FileTypes.UNKNOWN;
|
||||
@@ -1774,6 +1774,10 @@ public class FileBasedIndexImpl extends FileBasedIndex {
|
||||
return fileType;
|
||||
}
|
||||
|
||||
public boolean isIndexingCandidate(VirtualFile file, ID<?, ?> indexId) {
|
||||
return !isTooLarge(file) && getAffectedIndexCandidates(file).contains(indexId);
|
||||
}
|
||||
|
||||
private List<ID<?, ?>> getAffectedIndexCandidates(VirtualFile file) {
|
||||
if (file.isDirectory()) {
|
||||
return isProjectOrWorkspaceFile(file, null) ? Collections.<ID<?,?>>emptyList() : myIndicesForDirectories;
|
||||
|
||||
@@ -68,6 +68,10 @@ public class InstalledPackagesPanel extends JPanel {
|
||||
return tableCellRenderer;
|
||||
}
|
||||
};
|
||||
// Defence from javax.swing.JTable.initializeLocalVars:
|
||||
// setPreferredScrollableViewportSize(new Dimension(450, 400));
|
||||
myPackagesTable.setPreferredScrollableViewportSize(null);
|
||||
myPackagesTable.setStriped(true);
|
||||
myPackagesTable.getTableHeader().setReorderingAllowed(false);
|
||||
|
||||
myUpgradeButton = new AnActionButton("Upgrade", IconUtil.getMoveUpIcon()) {
|
||||
@@ -94,7 +98,6 @@ public class InstalledPackagesPanel extends JPanel {
|
||||
})
|
||||
.addExtraAction(myUpgradeButton);
|
||||
|
||||
decorator.setPreferredSize(new Dimension(500, 500));
|
||||
add(decorator.createPanel());
|
||||
myInstallButton = decorator.getActionsPanel().getAnActionButton(CommonActionsPanel.Buttons.ADD);
|
||||
myUninstallButton = decorator.getActionsPanel().getAnActionButton(CommonActionsPanel.Buttons.REMOVE);
|
||||
|
||||
+36
-60
@@ -38,7 +38,6 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.pom.NavigatableAdapter;
|
||||
import com.intellij.ui.awt.RelativePoint;
|
||||
import com.intellij.util.BeforeAfter;
|
||||
import com.intellij.util.Consumer;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
@@ -66,13 +65,14 @@ public class EditorHyperlinkSupport {
|
||||
};
|
||||
|
||||
private final Editor myEditor;
|
||||
@NotNull private final Project myProject;
|
||||
private final SortedMap<RangeHighlighter, HyperlinkInfo> myHighlighterToMessageInfoMap = new TreeMap<RangeHighlighter, HyperlinkInfo>(START_OFFSET_COMPARATOR);
|
||||
private int myLastIndex = NO_INDEX;
|
||||
private final Consumer<BeforeAfter<Filter.Result>> myRefresher;
|
||||
private final List<RangeHighlighter> myHighlighters;
|
||||
|
||||
public EditorHyperlinkSupport(@NotNull final Editor editor, @NotNull final Project project) {
|
||||
myEditor = editor;
|
||||
myProject = project;
|
||||
myHighlighters = new SmartList<RangeHighlighter>();
|
||||
|
||||
editor.addEditorMouseListener(new EditorMouseAdapter() {
|
||||
@@ -80,23 +80,9 @@ public class EditorHyperlinkSupport {
|
||||
public void mouseClicked(EditorMouseEvent e) {
|
||||
final MouseEvent mouseEvent = e.getMouseEvent();
|
||||
if (mouseEvent.getButton() == MouseEvent.BUTTON1 && !mouseEvent.isPopupTrigger()) {
|
||||
LogicalPosition logical = myEditor.xyToLogicalPosition(e.getMouseEvent().getPoint());
|
||||
if (EditorUtil.inVirtualSpace(editor, logical)) {
|
||||
return;
|
||||
}
|
||||
|
||||
RangeHighlighter range = findLinkRangeAt(myEditor.logicalPositionToOffset(logical));
|
||||
if (range != null) {
|
||||
final HyperlinkInfo info = myHighlighterToMessageInfoMap.get(range);
|
||||
if (info != null) {
|
||||
if (info instanceof HyperlinkInfoBase) {
|
||||
((HyperlinkInfoBase)info).navigate(project, new RelativePoint(mouseEvent));
|
||||
}
|
||||
else {
|
||||
info.navigate(project);
|
||||
}
|
||||
linkFollowed(editor, getHyperlinks().keySet(), range);
|
||||
}
|
||||
Runnable runnable = getLinkNavigationRunnable(myEditor.xyToLogicalPosition(e.getMouseEvent().getPoint()));
|
||||
if (runnable != null) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,38 +103,36 @@ public class EditorHyperlinkSupport {
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
myRefresher = new Consumer<BeforeAfter<Filter.Result>>() {
|
||||
@Override
|
||||
public void consume(BeforeAfter<Filter.Result> resultBeforeAfter) {
|
||||
if (resultBeforeAfter.getBefore() == null) return;
|
||||
final RangeHighlighter hyperlinkRange = findHyperlinkRange(resultBeforeAfter.getBefore().hyperlinkInfo);
|
||||
if (hyperlinkRange != null) {
|
||||
myHighlighterToMessageInfoMap.remove(hyperlinkRange);
|
||||
} else {
|
||||
final Iterator<RangeHighlighter> iterator = myHighlighters.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
final RangeHighlighter highlighter = iterator.next();
|
||||
if (highlighter.isValid() && containsOffset(resultBeforeAfter.getBefore().highlightStartOffset, highlighter)) {
|
||||
iterator.remove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (resultBeforeAfter.getAfter() != null) {
|
||||
if (resultBeforeAfter.getAfter().hyperlinkInfo != null) {
|
||||
addHyperlink(resultBeforeAfter.getAfter().highlightStartOffset, resultBeforeAfter.getAfter().highlightEndOffset,
|
||||
resultBeforeAfter.getAfter().highlightAttributes, resultBeforeAfter.getAfter().hyperlinkInfo);
|
||||
} else if (resultBeforeAfter.getAfter().highlightAttributes != null) {
|
||||
addHighlighter(resultBeforeAfter.getAfter().highlightStartOffset, resultBeforeAfter.getAfter().highlightEndOffset,
|
||||
resultBeforeAfter.getAfter().highlightAttributes);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@Nullable
|
||||
public Runnable getLinkNavigationRunnable(final LogicalPosition logical) {
|
||||
if (EditorUtil.inVirtualSpace(myEditor, logical)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final RangeHighlighter range = findLinkRangeAt(this.myEditor.logicalPositionToOffset(logical));
|
||||
if (range != null) {
|
||||
final HyperlinkInfo info = myHighlighterToMessageInfoMap.get(range);
|
||||
if (info != null) {
|
||||
return new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (info instanceof HyperlinkInfoBase) {
|
||||
RelativePoint point = new RelativePoint(myEditor.getContentComponent(), myEditor.logicalPositionToXY(logical));
|
||||
((HyperlinkInfoBase)info).navigate(myProject, point);
|
||||
}
|
||||
else {
|
||||
info.navigate(myProject);
|
||||
}
|
||||
linkFollowed(myEditor, getHyperlinks().keySet(), range);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void adjustHighlighters(final List<FilterMixin.AdditionalHighlight> highlights) {
|
||||
for (FilterMixin.AdditionalHighlight highlight : highlights) {
|
||||
RangeHighlighter found = null;
|
||||
@@ -371,16 +355,8 @@ public class EditorHyperlinkSupport {
|
||||
range.putUserData(OLD_HYPERLINK_TEXT_ATTRIBUTES, null);
|
||||
}
|
||||
if (range == link) {
|
||||
TextAttributes oldAttributes = range.getTextAttributes();
|
||||
range.putUserData(OLD_HYPERLINK_TEXT_ATTRIBUTES, oldAttributes);
|
||||
TextAttributes attributes = getFollowedHyperlinkAttributes().clone();
|
||||
assert oldAttributes != null;
|
||||
attributes.setFontType(oldAttributes.getFontType());
|
||||
attributes.setEffectType(oldAttributes.getEffectType());
|
||||
attributes.setEffectColor(oldAttributes.getEffectColor());
|
||||
attributes.setForegroundColor(oldAttributes.getForegroundColor());
|
||||
attributes.setBackgroundColor(oldAttributes.getBackgroundColor());
|
||||
markupModel.setRangeHighlighterAttributes(range, attributes);
|
||||
range.putUserData(OLD_HYPERLINK_TEXT_ATTRIBUTES, range.getTextAttributes());
|
||||
markupModel.setRangeHighlighterAttributes(range, getFollowedHyperlinkAttributes());
|
||||
}
|
||||
}
|
||||
//refresh highlighter text attributes
|
||||
|
||||
@@ -52,6 +52,10 @@ public interface EditorEx extends Editor {
|
||||
@Override
|
||||
DocumentEx getDocument();
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
MarkupModelEx getMarkupModel();
|
||||
|
||||
@NotNull
|
||||
EditorGutterComponentEx getGutterComponentEx();
|
||||
|
||||
|
||||
@@ -628,7 +628,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public MarkupModel getMarkupModel() {
|
||||
public MarkupModelEx getMarkupModel() {
|
||||
return myMarkupModel;
|
||||
}
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ psi.track.invalidation=true
|
||||
ide.suggest.file.when.creating.filename.like.directory=true
|
||||
ide.suggest.file.when.creating.filename.like.directory.description=When creating a directory named foo.txt, suggest to create a file with such a name instead
|
||||
|
||||
find.search.in.project.files=false
|
||||
find.search.in.project.files=true
|
||||
|
||||
structureView.coalesceTime=500
|
||||
|
||||
@@ -224,7 +224,7 @@ ide.mac.fix.accessibleLeak=true
|
||||
|
||||
projectView.showHierarchyErrors=true
|
||||
projectView.hide.dot.idea=true
|
||||
show.live.templates.in.completion=false
|
||||
show.live.templates.in.completion=true
|
||||
ide.completion.autopopup.select.live.templates=true
|
||||
ide.completion.autopopup.choose.by.enter=true
|
||||
documentation.component.editor.font=false
|
||||
|
||||
+1
-1
@@ -149,7 +149,7 @@ public class PushedFilePropertiesUpdater {
|
||||
ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
|
||||
if (indicator != null) {
|
||||
indicator.pushState();
|
||||
indicator.setText("Updating file properties...");
|
||||
indicator.setText("Initializing file system cache...");
|
||||
}
|
||||
Module[] modules = ModuleManager.getInstance(myProject).getModules();
|
||||
for (int i1 = 0; i1 < modules.length; i1++) {
|
||||
|
||||
@@ -30,11 +30,12 @@ import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.ui.MessageType;
|
||||
import com.intellij.openapi.vcs.FileStatusManager;
|
||||
import com.intellij.openapi.vcs.changes.ChangeListManager;
|
||||
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
|
||||
import com.intellij.openapi.vcs.ui.Refreshable;
|
||||
import com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.containers.HashMap;
|
||||
@@ -75,9 +76,8 @@ public class IgnoreFileAction extends AnAction {
|
||||
CvsUtil.ignoreFile(selectedFile);
|
||||
}
|
||||
catch (IOException e1) {
|
||||
Messages.showErrorDialog(
|
||||
CvsBundle.message("message.error.ignore.files", selectedFile.getPresentableUrl(), e1.getLocalizedMessage()),
|
||||
CvsBundle.message("message.error.ignore.files.title"));
|
||||
final String message = CvsBundle.message("message.error.ignore.files", selectedFile.getPresentableUrl(), e1.getLocalizedMessage());
|
||||
VcsBalloonProblemNotifier.showOverChangesView(context.getProject(), message, MessageType.ERROR);
|
||||
}
|
||||
}
|
||||
refreshFilesAndStatuses(context);
|
||||
|
||||
+5
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 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.
|
||||
@@ -288,6 +288,10 @@ public class CvsChangeProvider implements ChangeProvider {
|
||||
return;
|
||||
}
|
||||
final CvsInfo info = myEntriesManager.getCvsInfoFor(dir);
|
||||
if (info.getIgnoreFilter().shouldBeIgnored(dir.getName())) {
|
||||
builder.processIgnoredFile(dir);
|
||||
return;
|
||||
}
|
||||
if (info.getRepository() == null) {
|
||||
// don't report unversioned directories as switched (IDEADEV-17178)
|
||||
builder.processUnversionedFile(dir);
|
||||
|
||||
+5
-6
@@ -30,10 +30,7 @@ import org.jetbrains.jps.model.JpsEncodingConfigurationService;
|
||||
import org.jetbrains.jps.model.JpsEncodingProjectConfiguration;
|
||||
import org.jetbrains.jps.model.JpsProject;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.*;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
@@ -66,8 +63,10 @@ public class MavenResourceFileProcessor {
|
||||
myFilteringExcludedExtensions = moduleConfiguration.getFilteringExcludedExtensions();
|
||||
}
|
||||
|
||||
protected void copyFile(File file, File targetFile, ResourceRootConfiguration rootConfiguration, CompileContext context) throws IOException {
|
||||
boolean shouldFilter = rootConfiguration.isFiltered && !myFilteringExcludedExtensions.contains(FileUtilRt.getExtension(file.getName()));
|
||||
public void copyFile(File file, File targetFile, ResourceRootConfiguration rootConfiguration, CompileContext context,
|
||||
FileFilter filteringFilter) throws IOException {
|
||||
boolean shouldFilter = rootConfiguration.isFiltered && !myFilteringExcludedExtensions.contains(FileUtilRt.getExtension(file.getName()))
|
||||
&& filteringFilter.accept(file);
|
||||
if (shouldFilter && file.length() > FILTERING_SIZE_LIMIT) {
|
||||
context.processMessage(new CompilerMessage("MavenResources", BuildMessage.Kind.WARNING,
|
||||
"File is too big to be filtered. Most likely it is a binary file and should be excluded from filtering",
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
package org.jetbrains.jps.maven.compiler;
|
||||
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jps.builders.BuildOutputConsumer;
|
||||
import org.jetbrains.jps.builders.DirtyFilesHolder;
|
||||
@@ -59,7 +60,7 @@ public class MavenResourcesBuilder extends TargetBuilder<MavenResourceRootDescri
|
||||
try {
|
||||
context.processMessage(new ProgressMessage("Copying resources... [" + target.getModule().getName() + "]"));
|
||||
|
||||
fileProcessor.copyFile(file, outputFile, rd.getConfiguration(), context);
|
||||
fileProcessor.copyFile(file, outputFile, rd.getConfiguration(), context, FileUtilRt.ALL_FILES);
|
||||
outputConsumer.registerOutputFile(outputFile, Collections.singleton(sourcePath));
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
|
||||
+13
-2
@@ -16,6 +16,9 @@
|
||||
package org.jetbrains.jps.maven.compiler;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jps.builders.storage.BuildDataPaths;
|
||||
@@ -66,6 +69,8 @@ public class MavenWebArtifactRootCopyingHandlerProvider extends ArtifactRootCopy
|
||||
@NotNull private final ResourceRootConfiguration myRootConfiguration;
|
||||
@NotNull private final MavenModuleResourceConfiguration myModuleResourceConfiguration;
|
||||
@NotNull private final File myRoot;
|
||||
private FileFilter myFileFilter;
|
||||
private boolean myMainWebAppRoot;
|
||||
|
||||
private MavenWebRootCopyingHandler(@NotNull MavenResourceFileProcessor fileProcessor,
|
||||
@NotNull ResourceRootConfiguration rootConfiguration,
|
||||
@@ -75,11 +80,17 @@ public class MavenWebArtifactRootCopyingHandlerProvider extends ArtifactRootCopy
|
||||
myRootConfiguration = rootConfiguration;
|
||||
myModuleResourceConfiguration = moduleResourceConfiguration;
|
||||
myRoot = root;
|
||||
myFileFilter = new MavenResourceFileFilter(myRoot, myRootConfiguration);
|
||||
|
||||
//for additional resource directory 'exclude' means 'exclude from copying' but for the default webapp resource it mean 'exclude from filtering'
|
||||
String relativePath = FileUtil.getRelativePath(FileUtil.toSystemIndependentName(moduleResourceConfiguration.directory),
|
||||
FileUtil.toSystemIndependentName(rootConfiguration.directory), '/');
|
||||
myMainWebAppRoot = relativePath != null && "src/main/webapp".equals(StringUtil.trimEnd(relativePath, "/"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void copyFile(@NotNull File from, @NotNull File to, @NotNull CompileContext context) throws IOException {
|
||||
myFileProcessor.copyFile(from, to, myRootConfiguration, context);
|
||||
myFileProcessor.copyFile(from, to, myRootConfiguration, context, myMainWebAppRoot ? myFileFilter : FileUtilRt.ALL_FILES);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -91,7 +102,7 @@ public class MavenWebArtifactRootCopyingHandlerProvider extends ArtifactRootCopy
|
||||
@NotNull
|
||||
@Override
|
||||
public FileFilter createFileFilter() {
|
||||
return new MavenResourceFileFilter(myRoot, myRootConfiguration);
|
||||
return myMainWebAppRoot ? FileUtilRt.ALL_FILES : myFileFilter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class MavenResourceFileFilter implements FileFilter {
|
||||
return relPath != null && isIncluded(relPath);
|
||||
}
|
||||
|
||||
public boolean isIncluded(String relativePath) {
|
||||
private boolean isIncluded(String relativePath) {
|
||||
if (myNormalizedIncludes == null) {
|
||||
if (myConfiguration.includes.isEmpty()) {
|
||||
myNormalizedIncludes = new String[]{"**" + File.separatorChar + '*'};
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.jetbrains.python.sdk.flavors.IronPythonSdkFlavor;
|
||||
import com.jetbrains.python.sdk.flavors.PythonSdkFlavor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -50,6 +51,7 @@ public class PyInstalledPackagesPanel extends InstalledPackagesPanel {
|
||||
|
||||
public PyInstalledPackagesPanel(Project project, PackagesNotificationPanel area) {
|
||||
super(project, area);
|
||||
setPreferredSize(new Dimension(500, 500));
|
||||
|
||||
myNotificationArea.addLinkHandler(INSTALL_SETUPTOOLS, new Runnable() {
|
||||
@Override
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2000-2014 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.spellchecker.inspection
|
||||
import com.intellij.testFramework.PlatformTestUtil
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public class SpellcheckerPerformanceTest extends SpellcheckerInspectionTestCase {
|
||||
|
||||
public void "test large text file with many typos"() {
|
||||
int typoCount = 150000
|
||||
String text = "aaaaaaaaa " * typoCount // about 1.5M
|
||||
myFixture.configureFromExistingVirtualFile(myFixture.addFileToProject("foo.txt", text).virtualFile)
|
||||
|
||||
myFixture.enableInspections(inspectionTools)
|
||||
PlatformTestUtil.assertTiming("highlighting too long", 5000) { assertSize(typoCount, myFixture.doHighlighting()) }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,28 +17,20 @@ import java.util.zip.ZipInputStream;
|
||||
|
||||
public class Runner {
|
||||
public static Logger logger = null;
|
||||
|
||||
private static final String PATCH_FILE_NAME = "patch-file.zip";
|
||||
private static final String PATCH_PROPERTIES_ENTRY = "patch.properties";
|
||||
private static final String OLD_BUILD_DESCRIPTION = "old.build.description";
|
||||
private static final String NEW_BUILD_DESCRIPTION = "new.build.description";
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
if (args.length != 3 && args.length < 7) {
|
||||
printUsage();
|
||||
return;
|
||||
}
|
||||
|
||||
String command = args[0];
|
||||
if ("create".equals(command)) {
|
||||
if (args.length < 7) {
|
||||
printUsage();
|
||||
return;
|
||||
}
|
||||
if (args.length >= 7 && "create".equals(args[0])) {
|
||||
String oldVersionDesc = args[1];
|
||||
String newVersionDesc = args[2];
|
||||
String oldFolder = args[3];
|
||||
String newFolder = args[4];
|
||||
String patchFile = args[5];
|
||||
|
||||
String logFolder = args[6];
|
||||
initLogger(logFolder);
|
||||
|
||||
@@ -47,42 +39,33 @@ public class Runner {
|
||||
List<String> optionalFiles = extractFiles(args, "optional");
|
||||
create(oldVersionDesc, newVersionDesc, oldFolder, newFolder, patchFile, ignoredFiles, criticalFiles, optionalFiles);
|
||||
}
|
||||
else if ("install".equals(command)) {
|
||||
if (args.length != 3) {
|
||||
printUsage();
|
||||
return;
|
||||
}
|
||||
|
||||
else if (args.length >= 2 && "install".equals(args[0])) {
|
||||
String destFolder = args[1];
|
||||
String logFolder = args[2];
|
||||
|
||||
String logFolder = args.length >= 3 ? args[2] : null;
|
||||
initLogger(logFolder);
|
||||
logger.info("destFolder: " + destFolder);
|
||||
|
||||
install(destFolder);
|
||||
}
|
||||
else {
|
||||
printUsage();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean validateLogDir(String logFolder){
|
||||
// checks that log directory 1)exists 2)has write perm. and 3)has 1MB+ free space
|
||||
private static boolean isValidLogDir(String logFolder) {
|
||||
File fileLogDir = new File(logFolder);
|
||||
/* check if the dir for log file
|
||||
1)exists 2)has write perm. and 5)has 1MB+ free space */
|
||||
if (!fileLogDir.exists() || !fileLogDir.canWrite() || fileLogDir.getUsableSpace() < 1000000){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return fileLogDir.isDirectory() && fileLogDir.canWrite() && fileLogDir.getUsableSpace() >= 1000000;
|
||||
}
|
||||
|
||||
private static String getLogDir(String logFolder){
|
||||
if (!validateLogDir(logFolder)){
|
||||
private static String getLogDir(String logFolder) {
|
||||
if (logFolder == null || !isValidLogDir(logFolder)) {
|
||||
logFolder = System.getProperty("java.io.tmpdir");
|
||||
if (!validateLogDir(logFolder)){
|
||||
if (!isValidLogDir(logFolder)) {
|
||||
logFolder = System.getProperty("user.home");
|
||||
}
|
||||
}
|
||||
System.out.println("Log dir: " + logFolder);
|
||||
return logFolder;
|
||||
}
|
||||
|
||||
@@ -132,11 +115,12 @@ public class Runner {
|
||||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings("UseOfSystemOutOrSystemErr")
|
||||
private static void printUsage() {
|
||||
System.err.println("Usage:\n" +
|
||||
"create <old_version_description> <new_version_description> <old_version_folder> <new_version_folder>" +
|
||||
" <patch_file_name> [ignored=file1;file2;...] [critical=file1;file2;...] [optional=file1;file2;...]\n" +
|
||||
"install <destination_folder>\n");
|
||||
"install <destination_folder> [log_directory]\n");
|
||||
}
|
||||
|
||||
private static void create(String oldBuildDesc,
|
||||
|
||||
@@ -47,7 +47,9 @@ public class TagNameVariantCollector {
|
||||
String elementNamespace = element.getNamespacePrefix().isEmpty() ? null : element.getNamespace();
|
||||
|
||||
final Map<String, XmlElementDescriptor> descriptorsMap = new HashMap<String, XmlElementDescriptor>();
|
||||
PsiElement curElement = element;
|
||||
PsiElement context = element.getParent();
|
||||
PsiElement curElement = element.getParent();
|
||||
|
||||
{
|
||||
while(curElement instanceof XmlTag){
|
||||
final XmlTag declarationTag = (XmlTag)curElement;
|
||||
@@ -73,7 +75,6 @@ public class TagNameVariantCollector {
|
||||
final Set<XmlNSDescriptor> visited = new HashSet<XmlNSDescriptor>();
|
||||
final XmlExtension extension = XmlExtension.getExtension(element.getContainingFile());
|
||||
final ArrayList<XmlElementDescriptor> variants = new ArrayList<XmlElementDescriptor>();
|
||||
PsiElement context = element.getParent();
|
||||
for (final String namespace: namespaces) {
|
||||
final int initialSize = variants.size();
|
||||
processVariantsInNamespace(namespace, element, variants, elementDescriptor, elementNamespace, descriptorsMap, visited,
|
||||
|
||||
Reference in New Issue
Block a user