void () { extend( CompletionType.BASIC, psiElement() .withLanguage(PythonLanguage.getInstance()) .and(INSIDE_EXPR) .andNot(IN_IMPORT_STMT) // expressions there are not logical anyway //.andNot(IN_PARAM_LIST) .andNot(IN_DEFINITION) .andNot(AFTER_QUALIFIER).andNot(IN_STRING_LITERAL) , new CompletionProvider<CompletionParameters>() { protected void addCompletions(@NotNull final CompletionParameters parameters, final ProcessingContext context, @NotNull final CompletionResultSet result ) { final @NonNls String[] space_strings = {"if"}; putKeywords(space_strings, TailType.SPACE, result); } } ); }