ksprojects/protobuf-jetbrains-plugin

Do not use classes from .impl package

kshchepanovskyi opened this issue · 4 comments

Apply suggestion from https://youtrack.jetbrains.com/issue/IDEA-202322

Get rid of following API usages:

ProtoFoldingBuilder.java
import com.intellij.psi.impl.source.tree.FileElement;

ProtostuffPluginController.java
import com.intellij.openapi.roots.impl.libraries.ApplicationLibraryTable;
io.protostuff.jetbrains.plugin.psi

GenericNameNode.java
import com.intellij.psi.impl.PsiFileFactoryImpl;
io.protostuff.jetbrains.plugin.psi.manipulator

FieldReferenceNodeManipulator.java
import com.intellij.psi.impl.PsiFileFactoryImpl;

FileReferenceNodeManipulator.java
import com.intellij.psi.impl.PsiFileFactoryImpl;

TypeReferenceNodeManipulator.java
import com.intellij.psi.impl.PsiFileFactoryImpl;
io.protostuff.jetbrains.plugin.reference.file

FilePathReferenceProvider.java
import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReference;
import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReferenceSet;
ProtoFoldingBuilder.java
import com.intellij.psi.impl.source.tree.FileElement;

Replaced with

import com.intellij.lang.FileASTNode;
ProtostuffPluginController.java
import com.intellij.openapi.roots.impl.libraries.ApplicationLibraryTable;

Replaced with

import com.intellij.openapi.roots.libraries.LibraryTablesRegistrar;
...
LibraryTable libraryTable = LibraryTablesRegistrar.getInstance().getLibraryTable(project);
GenericNameNode.java
import com.intellij.psi.impl.PsiFileFactoryImpl;
io.protostuff.jetbrains.plugin.psi.manipulator

FieldReferenceNodeManipulator.java
import com.intellij.psi.impl.PsiFileFactoryImpl;

FileReferenceNodeManipulator.java
import com.intellij.psi.impl.PsiFileFactoryImpl;

TypeReferenceNodeManipulator.java
import com.intellij.psi.impl.PsiFileFactoryImpl;
io.protostuff.jetbrains.plugin.reference.file

Should be replaced as described in https://www.jetbrains.org/intellij/sdk/docs/basics/architectural_overview/modifying_psi.html

Remaining usages in io.protostuff.jetbrains.plugin.reference.file.FilePathReferenceProvider:

import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReference;
import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReferenceSet;