Use TextFieldWithAutoCompletion inside Intention
Hi, I need to open a dialog inside an intention, and inside that dialog I want to use TextFieldWithAutoCompletion, but when I use Ctrl+Space in that situation the IDE complains with:"Completion should not be invoked inside write action"
Is there any way to use TextFieldWithAutoCompletion inside an intention?
Thanks !!
请先登录再写评论。
Please see com.intellij.codeInsight.intention.IntentionAction#startInWriteAction
Perfect, that did the trick, thanks Yann !!
Could you tell me if I should be aware of something else now that startInWriteAction is returning false? I mean, I need to write new code inside my intention... should I manage that in a special way now?
If you perform any write operations in your intention (most probably you do) you'll be responsible to wrap them in corresponding WriteAction yourself now. see http://www.jetbrains.org/intellij/sdk/docs/basics/architectural_overview/general_threading_rules.html
OK, thanks Yann!