Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
2922dbc6
Commit
2922dbc6
authored
7 years ago
by
Yaroslav Pankratyev
Browse files
Options
Download
Email Patches
Plain Diff
IDEA-139173 PresentationAnnotationInspection testdata fixes + minor improvements
parent
8d2e7b6f
Branches unavailable
Tags unavailable
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
plugins/devkit/src/inspections/PresentationAnnotationInspection.java
+1
-4
...kit/src/inspections/PresentationAnnotationInspection.java
plugins/devkit/testData/inspections/presentation/AbsentIconParam.java
+5
-0
...it/testData/inspections/presentation/AbsentIconParam.java
plugins/devkit/testData/inspections/presentation/InvalidIcon.java
+2
-2
...devkit/testData/inspections/presentation/InvalidIcon.java
plugins/devkit/testSources/inspections/PresentationAnnotationInspectionTest.java
+4
-0
...ces/inspections/PresentationAnnotationInspectionTest.java
with
12 additions
and
6 deletions
+12
-6
plugins/devkit/src/inspections/PresentationAnnotationInspection.java
+
1
-
4
View file @
2922dbc6
...
...
@@ -43,7 +43,7 @@ public class PresentationAnnotationInspection extends DevKitUastInspectionBase {
return
;
}
UExpression
iconExpression
=
annotation
.
findAttributeValue
(
"icon"
);
UExpression
iconExpression
=
annotation
.
find
Declared
AttributeValue
(
"icon"
);
if
(
iconExpression
==
null
)
{
return
;
}
...
...
@@ -53,9 +53,6 @@ public class PresentationAnnotationInspection extends DevKitUastInspectionBase {
LOG
.
error
(
"Unexpected null value of @Presentation#icon expression PSI: "
+
element
);
return
;
}
if
(!
iconExpressionPsi
.
isPhysical
())
{
return
;
}
PsiReference
[]
references
=
iconExpressionPsi
.
getReferences
();
for
(
PsiReference
reference
:
references
)
{
...
...
This diff is collapsed.
Click to expand it.
plugins/devkit/testData/inspections/presentation/AbsentIconParam.java
0 → 100644
+
5
-
0
View file @
2922dbc6
import
com.intellij.ide.presentation.Presentation
;
@Presentation
(
typeName
=
"TypeName"
)
public
class
AbsentIconParam
{
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
plugins/devkit/testData/inspections/presentation/InvalidIcon.java
+
2
-
2
View file @
2922dbc6
import
com.intellij.ide.presentation.Presentation
;
@Presentation
(
icon
=
"<error descr="
Cannot
resolve
symbol
'
InvalidIconPath
'
">InvalidIconPath</error>"
)
@Presentation
(
icon
=
"<error descr="
Cannot
resolve
icon
'
InvalidIconPath
'
">InvalidIconPath</error>"
)
class
InvalidIcon
{
}
@Presentation
(
icon
=
"<error descr="
Cannot
resolve
symbol
''
"></error>"
)
@Presentation
(
icon
=
"<error descr="
Cannot
resolve
icon
''
"></error>"
)
class
EmptyIcon
{
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
plugins/devkit/testSources/inspections/PresentationAnnotationInspectionTest.java
+
4
-
0
View file @
2922dbc6
...
...
@@ -64,4 +64,8 @@ public class PresentationAnnotationInspectionTest extends JavaCodeInsightFixture
public
void
testInvalidIcon
()
{
myFixture
.
testHighlighting
(
"InvalidIcon.java"
);
}
public
void
testForAbsentIconParam
()
{
myFixture
.
testHighlighting
(
"AbsentIconParam.java"
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help