[ml-ranking] Introduce MLRankingIgnorable.wrap(LookupElement) API

GitOrigin-RevId: 31973b971594375acefcd76d6a5534bc9a6d4286
This commit is contained in:
Vitaliy.Bibaev
2022-08-24 15:43:32 +00:00
committed by intellij-monorepo-bot
parent d3e13b3a6a
commit cf2cc5cbf8
@@ -1,12 +1,25 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.codeInsight.completion.ml;
import com.intellij.codeInsight.lookup.LookupElement;
import com.intellij.codeInsight.lookup.LookupElementDecorator;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
/**
* A marker interface for the {@link com.intellij.codeInsight.lookup.LookupElement} inheritors to ignore this element
* A marker interface for the {@link LookupElement} inheritors to ignore this element
* in sorting by Machine Learning-assisted completion.
*/
@ApiStatus.Experimental
public interface MLRankingIgnorable {
static LookupElement wrap(LookupElement element) {
class MLIgnorableLookupElement extends LookupElementDecorator<LookupElement> implements MLRankingIgnorable {
private MLIgnorableLookupElement(@NotNull LookupElement delegate) {
super(delegate);
}
}
return new MLIgnorableLookupElement(element);
}
}