when showing file-level annotation, also set label tooltip to passed highlighting info value (usage: user can better see the automatically created long error, for instance, with file path) for WEB-24210 Internal TS Lint Problem

This commit is contained in:
irengrig
2016-11-21 14:44:47 +01:00
parent 4f30ebe588
commit a96758dfd7
3 changed files with 4 additions and 2 deletions
@@ -107,6 +107,7 @@ public class HighlightInfo implements Segment {
setFlag(FROM_INJECTION_MASK, fromInjection);
}
@Nullable
public String getToolTip() {
String toolTip = this.toolTip;
String description = this.description;
@@ -223,7 +223,7 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzerEx implements Pers
if (fileEditor instanceof TextEditor) {
FileLevelIntentionComponent component = new FileLevelIntentionComponent(info.getDescription(), info.getSeverity(),
info.getGutterIconRenderer(), info.quickFixActionRanges,
project, psiFile, ((TextEditor)fileEditor).getEditor());
project, psiFile, ((TextEditor)fileEditor).getEditor(), info.getToolTip());
manager.addTopComponent(fileEditor, component);
List<HighlightInfo> fileLevelInfos = fileEditor.getUserData(FILE_LEVEL_HIGHLIGHTS);
if (fileLevelInfos == null) {
@@ -56,7 +56,7 @@ public class FileLevelIntentionComponent extends EditorNotificationPanel {
@Nullable final List<Pair<HighlightInfo.IntentionActionDescriptor, TextRange>> intentions,
@NotNull final Project project,
@NotNull final PsiFile psiFile,
@NotNull final Editor editor) {
@NotNull final Editor editor, @Nullable String tooltip) {
myProject = project;
myBackground = getColor(severity);
@@ -79,6 +79,7 @@ public class FileLevelIntentionComponent extends EditorNotificationPanel {
}
myLabel.setText(description);
myLabel.setToolTipText(tooltip);
if (gutterMark != null) {
myLabel.setIcon(gutterMark.getIcon());
}