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 !!

4 comments
Comment actions Permalink

Please see com.intellij.codeInsight.intention.IntentionAction#startInWriteAction


0
Comment actions Permalink

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?

0
Comment actions Permalink

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

0

Please sign in to leave a comment.