mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
the completion consumers are to handle CompletionResult instead of LookupElement now
This commit is contained in:
+7
-7
@@ -39,10 +39,10 @@ public abstract class AbstractBasicToClassNameDelegator extends CompletionContri
|
||||
if (!isClassNameCompletionSupported(result, file, position)) return;
|
||||
|
||||
final Ref<Boolean> empty = Ref.create(true);
|
||||
result.runRemainingContributors(parameters, new Consumer<LookupElement>() {
|
||||
public void consume(final LookupElement lookupElement) {
|
||||
result.runRemainingContributors(parameters, new Consumer<CompletionResult>() {
|
||||
public void consume(final CompletionResult lookupElement) {
|
||||
empty.set(false);
|
||||
result.addElement(lookupElement);
|
||||
result.passResult(lookupElement);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -59,10 +59,10 @@ public abstract class AbstractBasicToClassNameDelegator extends CompletionContri
|
||||
}
|
||||
|
||||
|
||||
CompletionService.getCompletionService().getVariantsFromContributors(classParams, null, new Consumer<LookupElement>() {
|
||||
public void consume(final LookupElement lookupElement) {
|
||||
updateProperties(lookupElement);
|
||||
result.addElement(lookupElement);
|
||||
CompletionService.getCompletionService().getVariantsFromContributors(classParams, null, new Consumer<CompletionResult>() {
|
||||
public void consume(final CompletionResult lookupElement) {
|
||||
updateProperties(lookupElement.getLookupElement());
|
||||
result.passResult(lookupElement);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+3
-4
@@ -16,7 +16,6 @@
|
||||
package com.intellij.codeInsight.completion;
|
||||
|
||||
import com.intellij.codeInsight.ExpectedTypeInfo;
|
||||
import com.intellij.codeInsight.lookup.LookupElement;
|
||||
import com.intellij.codeInsight.lookup.LookupItem;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import static com.intellij.patterns.PsiJavaPatterns.psiElement;
|
||||
@@ -40,10 +39,10 @@ public class NullSmartCompletionContributor extends CompletionContributor{
|
||||
protected void addCompletions(final CompletionParameters parameters,
|
||||
final CompletionResultSet result, final Collection<ExpectedTypeInfo> infos) {
|
||||
final Ref<Boolean> empty = Ref.create(true);
|
||||
result.runRemainingContributors(parameters, new Consumer<LookupElement>() {
|
||||
public void consume(final LookupElement lookupElement) {
|
||||
result.runRemainingContributors(parameters, new Consumer<CompletionResult>() {
|
||||
public void consume(final CompletionResult lookupElement) {
|
||||
empty.set(false);
|
||||
result.addElement(lookupElement);
|
||||
result.passResult(lookupElement);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.codeInsight.completion;
|
||||
|
||||
import com.intellij.codeInsight.lookup.LookupElement;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public class CompletionResult {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.completion.CompletionResult");
|
||||
private final LookupElement myLookupElement;
|
||||
private final PrefixMatcher myMatcher;
|
||||
private final CompletionSorter mySorter;
|
||||
|
||||
private CompletionResult(LookupElement lookupElement, PrefixMatcher matcher, CompletionSorter sorter) {
|
||||
myLookupElement = lookupElement;
|
||||
myMatcher = matcher;
|
||||
mySorter = sorter;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static CompletionResult wrap(LookupElement lookupElement, PrefixMatcher matcher, CompletionSorter sorter) {
|
||||
if (matcher.prefixMatches(lookupElement)) {
|
||||
return new CompletionResult(lookupElement, matcher, sorter);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public PrefixMatcher getPrefixMatcher() {
|
||||
return myMatcher;
|
||||
}
|
||||
|
||||
public CompletionSorter getSorter() {
|
||||
return mySorter;
|
||||
}
|
||||
|
||||
public LookupElement getLookupElement() {
|
||||
return myLookupElement;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public CompletionResult withLookupElement(@NotNull LookupElement element) {
|
||||
if (!myMatcher.prefixMatches(element)) {
|
||||
throw new AssertionError("The new element doesn't match the prefix");
|
||||
}
|
||||
return new CompletionResult(element, myMatcher, mySorter);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,18 +22,18 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public abstract class CompletionResultSet {
|
||||
private final PrefixMatcher myPrefixMatcher;
|
||||
private final Consumer<LookupElement> myConsumer;
|
||||
private final Consumer<CompletionResult> myConsumer;
|
||||
protected final CompletionService myCompletionService = CompletionService.getCompletionService();
|
||||
protected final CompletionContributor myContributor;
|
||||
private boolean myStopped;
|
||||
|
||||
protected CompletionResultSet(final PrefixMatcher prefixMatcher, Consumer<LookupElement> consumer, CompletionContributor contributor) {
|
||||
protected CompletionResultSet(final PrefixMatcher prefixMatcher, Consumer<CompletionResult> consumer, CompletionContributor contributor) {
|
||||
myPrefixMatcher = prefixMatcher;
|
||||
myConsumer = consumer;
|
||||
myContributor = contributor;
|
||||
}
|
||||
|
||||
protected Consumer<LookupElement> getConsumer() {
|
||||
protected Consumer<CompletionResult> getConsumer() {
|
||||
return myConsumer;
|
||||
}
|
||||
|
||||
@@ -43,6 +43,10 @@ public abstract class CompletionResultSet {
|
||||
*/
|
||||
public abstract void addElement(@NotNull final LookupElement element);
|
||||
|
||||
public void passResult(@NotNull CompletionResult result) {
|
||||
myConsumer.consume(result);
|
||||
}
|
||||
|
||||
public void addAllElements(@NotNull final Iterable<LookupElement> elements) {
|
||||
for (LookupElement element : elements) {
|
||||
addElement(element);
|
||||
@@ -79,11 +83,11 @@ public abstract class CompletionResultSet {
|
||||
myStopped = true;
|
||||
}
|
||||
|
||||
public void runRemainingContributors(CompletionParameters parameters, Consumer<LookupElement> consumer) {
|
||||
public void runRemainingContributors(CompletionParameters parameters, Consumer<CompletionResult> consumer) {
|
||||
runRemainingContributors(parameters, consumer, true);
|
||||
}
|
||||
|
||||
public void runRemainingContributors(CompletionParameters parameters, Consumer<LookupElement> consumer, final boolean stop) {
|
||||
public void runRemainingContributors(CompletionParameters parameters, Consumer<CompletionResult> consumer, final boolean stop) {
|
||||
if (stop) {
|
||||
stopHere();
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.psi.Weigher;
|
||||
import com.intellij.reference.SoftReference;
|
||||
import com.intellij.util.Consumer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -35,7 +34,6 @@ import java.util.List;
|
||||
* @author peter
|
||||
*/
|
||||
public abstract class CompletionService {
|
||||
private static final Key<SoftReference<CompletionProcess>> INVOLVED_IN_COMPLETION_KEY = Key.create("INVOLVED_IN_COMPLETION_KEY");
|
||||
public static final Key<CompletionStatistician> STATISTICS_KEY = Key.create("completion");
|
||||
/**
|
||||
* A "weigher" extension key (see {@link Weigher}) to sort completion items by priority and move the heaviest to the top of the Lookup.
|
||||
@@ -72,7 +70,7 @@ public abstract class CompletionService {
|
||||
*/
|
||||
public void getVariantsFromContributors(final CompletionParameters parameters,
|
||||
@Nullable final CompletionContributor from,
|
||||
final Consumer<LookupElement> consumer) {
|
||||
final Consumer<CompletionResult> consumer) {
|
||||
final List<CompletionContributor> contributors = CompletionContributor.forParameters(parameters);
|
||||
final boolean dumb = DumbService.getInstance(parameters.getPosition().getProject()).isDumb();
|
||||
|
||||
@@ -96,7 +94,7 @@ public abstract class CompletionService {
|
||||
* @param contributor
|
||||
* @return
|
||||
*/
|
||||
public abstract CompletionResultSet createResultSet(CompletionParameters parameters, Consumer<LookupElement> consumer,
|
||||
public abstract CompletionResultSet createResultSet(CompletionParameters parameters, Consumer<CompletionResult> consumer,
|
||||
@NotNull CompletionContributor contributor);
|
||||
|
||||
@Nullable
|
||||
@@ -109,13 +107,13 @@ public abstract class CompletionService {
|
||||
* @return all suitable lookup elements
|
||||
*/
|
||||
@NotNull
|
||||
public LookupElement[] performCompletion(final CompletionParameters parameters, final Consumer<LookupElement> consumer) {
|
||||
public LookupElement[] performCompletion(final CompletionParameters parameters, final Consumer<CompletionResult> consumer) {
|
||||
final Collection<LookupElement> lookupSet = new LinkedHashSet<LookupElement>();
|
||||
|
||||
getVariantsFromContributors(parameters, null, new Consumer<LookupElement>() {
|
||||
public void consume(final LookupElement lookupElement) {
|
||||
if (lookupSet.add(lookupElement)) {
|
||||
consumer.consume(lookupElement);
|
||||
getVariantsFromContributors(parameters, null, new Consumer<CompletionResult>() {
|
||||
public void consume(final CompletionResult result) {
|
||||
if (lookupSet.add(result.getLookupElement())) {
|
||||
consumer.consume(result);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
+4
-10
@@ -19,7 +19,6 @@ package com.intellij.codeInsight.completion;
|
||||
import com.intellij.codeInsight.CodeInsightActionHandler;
|
||||
import com.intellij.codeInsight.CodeInsightSettings;
|
||||
import com.intellij.codeInsight.completion.impl.CompletionServiceImpl;
|
||||
import com.intellij.codeInsight.completion.impl.MatchedLookupElement;
|
||||
import com.intellij.codeInsight.editorActions.CompletionAutoPopupHandler;
|
||||
import com.intellij.codeInsight.lookup.*;
|
||||
import com.intellij.codeInsight.lookup.impl.LookupImpl;
|
||||
@@ -287,16 +286,11 @@ public class CodeCompletionHandlerBase implements CodeInsightActionHandler {
|
||||
indicator.duringCompletion(initContext);
|
||||
ProgressManager.checkCanceled();
|
||||
|
||||
final List<LookupElement> items = new ArrayList<LookupElement>();
|
||||
Consumer<LookupElement> consumer = new Consumer<LookupElement>() {
|
||||
public void consume(final LookupElement lookupElement) {
|
||||
MatchedLookupElement matched = (MatchedLookupElement)lookupElement;
|
||||
indicator.addItem(matched);
|
||||
items.add(matched.getDelegate());
|
||||
data.set(CompletionService.getCompletionService().performCompletion(parameters, new Consumer<CompletionResult>() {
|
||||
public void consume(final CompletionResult result) {
|
||||
indicator.addItem(result);
|
||||
}
|
||||
};
|
||||
CompletionService.getCompletionService().performCompletion(parameters, consumer);
|
||||
data.set(items.toArray(new LookupElement[items.size()]));
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+3
-4
@@ -19,7 +19,6 @@ package com.intellij.codeInsight.completion;
|
||||
import com.intellij.codeInsight.CodeInsightSettings;
|
||||
import com.intellij.codeInsight.completion.impl.CompletionServiceImpl;
|
||||
import com.intellij.codeInsight.completion.impl.CompletionSorterImpl;
|
||||
import com.intellij.codeInsight.completion.impl.MatchedLookupElement;
|
||||
import com.intellij.codeInsight.editorActions.CompletionAutoPopupHandler;
|
||||
import com.intellij.codeInsight.hint.EditorHintListener;
|
||||
import com.intellij.codeInsight.hint.HintManager;
|
||||
@@ -359,7 +358,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
return myOffsetMap.getOffset(CompletionInitializationContext.IDENTIFIER_END_OFFSET);
|
||||
}
|
||||
|
||||
public synchronized void addItem(final MatchedLookupElement item) {
|
||||
public synchronized void addItem(final CompletionResult item) {
|
||||
if (!isRunning()) return;
|
||||
ProgressManager.checkCanceled();
|
||||
|
||||
@@ -370,8 +369,8 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
|
||||
LOG.assertTrue(myParameters.getPosition().isValid());
|
||||
|
||||
myItemSorters.put(item.getDelegate(), (CompletionSorterImpl) item.getSorter());
|
||||
myLookup.addItem(item.getDelegate(), item.getPrefixMatcher());
|
||||
myItemSorters.put(item.getLookupElement(), (CompletionSorterImpl) item.getSorter());
|
||||
myLookup.addItem(item.getLookupElement(), item.getPrefixMatcher());
|
||||
myCount++;
|
||||
if (unitTestMode) return;
|
||||
|
||||
|
||||
+13
-14
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package com.intellij.codeInsight.completion;
|
||||
|
||||
import com.intellij.codeInsight.completion.impl.MatchedLookupElement;
|
||||
import com.intellij.codeInsight.lookup.LookupElement;
|
||||
import com.intellij.codeInsight.template.impl.LiveTemplateLookupElement;
|
||||
import com.intellij.patterns.PatternCondition;
|
||||
import com.intellij.patterns.StandardPatterns;
|
||||
@@ -34,18 +32,18 @@ public class RelaxedMatchingContributor extends CompletionContributor {
|
||||
|
||||
@Override
|
||||
public void fillCompletionVariants(CompletionParameters parameters, final CompletionResultSet result) {
|
||||
final Set<MatchedLookupElement> elements = new HashSet<MatchedLookupElement>();
|
||||
result.runRemainingContributors(parameters, new Consumer<LookupElement>() {
|
||||
final Set<CompletionResult> elements = new HashSet<CompletionResult>();
|
||||
result.runRemainingContributors(parameters, new Consumer<CompletionResult>() {
|
||||
@Override
|
||||
public void consume(LookupElement element) {
|
||||
elements.add((MatchedLookupElement)element);
|
||||
result.addElement(element);
|
||||
public void consume(CompletionResult element) {
|
||||
elements.add(element);
|
||||
result.passResult(element);
|
||||
}
|
||||
});
|
||||
|
||||
if (!elements.isEmpty() && parameters.getInvocationCount() == 0) {
|
||||
Set<String> prefixes = new HashSet<String>();
|
||||
for (MatchedLookupElement element : elements) {
|
||||
for (CompletionResult element : elements) {
|
||||
prefixes.add(element.getPrefixMatcher().getPrefix());
|
||||
}
|
||||
for (String prefix : prefixes) {
|
||||
@@ -53,8 +51,8 @@ public class RelaxedMatchingContributor extends CompletionContributor {
|
||||
.restartCompletionOnPrefixChange(StandardPatterns.string().with(new PatternCondition<String>("noneMatch") {
|
||||
@Override
|
||||
public boolean accepts(@NotNull String s, ProcessingContext context) {
|
||||
for (MatchedLookupElement element : elements) {
|
||||
if (element.getPrefixMatcher().cloneWithPrefix(s).prefixMatches(element)) {
|
||||
for (CompletionResult element : elements) {
|
||||
if (element.getPrefixMatcher().cloneWithPrefix(s).prefixMatches(element.getLookupElement())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -65,7 +63,8 @@ public class RelaxedMatchingContributor extends CompletionContributor {
|
||||
}
|
||||
|
||||
CompletionParameters relaxed;
|
||||
if (parameters.getInvocationCount() == 0 && (elements.isEmpty() || elements.size() == 1 && elements.iterator().next().as(LiveTemplateLookupElement.class) != null)) {
|
||||
if (parameters.getInvocationCount() == 0 && (elements.isEmpty() || elements.size() == 1 && elements.iterator().next().getLookupElement().as(
|
||||
LiveTemplateLookupElement.class) != null)) {
|
||||
relaxed = parameters.withRelaxedMatching();
|
||||
}
|
||||
else if (parameters.getInvocationCount() >= 2) {
|
||||
@@ -75,10 +74,10 @@ public class RelaxedMatchingContributor extends CompletionContributor {
|
||||
return;
|
||||
}
|
||||
|
||||
result.runRemainingContributors(relaxed, new Consumer<LookupElement>() {
|
||||
result.runRemainingContributors(relaxed, new Consumer<CompletionResult>() {
|
||||
@Override
|
||||
public void consume(LookupElement element) {
|
||||
result.addElement(element);
|
||||
public void consume(CompletionResult element) {
|
||||
result.passResult(element);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+4
-15
@@ -79,7 +79,7 @@ public class CompletionServiceImpl extends CompletionService{
|
||||
}
|
||||
}
|
||||
|
||||
public CompletionResultSet createResultSet(final CompletionParameters parameters, final Consumer<LookupElement> consumer,
|
||||
public CompletionResultSet createResultSet(final CompletionParameters parameters, final Consumer<CompletionResult> consumer,
|
||||
@NotNull final CompletionContributor contributor) {
|
||||
final PsiElement position = parameters.getPosition();
|
||||
final String prefix = CompletionData.findPrefixStatic(position, parameters.getOffset());
|
||||
@@ -119,7 +119,7 @@ public class CompletionServiceImpl extends CompletionService{
|
||||
private final CompletionProgressIndicator myProcess;
|
||||
@Nullable private final CompletionResultSetImpl myOriginal;
|
||||
|
||||
public CompletionResultSetImpl(final Consumer<LookupElement> consumer, final String textBeforePosition,
|
||||
public CompletionResultSetImpl(final Consumer<CompletionResult> consumer, final String textBeforePosition,
|
||||
final PrefixMatcher prefixMatcher,
|
||||
CompletionContributor contributor,
|
||||
CompletionParameters parameters,
|
||||
@@ -135,20 +135,9 @@ public class CompletionServiceImpl extends CompletionService{
|
||||
}
|
||||
|
||||
public void addElement(@NotNull final LookupElement element) {
|
||||
if (element instanceof MatchedLookupElement) {
|
||||
getConsumer().consume(element);
|
||||
return;
|
||||
}
|
||||
|
||||
MatchedLookupElement matched = element.as(MatchedLookupElement.CLASS_CONDITION_KEY);
|
||||
CompletionResult matched = CompletionResult.wrap(element, getPrefixMatcher(), mySorter);
|
||||
if (matched != null) {
|
||||
getConsumer().consume(new MatchedLookupElement(element, matched.getPrefixMatcher(), matched.getSorter()));
|
||||
return;
|
||||
}
|
||||
|
||||
PrefixMatcher matcher = getPrefixMatcher();
|
||||
if (matcher.prefixMatches(element)) {
|
||||
getConsumer().consume(new MatchedLookupElement(element, matcher, mySorter));
|
||||
passResult(matched);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-46
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.codeInsight.completion.impl;
|
||||
|
||||
import com.intellij.codeInsight.completion.CompletionSorter;
|
||||
import com.intellij.codeInsight.completion.PrefixMatcher;
|
||||
import com.intellij.codeInsight.lookup.LookupElement;
|
||||
import com.intellij.codeInsight.lookup.LookupElementDecorator;
|
||||
import com.intellij.openapi.util.ClassConditionKey;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public class MatchedLookupElement extends LookupElementDecorator<LookupElement> {
|
||||
public static final ClassConditionKey<MatchedLookupElement> CLASS_CONDITION_KEY = ClassConditionKey.create(MatchedLookupElement.class);
|
||||
private final PrefixMatcher myMatcher;
|
||||
private final CompletionSorter mySorter;
|
||||
|
||||
MatchedLookupElement(LookupElement delegate, PrefixMatcher matcher, CompletionSorter sorter) {
|
||||
super(delegate);
|
||||
myMatcher = matcher;
|
||||
mySorter = sorter;
|
||||
}
|
||||
|
||||
public PrefixMatcher getPrefixMatcher() {
|
||||
return myMatcher;
|
||||
}
|
||||
|
||||
public CompletionSorter getSorter() {
|
||||
return mySorter;
|
||||
}
|
||||
|
||||
}
|
||||
+4
-4
@@ -300,10 +300,10 @@ public class GroovyCompletionContributor extends CompletionContributor {
|
||||
ProcessingContext context,
|
||||
@NotNull final CompletionResultSet result) {
|
||||
final Set<String> usedWords = new THashSet<String>();
|
||||
result.runRemainingContributors(parameters, new Consumer<LookupElement>() {
|
||||
public void consume(LookupElement element) {
|
||||
result.addElement(element);
|
||||
usedWords.add(element.getLookupString());
|
||||
result.runRemainingContributors(parameters, new Consumer<CompletionResult>() {
|
||||
public void consume(CompletionResult element) {
|
||||
result.passResult(element);
|
||||
usedWords.add(element.getLookupElement().getLookupString());
|
||||
}
|
||||
});
|
||||
PsiReference reference = parameters.getPosition().getContainingFile().findReferenceAt(parameters.getOffset());
|
||||
|
||||
@@ -96,13 +96,13 @@ public class XmlCompletionContributor extends CompletionContributor {
|
||||
|
||||
final Set<String> usedWords = new THashSet<String>();
|
||||
final Ref<Boolean> addWordVariants = Ref.create(true);
|
||||
result.runRemainingContributors(parameters, new Consumer<LookupElement>() {
|
||||
public void consume(LookupElement element) {
|
||||
if (element.getUserData(WORD_COMPLETION_COMPATIBLE) == null) {
|
||||
result.runRemainingContributors(parameters, new Consumer<CompletionResult>() {
|
||||
public void consume(CompletionResult r) {
|
||||
if (r.getLookupElement().getUserData(WORD_COMPLETION_COMPATIBLE) == null) {
|
||||
addWordVariants.set(false);
|
||||
}
|
||||
usedWords.add(element.getLookupString());
|
||||
result.addElement(LookupElementDecorator.withInsertHandler(element, QUOTE_EATER));
|
||||
usedWords.add(r.getLookupElement().getLookupString());
|
||||
result.passResult(r.withLookupElement(LookupElementDecorator.withInsertHandler(r.getLookupElement(), QUOTE_EATER)));
|
||||
}
|
||||
});
|
||||
if (addWordVariants.get().booleanValue()) {
|
||||
|
||||
Reference in New Issue
Block a user