mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup & javadocs (following IDEA-CR-9329)
This commit is contained in:
@@ -632,10 +632,7 @@ public class JavaDocumentationProvider extends DocumentationProviderEx implement
|
||||
if (aClass != null) {
|
||||
ClassInfo info = findUrlForClass(aClass);
|
||||
if (info != null) {
|
||||
urls = info.externalDocUrls;
|
||||
for (int i = 0; i < urls.size(); i++) {
|
||||
urls.set(i, urls.get(i) + "#" + field.getName());
|
||||
}
|
||||
urls = ContainerUtil.map(info.externalDocUrls, (url) -> url + "#" + field.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -672,10 +669,7 @@ public class JavaDocumentationProvider extends DocumentationProviderEx implement
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < urls.size(); i++) {
|
||||
urls.set(i, FileUtil.toSystemIndependentName(urls.get(i)));
|
||||
}
|
||||
return urls;
|
||||
return ContainerUtil.map(urls, FileUtil::toSystemIndependentName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -938,7 +932,9 @@ public class JavaDocumentationProvider extends DocumentationProviderEx implement
|
||||
|
||||
private static class ClassInfo {
|
||||
private final boolean isInJdk;
|
||||
/** These should be used to fetch documentation in IDEA code */
|
||||
private final @NotNull List<String> internalDocUrls;
|
||||
/** These are for viewing documentation in browser (jar:// urls here are replaced with http:// urls provided by built-in web server) */
|
||||
private final @NotNull List<String> externalDocUrls;
|
||||
|
||||
private ClassInfo(boolean jdk, @NotNull List<String> docUrls) {
|
||||
|
||||
+3
-5
@@ -16,6 +16,7 @@
|
||||
package com.intellij.codeInsight.documentation;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import com.intellij.openapi.vfs.ex.http.HttpFileSystem;
|
||||
@@ -55,11 +56,8 @@ public class PlatformDocumentationUtil {
|
||||
@Nullable
|
||||
public static String getDocUrl(@NotNull VirtualFile root, String relPath) {
|
||||
if (root.getFileSystem() instanceof HttpFileSystem) {
|
||||
String url = root.getUrl();
|
||||
if (url.toLowerCase(Locale.getDefault()).endsWith("/index.html")) {
|
||||
url = url.substring(0, url.length() - 10);
|
||||
}
|
||||
else if (!url.endsWith("/")) {
|
||||
String url = StringUtil.trimEnd(root.getUrl(), "/index.html", true);
|
||||
if (!url.endsWith("/")) {
|
||||
url += "/";
|
||||
}
|
||||
return url + relPath;
|
||||
|
||||
Reference in New Issue
Block a user