Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
71d5027f
Commit
71d5027f
authored
6 years ago
by
Daniil Ovchinnikov
Browse files
Options
Download
Email Patches
Plain Diff
[groovy] follow up IDEA-CR-41748
parent
c6b2fb94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/groovy/test/org/jetbrains/plugins/groovy/lang/psi/GroovyPsiEventsTest.java
+16
-23
...etbrains/plugins/groovy/lang/psi/GroovyPsiEventsTest.java
with
16 additions
and
23 deletions
+16
-23
plugins/groovy/test/org/jetbrains/plugins/groovy/lang/psi/GroovyPsiEventsTest.java
+
16
-
23
View file @
71d5027f
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package
org.jetbrains.plugins.groovy.lang.psi
;
import
com.intellij.openapi.application.ApplicationManager
;
...
...
@@ -6,7 +7,6 @@ import com.intellij.openapi.editor.Document;
import
com.intellij.openapi.project.Project
;
import
com.intellij.openapi.util.Ref
;
import
com.intellij.psi.PsiDocumentManager
;
import
com.intellij.psi.PsiManager
;
import
com.intellij.psi.PsiTreeChangeAdapter
;
import
com.intellij.psi.PsiTreeChangeEvent
;
import
com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase
;
...
...
@@ -24,28 +24,21 @@ public class GroovyPsiEventsTest extends LightCodeInsightFixtureTestCase {
gotIt
.
set
(
true
);
}
};
PsiManager
manager
=
getPsiManager
();
try
{
manager
.
addPsiTreeChangeListener
(
listener
);
Project
project
=
getProject
();
GroovyFile
file
=
GroovyPsiElementFactory
.
getInstance
(
project
).
createGroovyFile
(
"/** This is doc comment*/class C{}"
,
true
,
null
);
PsiDocumentManager
docManager
=
PsiDocumentManager
.
getInstance
(
project
);
Document
doc
=
docManager
.
getDocument
(
file
);
assertNotNull
(
doc
);
CommandProcessor
.
getInstance
().
executeCommand
(
project
,
()
->
ApplicationManager
.
getApplication
().
runWriteAction
(()
->
{
doc
.
insertString
(
3
,
" "
);
docManager
.
commitDocument
(
doc
);
}),
"file text set"
,
this
);
}
finally
{
manager
.
removePsiTreeChangeListener
(
listener
);
}
getPsiManager
().
addPsiTreeChangeListener
(
listener
,
getTestRootDisposable
());
Project
project
=
getProject
();
GroovyFile
file
=
GroovyPsiElementFactory
.
getInstance
(
project
).
createGroovyFile
(
"/** This is doc comment*/class C{}"
,
true
,
null
);
PsiDocumentManager
docManager
=
PsiDocumentManager
.
getInstance
(
project
);
Document
doc
=
docManager
.
getDocument
(
file
);
assertNotNull
(
doc
);
CommandProcessor
.
getInstance
().
executeCommand
(
project
,
()
->
ApplicationManager
.
getApplication
().
runWriteAction
(()
->
{
doc
.
insertString
(
3
,
" "
);
docManager
.
commitDocument
(
doc
);
}),
"file text set"
,
this
);
assertTrue
(
gotIt
.
get
());
}
}
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