Skip to content

Commit

Permalink
[platform] API cleanup: remove unused API which was deprecated for a …
Browse files Browse the repository at this point in the history
…long time (IDEA-259329)

GitOrigin-RevId: c4796f8b7c413797ff71c9036186030aba58f00f
  • Loading branch information
chashnikov authored and intellij-monorepo-bot committed Jan 15, 2021
1 parent 6f88ba3 commit cc31a97
Show file tree
Hide file tree
Showing 168 changed files with 26 additions and 2,656 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,6 @@ private LookupElementBuilder(@NotNull String lookupString, @NotNull Object objec
myPsiElement, myAllLookupStrings, myCaseSensitive);
}

/**
* @deprecated use {@link #withRenderer(LookupElementRenderer)}
*/
@Deprecated
@Contract(pure=true)
public @NotNull LookupElementBuilder setRenderer(@Nullable LookupElementRenderer<LookupElement> renderer) {
return withRenderer(renderer);
}
@Contract(pure=true)
public @NotNull LookupElementBuilder withRenderer(@Nullable LookupElementRenderer<LookupElement> renderer) {
return cloneWithUserData(myLookupString, myObject, myInsertHandler, renderer, myExpensiveRenderer, myHardcodedPresentation,
Expand Down Expand Up @@ -174,14 +166,6 @@ private LookupElementPresentation copyPresentation() {
return presentation;
}

/**
* @deprecated use {@link #withLookupString(String)}
*/
@Deprecated
@Contract(pure=true)
public @NotNull LookupElementBuilder addLookupString(@NotNull String another) {
return withLookupString(another);
}
@Contract(pure=true)
public @NotNull LookupElementBuilder withLookupString(@NotNull String another) {
final Set<String> set = new HashSet<>(myAllLookupStrings);
Expand All @@ -203,14 +187,6 @@ public boolean isCaseSensitive() {
return myCaseSensitive;
}

/**
* @deprecated use {@link #withCaseSensitivity(boolean)}
*/
@Deprecated
@Contract(pure=true)
public @NotNull LookupElementBuilder setCaseSensitive(boolean caseSensitive) {
return withCaseSensitivity(caseSensitive);
}
/**
* @param caseSensitive if this lookup item should be completed in the same letter case as prefix
* @return modified builder
Expand All @@ -232,14 +208,6 @@ public boolean isCaseSensitive() {
myAllLookupStrings, myCaseSensitive);
}

/**
* @deprecated use {@link #withItemTextForeground(Color)}
*/
@Deprecated
@Contract(pure=true)
public @NotNull LookupElementBuilder setItemTextForeground(@NotNull Color itemTextForeground) {
return withItemTextForeground(itemTextForeground);
}
@Contract(pure=true)
public @NotNull LookupElementBuilder withItemTextForeground(@NotNull Color itemTextForeground) {
final LookupElementPresentation presentation = copyPresentation();
Expand All @@ -248,14 +216,6 @@ public boolean isCaseSensitive() {
myPsiElement, myAllLookupStrings, myCaseSensitive);
}

/**
* @deprecated use {@link #withItemTextUnderlined(boolean)}
*/
@Deprecated
@Contract(pure=true)
public @NotNull LookupElementBuilder setItemTextUnderlined(boolean underlined) {
return withItemTextUnderlined(underlined);
}
@Contract(pure=true)
public @NotNull LookupElementBuilder withItemTextUnderlined(boolean underlined) {
final LookupElementPresentation presentation = copyPresentation();
Expand Down Expand Up @@ -285,15 +245,6 @@ public boolean isCaseSensitive() {
return withTypeText(typeText, false);
}

/**
* @deprecated use {@link #withTypeText(String, boolean)}
*/
@Deprecated
@Contract(pure=true)
public @NotNull LookupElementBuilder setTypeText(@Nullable String typeText, boolean grayed) {
return withTypeText(typeText, grayed);
}

@Contract(pure=true)
public @NotNull LookupElementBuilder withTypeText(@Nullable String typeText, boolean grayed) {
return withTypeText(typeText, null, grayed);
Expand Down Expand Up @@ -331,27 +282,11 @@ public boolean isCaseSensitive() {
myAllLookupStrings, myCaseSensitive);
}

/**
* @deprecated use {@link #bold()}
*/
@Deprecated
@Contract(pure=true)
public @NotNull LookupElementBuilder setBold() {
return bold();
}
@Contract(pure=true)
public @NotNull LookupElementBuilder bold() {
return withBoldness(true);
}

/**
* @deprecated use {@link #withBoldness(boolean)}
*/
@Deprecated
@Contract(pure=true)
public @NotNull LookupElementBuilder setBold(boolean bold) {
return withBoldness(bold);
}
@Contract(pure=true)
public @NotNull LookupElementBuilder withBoldness(boolean bold) {
final LookupElementPresentation presentation = copyPresentation();
Expand All @@ -360,27 +295,11 @@ public boolean isCaseSensitive() {
myAllLookupStrings, myCaseSensitive);
}

/**
* @deprecated use {@link #strikeout()}
*/
@Deprecated
@Contract(pure=true)
public @NotNull LookupElementBuilder setStrikeout() {
return strikeout();
}
@Contract(pure=true)
public @NotNull LookupElementBuilder strikeout() {
return withStrikeoutness(true);
}

/**
* @deprecated use {@link #withStrikeoutness(boolean)}
*/
@Deprecated
@Contract(pure=true)
public @NotNull LookupElementBuilder setStrikeout(boolean strikeout) {
return withStrikeoutness(strikeout);
}
@Contract(pure=true)
public @NotNull LookupElementBuilder withStrikeoutness(boolean strikeout) {
final LookupElementPresentation presentation = copyPresentation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ public static void appendAfterHeaderIndention(@NotNull StringBuilder buf) {
buf.append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
}

/**
* @deprecated Use CSS for indentations
*/
@Deprecated
public static void appendAfterHeaderIndention(@NonNls StringBuffer buf) {
buf.append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
}

public abstract void appendNoProblems(@NotNull StringBuilder buf);

public abstract <T> T getExtension(Key<T> key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,8 @@ public PsiNamedElement getProblemElement(@NotNull PsiElement psiElement) {
public void inspectionStarted(@NotNull LocalInspectionToolSession session, boolean isOnTheFly) {}

public void inspectionFinished(@NotNull LocalInspectionToolSession session, @NotNull ProblemsHolder problemsHolder) {
inspectionFinished(session);
}

/**
* @deprecated Use {@link #inspectionFinished(LocalInspectionToolSession, ProblemsHolder)} instead
*/
@Deprecated
public void inspectionFinished(@NotNull LocalInspectionToolSession session) {}

@NotNull
public List<ProblemDescriptor> processFile(@NotNull PsiFile file, @NotNull InspectionManager manager) {
final ProblemsHolder holder = new ProblemsHolder(manager, file, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,6 @@ public boolean hasOpenFiles() {
public void addFileEditorManagerListener(@NotNull FileEditorManagerListener listener) {
}

/**
* @deprecated Use {@link FileEditorManagerListener#FILE_EDITOR_MANAGER} instead
*/
@Deprecated
public void addFileEditorManagerListener(@NotNull FileEditorManagerListener listener, @NotNull Disposable parentDisposable) {
}

/**
* Removes specified {@code listener}
*
Expand Down
4 changes: 0 additions & 4 deletions platform/analysis-impl/resources/META-INF/AnalysisImpl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
<extensionPoints>
<extensionPoint name="severitiesProvider"
interface="com.intellij.codeInsight.daemon.impl.SeveritiesProvider"/>
<extensionPoint name="completionData"
beanClass="com.intellij.codeInsight.completion.CompletionDataEP">
<with attribute="className" implements="com.intellij.codeInsight.completion.CompletionData"/>
</extensionPoint>

<extensionPoint name="useScopeEnlarger" interface="com.intellij.psi.search.UseScopeEnlarger" dynamic="true"/>
<extensionPoint name="useScopeOptimizer" interface="com.intellij.psi.search.ScopeOptimizer" dynamic="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,6 @@ public void setSelectAutopopupSuggestionsByChars(boolean value) {
public boolean AUTOCOMPLETE_ON_CODE_COMPLETION = true;
public boolean AUTOCOMPLETE_ON_SMART_TYPE_COMPLETION = true;

/**
* @deprecated unused
*/
@Deprecated
public boolean AUTOCOMPLETE_COMMON_PREFIX = true;

public boolean SHOW_FULL_SIGNATURES_IN_PARAMETER_INFO;

@OptionTag("SMART_BACKSPACE") // explicit name makes it work also for obfuscated private field's name
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@
import com.intellij.codeInsight.lookup.LookupValueWithPsiElement;
import com.intellij.diagnostic.ThreadDumper;
import com.intellij.featureStatistics.FeatureUsageTracker;
import com.intellij.lang.Language;
import com.intellij.openapi.diagnostic.Attachment;
import com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.project.IndexNotReadyException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.TextRange;
Expand All @@ -34,7 +31,6 @@
import java.util.List;

public final class CompletionUtil {
private static final ExtensionPointName<CompletionDataEP> EP_NAME = new ExtensionPointName<>("com.intellij.completionData");

private static final CompletionData ourGenericCompletionData = new CompletionData() {
{
Expand All @@ -49,29 +45,7 @@ public final class CompletionUtil {
@Nullable
public static CompletionData getCompletionDataByElement(@Nullable final PsiElement position, @NotNull PsiFile originalFile) {
if (position == null) return null;

PsiElement parent = position.getParent();
Language language = parent == null ? position.getLanguage() : parent.getLanguage();
final FileType fileType = language.getAssociatedFileType();
if (fileType != null) {
final CompletionData mainData = getCompletionDataByFileType(fileType);
if (mainData != null) {
return mainData;
}
}

final CompletionData mainData = getCompletionDataByFileType(originalFile.getFileType());
return mainData != null ? mainData : ourGenericCompletionData;
}

@Nullable
private static CompletionData getCompletionDataByFileType(FileType fileType) {
for (CompletionDataEP ep: EP_NAME.getExtensionList()) {
if (ep.fileType.equals(fileType.getName())) {
return ep.getHandler();
}
}
return null;
return ourGenericCompletionData;
}

public static boolean shouldShowFeature(CompletionParameters parameters, @NonNls final String id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,31 +59,6 @@ public interface HighlightInfoType {

HighlightSeverity SYMBOL_TYPE_SEVERITY = new HighlightSeverity("SYMBOL_TYPE_SEVERITY", HighlightSeverity.INFORMATION.myVal-2);

/**
* @deprecated For Java use JavaHighlightInfoTypes.LOCAL_VARIABLE or create a language-specific HighlightInfoType.
* The field will be removed in version 17.
*/
@Deprecated
HighlightInfoType LOCAL_VARIABLE = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.LOCAL_VARIABLE_ATTRIBUTES);
/**
* @deprecated For Java use JavaHighlightInfoTypes.METHOD_CALL or create a language-specific HighlightInfoType.
* The field will be removed in version 17.
*/
@Deprecated
HighlightInfoType METHOD_CALL = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.METHOD_CALL_ATTRIBUTES);
/**
* @deprecated For Java use JavaHighlightInfoTypes.STATIC_METHOD or create a language-specific HighlightInfoType.
* The field will be removed in version 17.
*/
@Deprecated
HighlightInfoType STATIC_METHOD = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.STATIC_METHOD_ATTRIBUTES);
/**
* @deprecated For Java use JavaHighlightInfoTypes.CLASS_NAME or create a language-specific HighlightInfoType.
* The field will be removed in version 17.
*/
@Deprecated
HighlightInfoType CLASS_NAME = new HighlightInfoTypeImpl(SYMBOL_TYPE_SEVERITY, CodeInsightColors.CLASS_NAME_ATTRIBUTES);

HighlightInfoType TODO = new HighlightInfoTypeImpl(HighlightSeverity.INFORMATION, CodeInsightColors.TODO_DEFAULT_ATTRIBUTES); // these are default attributes, can be configured differently for specific patterns
HighlightInfoType UNHANDLED_EXCEPTION = new HighlightInfoTypeImpl(HighlightSeverity.ERROR, CodeInsightColors.ERRORS_ATTRIBUTES);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@

public final class FindUsagesHelper {
private static final Logger LOG = Logger.getInstance(FindUsagesHelper.class);
/**
* @deprecated use {@code processUsagesInText(PsiElement, Collection<String>, GlobalSearchScope, boolean, Processor<? super UsageInfo>} instead.
*/
@Deprecated
public static boolean processUsagesInText(@NotNull final PsiElement element,
@NotNull Collection<String> stringToSearch,
@NotNull GlobalSearchScope searchScope,
@NotNull Processor<? super UsageInfo> processor) {
return processUsagesInText(element, stringToSearch, false, searchScope, processor);
}

public static boolean processUsagesInText(@NotNull final PsiElement element,
@NotNull Collection<String> stringToSearch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public String getInitialUsagesPosition() {
return AnalysisBundle.message("backward.dependencies.usage.view.initial.text");
}

@Override
public AnalysisScope getScopeOfInterest() {
return myScopeOfInterest;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,6 @@ public AnalysisScope getScope() {
return myScope;
}

/**
* @deprecated use {@link BackwardDependenciesBuilder#getScopeOfInterest()} instead
*/
@Deprecated
public AnalysisScope getScopeOfInterest() {
return null;
}

@NotNull
public Project getProject() {
return myProject;
Expand Down Expand Up @@ -142,22 +134,6 @@ private List<List<PsiFile>> findPaths(PsiFile from, PsiFile to, Set<? super PsiF
return result;
}

/**
* @deprecated use {@link ForwardDependenciesBuilder#isTransitive()} instead
*/
@Deprecated
public boolean isTransitive() {
return false;
}

/**
* @deprecated use {@link ForwardDependenciesBuilder#getTransitiveBorder()} instead
*/
@Deprecated
public int getTransitiveBorder() {
return 0;
}

@NlsSafe String getRelativeToProjectPath(@NotNull VirtualFile virtualFile) {
return ProjectUtilCore.displayUrlRelativeToProject(virtualFile, virtualFile.getPresentableUrl(), getProject(), true, false);
}
Expand Down
Loading

0 comments on commit cc31a97

Please sign in to comment.