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
eeb8feb4
Commit
eeb8feb4
authored
12 years ago
by
irengrig
Browse files
Options
Download
Plain Diff
Merge remote branch 'origin/117' into 117
parents
ff7b0366
50da56c4
Branches unavailable
Tags unavailable
No related merge requests found
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationInspection.java
+1
-0
.../codeInspection/deadCode/UnusedDeclarationInspection.java
platform/lang-impl/src/com/intellij/codeInspection/ex/DescriptorProviderInspection.java
+1
-0
...ellij/codeInspection/ex/DescriptorProviderInspection.java
platform/lang-impl/src/com/intellij/codeInspection/reference/RefManagerImpl.java
+1
-0
...com/intellij/codeInspection/reference/RefManagerImpl.java
platform/platform-impl/src/com/intellij/notification/impl/NotificationsConfigurationImpl.java
+9
-0
...lij/notification/impl/NotificationsConfigurationImpl.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/GroovyParser.java
+5
-1
...rg/jetbrains/plugins/groovy/lang/parser/GroovyParser.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/typedef/GrEnumConstantInitializerImpl.java
+1
-2
...mpl/statements/typedef/GrEnumConstantInitializerImpl.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/GrClassImplUtil.java
+5
-2
...tbrains/plugins/groovy/lang/psi/util/GrClassImplUtil.java
plugins/groovy/test/org/jetbrains/plugins/groovy/lang/parser/StatementsParsingTest.groovy
+1
-0
...s/plugins/groovy/lang/parser/StatementsParsingTest.groovy
plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/ResolvePropertyTest.groovy
+16
-4
...ns/plugins/groovy/lang/resolve/ResolvePropertyTest.groovy
plugins/groovy/testdata/parsing/groovy/statements/for/for12.test
+20
-0
.../groovy/testdata/parsing/groovy/statements/for/for12.test
with
60 additions
and
9 deletions
+60
-9
java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationInspection.java
+
1
-
0
View file @
eeb8feb4
...
...
@@ -659,6 +659,7 @@ public class UnusedDeclarationInspection extends FilteringInspectionTool {
if
(!
getIgnoredRefElements
().
contains
(
refEntity
)
&&
filter
.
accepts
((
RefJavaElement
)
refEntity
))
{
if
(
refEntity
instanceof
RefImplicitConstructor
)
refEntity
=
((
RefImplicitConstructor
)
refEntity
).
getOwnerClass
();
Element
element
=
refEntity
.
getRefManager
().
export
(
refEntity
,
parentNode
,
-
1
);
if
(
element
==
null
)
return
;
@NonNls
Element
problemClassElement
=
new
Element
(
InspectionsBundle
.
message
(
"inspection.export.results.problem.element.tag"
));
if
(
refEntity
instanceof
RefElement
)
{
...
...
This diff is collapsed.
Click to expand it.
platform/lang-impl/src/com/intellij/codeInspection/ex/DescriptorProviderInspection.java
+
1
-
0
View file @
eeb8feb4
...
...
@@ -286,6 +286,7 @@ public abstract class DescriptorProviderInspection extends InspectionTool implem
@NonNls
String
problemText
=
StringUtil
.
replace
(
StringUtil
.
replace
(
template
,
"#ref"
,
psiElement
!=
null
?
ProblemDescriptionNode
.
extractHighlightedText
(
description
,
psiElement
):
""
)
,
" #loc "
,
" "
);
Element
element
=
refEntity
.
getRefManager
().
export
(
refEntity
,
parentNode
,
line
);
if
(
element
==
null
)
return
;
@NonNls
Element
problemClassElement
=
new
Element
(
InspectionsBundle
.
message
(
"inspection.export.results.problem.element.tag"
));
problemClassElement
.
addContent
(
getDisplayName
());
if
(
refEntity
instanceof
RefElement
){
...
...
This diff is collapsed.
Click to expand it.
platform/lang-impl/src/com/intellij/codeInspection/reference/RefManagerImpl.java
+
1
-
0
View file @
eeb8feb4
...
...
@@ -208,6 +208,7 @@ public class RefManagerImpl extends RefManager {
final
RefElement
refElement
=
(
RefElement
)
refEntity
;
PsiElement
psiElement
=
refElement
.
getElement
();
PsiFile
psiFile
=
psiElement
.
getContainingFile
();
if
(
psiFile
==
null
)
return
null
;
Element
fileElement
=
new
Element
(
"file"
);
Element
lineElement
=
new
Element
(
"line"
);
...
...
This diff is collapsed.
Click to expand it.
platform/platform-impl/src/com/intellij/notification/impl/NotificationsConfigurationImpl.java
+
9
-
0
View file @
eeb8feb4
...
...
@@ -43,6 +43,7 @@ import java.util.*;
public
class
NotificationsConfigurationImpl
extends
NotificationsConfiguration
implements
ApplicationComponent
,
PersistentStateComponent
<
Element
>
{
private
static
final
Logger
LOG
=
Logger
.
getInstance
(
"#com.intellij.notification.impl.NotificationsConfiguration"
);
private
static
final
String
SHOW_BALLOONS_ATTRIBUTE
=
"showBalloons"
;
private
final
Map
<
String
,
NotificationSettings
>
myIdToSettingsMap
=
new
LinkedHashMap
<
String
,
NotificationSettings
>();
private
final
Map
<
String
,
String
>
myToolWindowCapable
=
new
java
.
util
.
LinkedHashMap
<
String
,
String
>();
...
...
@@ -167,6 +168,10 @@ public class NotificationsConfigurationImpl extends NotificationsConfiguration i
for
(
String
entry:
myToolWindowCapable
.
keySet
())
{
element
.
addContent
(
new
Element
(
"toolWindow"
).
setAttribute
(
"group"
,
entry
));
}
//noinspection NonPrivateFieldAccessedInSynchronizedContext
if
(!
SHOW_BALLOONS
)
{
element
.
setAttribute
(
SHOW_BALLOONS_ATTRIBUTE
,
"false"
);
}
return
element
;
}
...
...
@@ -187,5 +192,9 @@ public class NotificationsConfigurationImpl extends NotificationsConfiguration i
}
}
_remove
(
"Log Only"
);
if
(
"false"
.
equals
(
state
.
getAttributeValue
(
SHOW_BALLOONS_ATTRIBUTE
)))
{
//noinspection NonPrivateFieldAccessedInSynchronizedContext
SHOW_BALLOONS
=
false
;
}
}
}
This diff is collapsed.
Click to expand it.
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/GroovyParser.java
+
5
-
1
View file @
eeb8feb4
...
...
@@ -337,7 +337,11 @@ public class GroovyParser implements PsiParser {
return
true
;
}
if
(
GroovyTokenTypes
.
kIMPORT
.
equals
(
builder
.
getTokenType
()))
{
if
(
isBlockStatementNeeded
&&
mSEMI
==
builder
.
getTokenType
())
{
return
true
;
}
if
(
GroovyTokenTypes
.
kIMPORT
.
equals
(
builder
.
getTokenType
()))
{
PsiBuilder
.
Marker
marker
=
builder
.
mark
();
ImportStatement
.
parse
(
builder
,
this
);
marker
.
error
(
GroovyBundle
.
message
(
"import.not.allowed"
));
...
...
This diff is collapsed.
Click to expand it.
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/typedef/GrEnumConstantInitializerImpl.java
+
1
-
2
View file @
eeb8feb4
...
...
@@ -34,8 +34,7 @@ import org.jetbrains.plugins.groovy.lang.psi.stubs.GrTypeDefinitionStub;
* @author Maxim.Medvedev
*/
public
class
GrEnumConstantInitializerImpl
extends
GrAnonymousClassDefinitionImpl
implements
GrEnumConstantInitializer
{
private
static
final
Logger
LOG
=
Logger
.
getInstance
(
"#org.jetbrains.plugins.groovy.lang.psi.impl.statements.typedef.GrEnumConstantInitializerImpl"
);
private
static
final
Logger
LOG
=
Logger
.
getInstance
(
GrEnumConstantInitializerImpl
.
class
);
public
GrEnumConstantInitializerImpl
(
@NotNull
ASTNode
node
)
{
super
(
node
);
...
...
This diff is collapsed.
Click to expand it.
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/GrClassImplUtil.java
+
5
-
2
View file @
eeb8feb4
...
...
@@ -38,6 +38,7 @@ import org.jetbrains.plugins.groovy.GroovyFileType;
import
org.jetbrains.plugins.groovy.lang.psi.api.statements.GrField
;
import
org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrClosableBlock
;
import
org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.literals.GrLiteral
;
import
org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrEnumConstantInitializer
;
import
org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrReferenceList
;
import
org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTypeDefinition
;
import
org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTypeDefinitionBody
;
...
...
@@ -361,14 +362,16 @@ public class GrClassImplUtil {
return
true
;
}
p
rivate
static
boolean
isSameDeclaration
(
PsiElement
place
,
PsiElement
element
)
{
p
ublic
static
boolean
isSameDeclaration
(
PsiElement
place
,
PsiElement
element
)
{
if
(
element
instanceof
GrAccessorMethod
)
element
=
((
GrAccessorMethod
)
element
).
getProperty
();
if
(!(
element
instanceof
GrField
))
return
false
;
while
(
place
!=
null
)
{
place
=
place
.
getParent
();
if
(
place
==
element
)
return
true
;
place
=
place
.
getParent
();
if
(
place
instanceof
GrClosableBlock
)
return
false
;
if
(
place
instanceof
GrEnumConstantInitializer
)
return
false
;
}
return
false
;
}
...
...
This diff is collapsed.
Click to expand it.
plugins/groovy/test/org/jetbrains/plugins/groovy/lang/parser/StatementsParsingTest.groovy
+
1
-
0
View file @
eeb8feb4
...
...
@@ -61,6 +61,7 @@ public class StatementsParsingTest extends GroovyParsingTestCase {
public
void
testFor$for1
()
throws
Throwable
{
doTest
();
}
public
void
testFor$for10
()
throws
Throwable
{
doTest
();
}
public
void
testFor$for11
()
throws
Throwable
{
doTest
();
}
public
void
testFor$for12
()
throws
Throwable
{
doTest
();
}
public
void
testFor$for2
()
throws
Throwable
{
doTest
();
}
public
void
testFor$for3
()
throws
Throwable
{
doTest
();
}
public
void
testFor$for4
()
throws
Throwable
{
doTest
();
}
...
...
This diff is collapsed.
Click to expand it.
plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/ResolvePropertyTest.groovy
+
16
-
4
View file @
eeb8feb4
...
...
@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.jetbrains.plugins.groovy.lang.resolve
;
package
org.jetbrains.plugins.groovy.lang.resolve
import
com.intellij.psi.*
import
com.intellij.psi.util.PropertyUtil
import
org.jetbrains.plugins.groovy.GroovyFileType
import
org.jetbrains.plugins.groovy.lang.psi.GrReferenceElement
...
...
@@ -32,8 +32,6 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMe
import
org.jetbrains.plugins.groovy.lang.psi.api.toplevel.GrTopStatement
import
org.jetbrains.plugins.groovy.refactoring.GroovyRefactoringUtil
import
org.jetbrains.plugins.groovy.util.TestUtils
import
com.intellij.psi.*
/**
* @author ven
*/
...
...
@@ -731,6 +729,20 @@ print map.cla<caret>ss''')
assertInstanceOf
(
resolved
,
GrField
)
assertEquals
(
resolved
.
containingClass
.
name
,
'B'
)
}
void
testResolveEnumConstantInsideItsInitializer
()
{
def
ref
=
configureByText
(
'''\
enum MyEnum {
CONST {
void get() {
C<caret>ONST
}
}
}
'''
)
assertNotNull
(
ref
)
}
}
This diff is collapsed.
Click to expand it.
plugins/groovy/testdata/parsing/groovy/statements/for/for12.test
0 → 100644
+
20
-
0
View file @
eeb8feb4
for
(
i
in
[]);
-----
Groovy
script
For
statement
PsiElement
(
for
)(
'for'
)
PsiWhiteSpace
(
' '
)
PsiElement
(()(
'('
)
In
clause
Parameter
Modifiers
<
empty
list
>
PsiElement
(
identifier
)(
'i'
)
PsiWhiteSpace
(
' '
)
PsiElement
(
in
)(
'in'
)
PsiWhiteSpace
(
' '
)
Generalized
list
PsiElement
([)(
'['
)
PsiElement
(])(
']'
)
PsiElement
())(
')'
)
PsiElement
(;)(
';'
)
\ 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