Merge branch 'master' of git@git.labs.intellij.net:idea/community

This commit is contained in:
Kirill Kalishev
2010-03-10 16:18:06 +03:00
36 changed files with 211 additions and 59 deletions
+2 -2
View File
@@ -1,11 +1,11 @@
<component name="libraryTable">
<library name="Eclipse">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/org.eclipse.jdt.core_3.4.4.v_894_R34x.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/org.eclipse.jdt.core_3.5.2.v_981_R35x.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/lib/src/org.eclipse.jdt.core.source_3.4.4.v_894_R34x.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/src/org.eclipse.jdt.core.source_3.5.2.v_981_R35x.jar!/" />
</SOURCES>
</library>
</component>
@@ -398,7 +398,7 @@ public class EvaluatorBuilderImpl implements EvaluatorBuilder {
}
private static boolean isBinaryNumericPromotionApplicable(PsiType lType, PsiType rType, IElementType opType) {
if (lType == null && rType == null) {
if (lType == null || rType == null) {
return false;
}
if (opType == JavaTokenType.EQEQ || opType == JavaTokenType.NE) {
@@ -240,7 +240,11 @@ public final class ThreadReferenceProxyImpl extends ObjectReferenceProxyImpl imp
return null;
}
checkFrames(threadReference);
return myFramesFromBottom.get(frameCount() - i - 1);
final int frameCount = frameCount();
if (frameCount == 0) {
return null;
}
return myFramesFromBottom.get(frameCount - i - 1);
}
catch (ObjectCollectedException e) {
return null;
@@ -225,17 +225,14 @@ public class ClsFileImpl extends ClsRepositoryPsiElement<PsiClassHolderFileStub>
}
PsiClass[] classes = getClasses();
if (classes.length == 1) {
if (!JavaPsiFacade.getInstance(getProject()).getNameHelper().isIdentifier(classes[0].getName())) {
return; // Can happen for package-info.class, or classes compiled from languages, that support different class naming scheme, like Scala.
}
}
PsiClass[] mirrorClasses = ((PsiJavaFile)mirrorFile).getClasses();
LOG.assertTrue(classes.length == mirrorClasses.length);
if (classes.length == mirrorClasses.length) {
for (int i = 0; i < classes.length; i++) {
((ClsElementImpl)classes[i]).setMirror((TreeElement)SourceTreeToPsiMap.psiElementToTree(mirrorClasses[i]));
// Can happen for package-info.class, or classes compiled from languages, that support different class naming scheme, like Scala.
if (classes.length != 1 || JavaPsiFacade.getInstance(getProject()).getNameHelper().isIdentifier(classes[0].getName())) {
PsiClass[] mirrorClasses = ((PsiJavaFile)mirrorFile).getClasses();
LOG.assertTrue(classes.length == mirrorClasses.length);
if (classes.length == mirrorClasses.length) {
for (int i = 0; i < classes.length; i++) {
((ClsElementImpl)classes[i]).setMirror((TreeElement)SourceTreeToPsiMap.psiElementToTree(mirrorClasses[i]));
}
}
}
}
@@ -22,9 +22,7 @@ import com.intellij.openapi.roots.OrderRootType;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.psi.*;
import com.intellij.psi.PsiReferenceProvider;
import com.intellij.util.ProcessingContext;
import org.jetbrains.annotations.NotNull;
@@ -112,14 +110,11 @@ public class FilePathReferenceProvider extends PsiReferenceProvider {
List<PsiFileSystemItem> result = new ArrayList<PsiFileSystemItem>();
final PsiManager psiManager = PsiManager.getInstance(thisModule.getProject());
if (includingClasses) {
String[] libraryUrls = moduleRootManager.getUrls(OrderRootType.CLASSES);
for (String libraryUrl : libraryUrls) {
VirtualFile libFile = VirtualFileManager.getInstance().findFileByUrl(libraryUrl);
if (libFile != null) {
PsiDirectory directory = psiManager.findDirectory(libFile);
if (directory != null) {
result.add(directory);
}
VirtualFile[] libraryUrls = moduleRootManager.getFiles(OrderRootType.CLASSES);
for (VirtualFile file : libraryUrls) {
PsiDirectory directory = psiManager.findDirectory(file);
if (directory != null) {
result.add(directory);
}
}
}
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -26,7 +26,7 @@ junit-4.6.jar
log4j.jar
microba.jar
nanoxml-2.2.3.jar
org.eclipse.jdt.core_3.4.4.v_894_R34x.jar
org.eclipse.jdt.core_3.5.2.v_981_R35x.jar
oromatcher.jar
picocontainer.jar
resolver.jar
@@ -68,7 +68,7 @@ public class FoldingUpdate {
return CachedValuesManager.getManager(project).getCachedValue(editor, CODE_FOLDING_KEY, new CachedValueProvider<Runnable>() {
public Result<Runnable> compute() {
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
return getUpdateResult(file, document, quick, project, editor, applyDefaultState);
}
}, false);
@@ -34,10 +34,7 @@ import com.intellij.openapi.editor.highlighter.HighlighterIterator;
import com.intellij.openapi.editor.impl.DocumentImpl;
import com.intellij.openapi.editor.impl.EditorFactoryImpl;
import com.intellij.openapi.editor.impl.EditorImpl;
import com.intellij.openapi.editor.markup.HighlighterLayer;
import com.intellij.openapi.editor.markup.HighlighterTargetArea;
import com.intellij.openapi.editor.markup.MarkupModel;
import com.intellij.openapi.editor.markup.RangeHighlighter;
import com.intellij.openapi.editor.markup.*;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
@@ -258,19 +255,18 @@ public class LanguageConsoleImpl implements Disposable, TypeSafeDataProvider {
this.myTitle = title;
}
public void addToHistory(final String text, final ConsoleViewContentType contentType) {
final boolean scrollToEnd = shouldScrollHistoryToEnd();
public void addToHistory(final String text, final TextAttributes attributes) {
final Document history = myHistoryViewer.getDocument();
final MarkupModel markupModel = history.getMarkupModel(myProject);
final int offset = history.getTextLength();
history.insertString(offset, text);
if (!text.endsWith("\n")) history.insertString(history.getTextLength(), "\n");
markupModel.addRangeHighlighter(offset, history.getTextLength(), HighlighterLayer.SYNTAX, contentType.getAttributes(),
markupModel.addRangeHighlighter(offset,
history.getTextLength(),
HighlighterLayer.SYNTAX,
attributes,
HighlighterTargetArea.EXACT_RANGE);
queueUiUpdate(scrollToEnd);
}
public String addCurrentToHistory(final TextRange textRange, final boolean erase) {
final Ref<String> ref = Ref.create("");
final boolean scrollToEnd = shouldScrollHistoryToEnd();
@@ -286,7 +282,7 @@ public class LanguageConsoleImpl implements Disposable, TypeSafeDataProvider {
return ref.get();
}
private boolean shouldScrollHistoryToEnd() {
public boolean shouldScrollHistoryToEnd() {
final Rectangle visibleArea = myHistoryViewer.getScrollingModel().getVisibleArea();
final int lineNum = (visibleArea.y + visibleArea.height + myHistoryViewer.getLineHeight()) / myHistoryViewer.getLineHeight();
final int lineCount = myHistoryViewer.getDocument().getLineCount();
@@ -344,7 +340,7 @@ public class LanguageConsoleImpl implements Disposable, TypeSafeDataProvider {
return myPanel;
}
private void queueUiUpdate(final boolean forceScrollToEnd) {
public void queueUiUpdate(final boolean forceScrollToEnd) {
myForceScrollToEnd.compareAndSet(false, forceScrollToEnd);
myUpdateQueue.queue(new Update("UpdateUi") {
public void run() {
@@ -344,6 +344,10 @@ public abstract class AbstractFileIndex<IndexEntry extends FileIndexEntry> imple
return AbstractFileIndex.this.queryNeededFiles(myIncludeChangedFiles, myFileTypesToRefresh);
}
public int getNumberOfPendingUpdateJobs() {
return 0;
}
public void processFile(FileContent fileContent) {
updateIndexEntry(fileContent.getVirtualFile());
}
@@ -66,6 +66,10 @@ public class FileIndexRefreshCacheUpdater extends VirtualFileAdapter implements
}
}
public int getNumberOfPendingUpdateJobs() {
return 0;
}
public VirtualFile[] queryNeededFiles() {
return VfsUtil.toVirtualFileArray(myChangedFiles);
}
@@ -1190,6 +1190,10 @@ private boolean indexUnsavedDocument(final Document document, final ID<?, ?> req
return pair != null? pair.getSecond() : null;
}
public int getNumberOfPendingInvalidations() {
return myChangedFilesCollector.getNumberOfPendingInvalidations();
}
public Collection<VirtualFile> getFilesToUpdate(final Project project) {
final ProjectFileIndex projectIndex = ProjectRootManager.getInstance(project).getFileIndex();
return ContainerUtil.findAll(myChangedFilesCollector.getAllFilesToUpdate(), new Condition<VirtualFile>() {
@@ -1533,6 +1537,16 @@ private boolean indexUnsavedDocument(final Document document, final ID<?, ?> req
}
}
public int getNumberOfPendingInvalidations() {
r.lock();
try {
return myFutureInvalidations.size();
}
finally {
r.unlock();
}
}
public void ensureAllInvalidateTasksCompleted() {
final int size;
r.lock();
@@ -97,6 +97,10 @@ public class FileBasedIndexProjectHandler extends AbstractProjectComponent imple
}
private class RefreshCacheUpdater implements CacheUpdater {
public int getNumberOfPendingUpdateJobs() {
return myIndex.getNumberOfPendingInvalidations();
}
public VirtualFile[] queryNeededFiles() {
Collection<VirtualFile> files = myIndex.getFilesToUpdate(myProject);
return VfsUtil.toVirtualFileArray(files);
@@ -19,7 +19,7 @@ package com.intellij.util.indexing;
import com.intellij.ide.caches.CacheUpdater;
import com.intellij.ide.caches.FileContent;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.*;
import com.intellij.openapi.roots.CollectingContentIterator;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
@@ -38,6 +38,10 @@ public class UnindexedFilesUpdater implements CacheUpdater {
myProject = project;
}
public int getNumberOfPendingUpdateJobs() {
return myIndex.getNumberOfPendingInvalidations();
}
public VirtualFile[] queryNeededFiles() {
CollectingContentIterator finder = myIndex.createContentIterator();
FileBasedIndex.iterateIndexableFiles(finder, myProject);
@@ -20,8 +20,8 @@ import com.intellij.history.core.LocalVcs;
import com.intellij.history.core.Paths;
import com.intellij.history.core.tree.Entry;
import com.intellij.history.utils.LocalHistoryLog;
import com.intellij.ide.caches.FileContent;
import com.intellij.ide.caches.CacheUpdater;
import com.intellij.ide.caches.FileContent;
import com.intellij.openapi.command.CommandEvent;
import com.intellij.openapi.command.CommandListener;
import com.intellij.openapi.vfs.*;
@@ -59,6 +59,10 @@ public class EventDispatcher extends VirtualFileAdapter implements VirtualFileMa
return myRefreshDepth > 0;
}
public int getNumberOfPendingUpdateJobs() {
return 0;
}
public VirtualFile[] queryNeededFiles() {
return getOrInitProcessor().queryNeededFiles();
}
@@ -26,7 +26,10 @@ import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.containers.ContainerUtil;
import java.util.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class LocalHistoryCacheUpdater implements CacheUpdater {
private final LocalVcs myVcs;
@@ -82,6 +85,10 @@ public class LocalHistoryCacheUpdater implements CacheUpdater {
myProcessor.processFile(c);
}
public int getNumberOfPendingUpdateJobs() {
return 0;
}
public void updatingDone() {
myVcs.endChangeSet(myChangeSetName);
myVfsRoots = null;
@@ -35,10 +35,19 @@ public class FeatureStatisticsBundle {
}
public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) {
return CommonBundle.message(getBundle(), key, params);
return CommonBundle.message(getBundle(key), key, params);
}
private static ResourceBundle getBundle() {
private static ResourceBundle getBundle(final String key) {
// bundles provided by plugins
for (FeatureStatisticsBundleProvider provider : FeatureStatisticsBundleProvider.EP_NAME.getExtensions()) {
final ResourceBundle bundle = provider.getBundleFor(key);
if (bundle != null) {
return bundle;
}
}
// default bundle
ResourceBundle bundle = null;
if (ourBundle != null) bundle = ourBundle.get();
if (bundle == null) {
@@ -0,0 +1,31 @@
/*
* Copyright 2000-2010 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.featureStatistics;
import com.intellij.openapi.extensions.ExtensionPointName;
import org.jetbrains.annotations.Nullable;
import java.util.ResourceBundle;
/**
* @author Roman.Chernyatchik
*/
public interface FeatureStatisticsBundleProvider {
ExtensionPointName<FeatureStatisticsBundleProvider> EP_NAME = new ExtensionPointName<FeatureStatisticsBundleProvider>("com.intellij.featureStatBundle");
@Nullable
ResourceBundle getBundleFor(String key);
}
@@ -19,8 +19,13 @@ package com.intellij.ide.caches;
import com.intellij.openapi.vfs.VirtualFile;
public interface CacheUpdater {
int getNumberOfPendingUpdateJobs();
VirtualFile[] queryNeededFiles();
void processFile(FileContent fileContent);
void updatingDone();
void canceled();
}
@@ -44,6 +44,10 @@ public class ToggleDumbModeAction extends AnAction implements DumbAware {
if (project == null) return;
CacheUpdater updater = new CacheUpdater() {
public int getNumberOfPendingUpdateJobs() {
return 0;
}
public VirtualFile[] queryNeededFiles() {
while (myDumb) {
try {
@@ -107,6 +107,7 @@ public final class ActionManagerImpl extends ActionManagerEx implements Applicat
@NonNls public static final String RELATIVE_TO_ACTION_ATTR_NAME = "relative-to-action";
@NonNls public static final String FIRST_KEYSTROKE_ATTR_NAME = "first-keystroke";
@NonNls public static final String SECOND_KEYSTROKE_ATTR_NAME = "second-keystroke";
@NonNls public static final String REMOVE_SHORTCUT_ATTR_NAME = "remove";
@NonNls public static final String KEYMAP_ATTR_NAME = "keymap";
@NonNls public static final String KEYSTROKE_ATTR_NAME = "keystroke";
@NonNls public static final String REF_ATTR_NAME = "ref";
@@ -739,8 +740,13 @@ public final class ActionManagerImpl extends ActionManagerEx implements Applicat
reportActionError(pluginId, "keymap \"" + keymapName + "\" not found");
return;
}
keymap.addShortcut(actionId, new KeyboardShortcut(firstKeyStroke, secondKeyStroke));
final String removeOption = element.getAttributeValue(REMOVE_SHORTCUT_ATTR_NAME);
final KeyboardShortcut shortcut = new KeyboardShortcut(firstKeyStroke, secondKeyStroke);
if (Boolean.valueOf(removeOption)) {
keymap.removeShortcut(actionId, shortcut);
} else {
keymap.addShortcut(actionId, shortcut);
}
}
private static void processMouseShortcutNode(Element element, String actionId, PluginId pluginId) {
@@ -769,7 +775,12 @@ public final class ActionManagerImpl extends ActionManagerEx implements Applicat
return;
}
keymap.addShortcut(actionId, shortcut);
final String removeOption = element.getAttributeValue(REMOVE_SHORTCUT_ATTR_NAME);
if (Boolean.valueOf(removeOption)) {
keymap.removeShortcut(actionId, shortcut);
} else {
keymap.addShortcut(actionId, shortcut);
}
}
@Nullable
@@ -2300,7 +2300,9 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
CharSequence chars = myDocument.getCharsNoThreadCheck();
int nonWhitespaceOffset = CharArrayUtil.shiftForward(chars, lineStart, " \t");
if (nonWhitespaceOffset < lineEnd) {
return calcColumnNumber(nonWhitespaceOffset, line) / getIndentSize();
final int columnNumber = calcColumnNumber(nonWhitespaceOffset, line);
final int indentSize = getIndentSize();
return indentSize != 0 ? columnNumber / indentSize : columnNumber;
}
else {
int upIndent = goUp ? getIndents(line - 1, true, false) : 100;
@@ -49,6 +49,13 @@ class CacheUpdateRunner {
return mySession.getFilesToUpdate().size();
}
public int getNumberOfPendingUpdateJobs(ProgressIndicator indicator) {
if (mySession == null) {
mySession = new CacheUpdateSession(myUpdaters, indicator);
}
return mySession.getNumberOfPendingUpdateJobs();
}
public void processFiles(final ProgressIndicator indicator, boolean processInReadAction) {
try {
indicator.checkCanceled();
@@ -31,6 +31,7 @@ public class CacheUpdateSession {
private static final Logger LOG = Logger.getInstance("#" + CacheUpdateSession.class.getName());
private static final Key<Boolean> FAILED_TO_INDEX = Key.create(CacheUpdateSession.class.getSimpleName() + ".FAILED_TO_INDEX");
private final Collection<VirtualFile> myFilesToUpdate;
private final int myJobsToDo;
private final List<Pair<CacheUpdater, Collection<VirtualFile>>> myUpdatersWithFiles =
new ArrayList<Pair<CacheUpdater, Collection<VirtualFile>>>();
@@ -39,9 +40,11 @@ public class CacheUpdateSession {
myFilesToUpdate = new LinkedHashSet<VirtualFile>();
try {
int jobsCount = 0;
for (CacheUpdater each : updaters) {
indicator.checkCanceled();
try {
jobsCount += each.getNumberOfPendingUpdateJobs();
List<VirtualFile> updaterFiles = Arrays.asList(each.queryNeededFiles());
processedUpdaters.add(each);
myFilesToUpdate.addAll(updaterFiles);
@@ -54,6 +57,7 @@ public class CacheUpdateSession {
LOG.error(e);
}
}
myJobsToDo = jobsCount;
}
catch (ProcessCanceledException e) {
for (CacheUpdater each : processedUpdaters) {
@@ -63,6 +67,10 @@ public class CacheUpdateSession {
}
}
public int getNumberOfPendingUpdateJobs() {
return myJobsToDo;
}
public Collection<VirtualFile> getFilesToUpdate() {
return myFilesToUpdate;
}
@@ -111,8 +111,9 @@ public class DumbServiceImpl extends DumbService {
}
try {
final int size = runner.queryNeededFiles(indicator);
if (size < 50) {
// if not that many files found, process them on the spot, avoiding entering dumb mode
if ((size + runner.getNumberOfPendingUpdateJobs(indicator)) < 50) {
// If not that many files found, process them on the spot, avoiding entering dumb mode
// Consider number of pending tasks as well, becase they may take noticeable time to process even if the number of files is small
if (size > 0) {
runner.processFiles(indicator, false);
}
@@ -304,11 +304,15 @@ error.saving.license.data=Error saving license data.\n{0}
title.unable.to.save.data=Unable to Save Data
link.click.here.to.license.server.info=More info
link.purchase.commercial.license=To purchase a commercial license, please visit
license.panel.current.license.description=The license will expire on {0,date,MMMM dd, yyyy}
license.panel.autodescovered.license.server.tile=Default license server
license.panel.buildit.evaluation.expires.in=Remains {0} day(s)
editbox.license.user.name=User name:
editbox.license.license.key=License key:
radio.license.server.address=Enter license &server address
radio.license.data=Enter license &data
radio.evaluate=&Evaluate for free for 30 days
radio.default.license.server=&Default License Server
action.activate.tool.window=Activate {0} window
action.change.splitter.orientations=Change Splitter O_rientations
error.checkforupdates.connection.failed=Connection failed. Please check your network connection and try again.
@@ -104,4 +104,5 @@
<extensionPoint name="writingAccessProvider" area="IDEA_PROJECT" interface="com.intellij.openapi.vcs.readOnlyHandler.WritingAccessProvider"/>
<extensionPoint name="editorNotificationProvider" area="IDEA_PROJECT" interface="com.intellij.ui.EditorNotifications$Provider"/>
<extensionPoint name="featureStatBundle" interface="com.intellij.featureStatistics.FeatureStatisticsBundleProvider"/>
</extensionPoints>
@@ -941,5 +941,7 @@
<action id="Console.Hibernate.Properties"><keyboard-shortcut first-keystroke="alt ENTER"/></action>
<action id="Console.Hibernate.Close"><keyboard-shortcut first-keystroke="control alt shift F4"/></action>
<action id="Console.Hibernate.Terminate"><keyboard-shortcut first-keystroke="control alt shift DELETE"/></action>
<action id="Console.Python.Execute"><keyboard-shortcut first-keystroke="control ENTER"/></action>
</keymap>
</component>
@@ -21,6 +21,7 @@ import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.util.Collection;
/**
@@ -62,4 +63,6 @@ public interface XBreakpointManager {
void addBreakpointListener(@NotNull XBreakpointListener<XBreakpoint<?>> listener);
void removeBreakpointListener(@NotNull XBreakpointListener<XBreakpoint<?>> listener);
void addBreakpointListener(@NotNull XBreakpointListener<XBreakpoint<?>> listener, @NotNull Disposable parentDisposable);
void updateBreakpointPresentation(@NotNull XLineBreakpoint<?> breakpoint, @Nullable Icon icon, @Nullable String errorMessage);
}
@@ -34,6 +34,7 @@ import com.intellij.xdebugger.impl.XDebuggerManagerImpl;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.util.*;
/**
@@ -230,6 +231,14 @@ public class XBreakpointManagerImpl implements XBreakpointManager, PersistentSta
myAllBreakpointsDispatcher.addListener(listener, parentDisposable);
}
public void updateBreakpointPresentation(@NotNull XLineBreakpoint<?> breakpoint, @Nullable Icon icon, @Nullable String errorMessage) {
final CustomizedBreakpointPresentation presentation = new CustomizedBreakpointPresentation();
presentation.setErrorMessage(errorMessage);
presentation.setIcon(icon);
((XLineBreakpointImpl)breakpoint).setCustomizedPresentation(presentation);
myLineBreakpointManager.queueBreakpointUpdate(breakpoint);
}
public BreakpointManagerState getState() {
myDependentBreakpointManager.saveState();
BreakpointManagerState state = new BreakpointManagerState();
@@ -58,6 +58,7 @@ public class XLineBreakpointImpl<P extends XBreakpointProperties> extends XBreak
private XSourcePosition mySourcePosition;
@NonNls private static final String BR_NBSP = "<br>&nbsp;";
private boolean myDisposed;
private CustomizedBreakpointPresentation myCustomizedPresentation;
public XLineBreakpointImpl(final XLineBreakpointType<P> type, XBreakpointManagerImpl breakpointManager, String url, int line, final @Nullable P properties) {
super(type, breakpointManager, properties, new LineBreakpointState<P>(true, type.getId(), url, line));
@@ -141,15 +142,15 @@ public class XLineBreakpointImpl<P extends XBreakpointProperties> extends XBreak
}
}
}
if (myCustomizedPresentation != null) {
final Icon icon = myCustomizedPresentation.getIcon();
if (icon != null) {
return icon;
}
}
return myType.getEnabledIcon();
}
@Nullable
private CustomizedBreakpointPresentation getCustomizedPresentation() {
final XDebugSessionImpl currentSession = getBreakpointManager().getDebuggerManager().getCurrentSession();
return currentSession != null ? currentSession.getBreakpointPresentation(this) : null;
}
public int getLine() {
return myState.getLine();
}
@@ -270,8 +271,15 @@ public class XLineBreakpointImpl<P extends XBreakpointProperties> extends XBreak
@Nullable
private String getErrorMessage() {
CustomizedBreakpointPresentation presentation = getCustomizedPresentation();
return presentation != null ? presentation.getErrorMessage() : null;
final XDebugSessionImpl currentSession = getBreakpointManager().getDebuggerManager().getCurrentSession();
if (currentSession != null) {
CustomizedBreakpointPresentation presentation = currentSession.getBreakpointPresentation(this);
if (presentation != null) {
final String message = presentation.getErrorMessage();
if (message != null) return message;
}
}
return myCustomizedPresentation != null ? myCustomizedPresentation.getErrorMessage() : null;
}
public void updatePosition() {
@@ -289,6 +297,10 @@ public class XLineBreakpointImpl<P extends XBreakpointProperties> extends XBreak
}
}
public void setCustomizedPresentation(CustomizedBreakpointPresentation presentation) {
myCustomizedPresentation = presentation;
}
@Tag("line-breakpoint")
public static class LineBreakpointState<P extends XBreakpointProperties> extends XBreakpointBase.BreakpointState<XLineBreakpoint<P>, P, XLineBreakpointType<P>> {
private String myFileUrl;
@@ -67,4 +67,13 @@ public interface KeyboardShortcut extends DomElement {
GenericAttributeValue<String> getSecondKeystroke();
/**
* Returns the value of the remove child.
* Attribute remove option
* @return the value of the remove child.
*/
@NotNull
GenericAttributeValue<String> getRemove();
}
@@ -68,6 +68,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.*;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.literals.GrLiteral;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.path.GrMethodCallExpression;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.*;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrAccessorMethod;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMember;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMethod;
import org.jetbrains.plugins.groovy.lang.psi.api.toplevel.imports.GrImportStatement;
@@ -1124,7 +1125,7 @@ public class GroovyAnnotator extends GroovyElementVisitor implements Annotator {
boolean isStatic = member.hasModifierProperty(GrModifier.STATIC);
Annotation annotation = holder.createInfoAnnotation(refExpr.getReferenceNameElement(), null);
if (member instanceof PsiField ) {
if (member instanceof PsiField || member instanceof GrAccessorMethod) {
annotation.setTextAttributes(isStatic ? DefaultHighlighter.STATIC_FIELD : DefaultHighlighter.INSTANCE_FIELD);
return;
}