mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
cleanup
GitOrigin-RevId: 6d5b643d0efe15ef76c190e0772baba0683a3091
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1c6dcfd919
commit
e53b52f198
@@ -36,11 +36,11 @@ public class HyperlinksToClassesOption extends PrintOption {
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public TreeMap<Integer, PsiReference> collectReferences(PsiFile psiFile, Map<PsiFile, PsiFile> filesMap) {
|
||||
public Map<Integer, PsiReference> collectReferences(@NotNull PsiFile psiFile, @NotNull Map<PsiFile, PsiFile> filesMap) {
|
||||
if (isGenerateHyperlinksToClasses) {
|
||||
FileType fileType = psiFile.getFileType();
|
||||
if (JavaFileType.INSTANCE == fileType || StdFileTypes.JSP == fileType) {
|
||||
final TreeMap<Integer, PsiReference> refMap = new TreeMap<>();
|
||||
Map<Integer, PsiReference> refMap = new TreeMap<>();
|
||||
findClassReferences(psiFile, refMap, filesMap, psiFile);
|
||||
return refMap;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class HyperlinksToClassesOption extends PrintOption {
|
||||
}
|
||||
|
||||
|
||||
private static void findClassReferences(PsiElement psiElement, TreeMap<Integer, PsiReference> refMap, Map<PsiFile, PsiFile> filesMap, PsiFile psiFile) {
|
||||
private static void findClassReferences(@NotNull PsiElement psiElement, @NotNull Map<? super Integer, ? super PsiReference> refMap, @NotNull Map<PsiFile, PsiFile> filesMap, @NotNull PsiFile psiFile) {
|
||||
PsiReference ref = psiElement.getReference();
|
||||
if(ref instanceof PsiJavaCodeReferenceElement) {
|
||||
PsiElement refElement = ref.resolve();
|
||||
|
||||
@@ -17,8 +17,8 @@ import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.file.PsiDirectoryFactory;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectRBTreeMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectSortedMap;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -161,7 +161,7 @@ final class ExportToHTMLManager {
|
||||
|
||||
private static @NotNull Path doPaint(@NotNull Path outDir,
|
||||
@NotNull HTMLTextPainter textPainter,
|
||||
@Nullable Int2ObjectSortedMap<PsiReference> refMap) throws IOException {
|
||||
@Nullable Int2ObjectMap<? extends PsiReference> refMap) throws IOException {
|
||||
Path htmlFile = outDir.resolve(getHTMLFileName(textPainter.getPsiFile()));
|
||||
try (BufferedWriter writer = Files.newBufferedWriter(htmlFile)) {
|
||||
textPainter.paint(refMap, writer, true);
|
||||
@@ -182,9 +182,9 @@ final class ExportToHTMLManager {
|
||||
return;
|
||||
}
|
||||
|
||||
Int2ObjectRBTreeMap<PsiReference> refMap = null;
|
||||
Int2ObjectMap<PsiReference> refMap = null;
|
||||
for (PrintOption printOption : PrintOption.EP_NAME.getExtensionList()) {
|
||||
TreeMap<Integer, PsiReference> map = printOption.collectReferences(psiFile, filesMap);
|
||||
Map<Integer, PsiReference> map = printOption.collectReferences(psiFile, filesMap);
|
||||
if (map != null) {
|
||||
refMap = new Int2ObjectRBTreeMap<>(map);
|
||||
}
|
||||
@@ -255,15 +255,18 @@ final class ExportToHTMLManager {
|
||||
}
|
||||
|
||||
private final class ExportRunnable implements Runnable {
|
||||
@NotNull
|
||||
private final ExportToHTMLSettings myExportToHTMLSettings;
|
||||
private final PsiDirectory myPsiDirectory;
|
||||
@NotNull
|
||||
private final Path outDir;
|
||||
@NotNull
|
||||
private final Project myProject;
|
||||
|
||||
ExportRunnable(ExportToHTMLSettings exportToHTMLSettings,
|
||||
PsiDirectory psiDirectory,
|
||||
@NotNull Path outputDirectoryName,
|
||||
Project project) {
|
||||
ExportRunnable(@NotNull ExportToHTMLSettings exportToHTMLSettings,
|
||||
PsiDirectory psiDirectory,
|
||||
@NotNull Path outputDirectoryName,
|
||||
@NotNull Project project) {
|
||||
myExportToHTMLSettings = exportToHTMLSettings;
|
||||
myPsiDirectory = psiDirectory;
|
||||
outDir = outputDirectoryName;
|
||||
@@ -320,7 +323,7 @@ final class ExportToHTMLManager {
|
||||
}
|
||||
}
|
||||
|
||||
static String getHTMLFileName(@NotNull PsiFileSystemItem psiFile) {
|
||||
static @NotNull String getHTMLFileName(@NotNull PsiFileSystemItem psiFile) {
|
||||
return psiFile.getVirtualFile().getNameSequence() + ".html";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.intellij.psi.impl.file.PsiDirectoryFactory;
|
||||
import com.intellij.ui.ColorUtil;
|
||||
import com.intellij.ui.Gray;
|
||||
import com.intellij.ui.JBColor;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectSortedMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.IntIterator;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -111,7 +111,7 @@ public final class HTMLTextPainter {
|
||||
myFirstLineNumber = firstLineNumber;
|
||||
}
|
||||
|
||||
public void paint(@Nullable Int2ObjectSortedMap<PsiReference> refMap, @NotNull Writer writer, boolean isStandalone) throws IOException {
|
||||
public void paint(@Nullable Int2ObjectMap<? extends PsiReference> refMap, @NotNull Writer writer, boolean isStandalone) throws IOException {
|
||||
HighlighterIterator hIterator = myHighlighter.createIterator(myOffset);
|
||||
if (hIterator.atEnd()) {
|
||||
return;
|
||||
@@ -382,17 +382,13 @@ public final class HTMLTextPainter {
|
||||
if (!Comparing.equal(attributes1.getBackgroundColor(), attributes2.getBackgroundColor())) {
|
||||
return false;
|
||||
}
|
||||
if (!Comparing.equal(attributes1.getEffectColor(), attributes2.getEffectColor())) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return Comparing.equal(attributes1.getEffectColor(), attributes2.getEffectColor());
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the code fragment to HTML with in-line styles.
|
||||
* The information about language, project and markup settings is getting
|
||||
* from {@code context} parameter.
|
||||
*
|
||||
* The code tokens in HTML are highlighted by lexer-based highlighter.
|
||||
* There is no formatting activity in this call.
|
||||
*
|
||||
|
||||
@@ -24,13 +24,12 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
public abstract class PrintOption {
|
||||
public static final ExtensionPointName<PrintOption> EP_NAME = ExtensionPointName.create("com.intellij.printOption");
|
||||
|
||||
@Nullable
|
||||
public abstract TreeMap<Integer, PsiReference> collectReferences(PsiFile psiFile, Map<PsiFile, PsiFile> filesMap);
|
||||
public abstract Map<Integer, PsiReference> collectReferences(@NotNull PsiFile psiFile, @NotNull Map<PsiFile, PsiFile> filesMap);
|
||||
|
||||
@NotNull
|
||||
public abstract UnnamedConfigurable createConfigurable();
|
||||
|
||||
Reference in New Issue
Block a user