ksprojects / protobuf-jetbrains-plugin

Protobuf Support for JetBrains IDEs
https://plugins.jetbrains.com/plugin/8277
Apache License 2.0
259 stars 45 forks source link

Do not use classes from .impl package #124

Closed kshchepanovskyi closed 5 years ago

kshchepanovskyi commented 5 years ago

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;
kshchepanovskyi commented 5 years ago
ProtoFoldingBuilder.java
import com.intellij.psi.impl.source.tree.FileElement;

Replaced with

import com.intellij.lang.FileASTNode;
kshchepanovskyi commented 5 years ago
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);
kshchepanovskyi commented 5 years ago
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

kshchepanovskyi commented 5 years ago

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;