mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
[i18n] annotate documentation-related EP implementations
GitOrigin-RevId: 6c7902de7362d28fe8b96a68b49116396fbcb702
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5ab40ce2d0
commit
cb21247c48
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.intellij.lang.regexp;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
@@ -37,7 +37,7 @@ public final class RegExpDocumentationProvider extends AbstractDocumentationProv
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
if (element instanceof RegExpGroup) {
|
||||
final RegExpGroup group = (RegExpGroup)element;
|
||||
return StringUtil.escapeXmlEntities(group.getUnescapedText());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.intellij.images.fileTypes;
|
||||
|
||||
import com.intellij.lang.documentation.AbstractDocumentationProvider;
|
||||
@@ -10,6 +10,7 @@ import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFileSystemItem;
|
||||
import org.intellij.images.index.ImageInfoIndex;
|
||||
import org.intellij.images.util.ImageInfo;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.net.URI;
|
||||
@@ -22,7 +23,7 @@ public class ImageDocumentationProvider extends AbstractDocumentationProvider {
|
||||
private static final int MAX_IMAGE_SIZE = 300;
|
||||
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
final Ref<String> result = Ref.create();
|
||||
|
||||
if (element instanceof PsiFileSystemItem && !((PsiFileSystemItem)element).isDirectory()) {
|
||||
|
||||
@@ -76,7 +76,7 @@ public class JavaDocumentationProvider implements CodeDocumentationProvider, Ext
|
||||
public static final String PACKAGE_SUMMARY_FILE = "package-summary.html";
|
||||
|
||||
@Override
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
return QuickDocUtil.inferLinkFromFullDocumentation(this, element, originalElement,
|
||||
getQuickNavigationInfoInner(element, originalElement));
|
||||
}
|
||||
@@ -508,7 +508,7 @@ public class JavaDocumentationProvider implements CodeDocumentationProvider, Ext
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
// for new Class(<caret>) or methodCall(<caret>) proceed from method call or new expression
|
||||
// same for new Cl<caret>ass() or method<caret>Call()
|
||||
if (element instanceof PsiExpressionList ||
|
||||
@@ -576,7 +576,7 @@ public class JavaDocumentationProvider implements CodeDocumentationProvider, Ext
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String generateHoverDoc(@NotNull PsiElement element, @Nullable PsiElement originalElement) {
|
||||
public @Nls @Nullable String generateHoverDoc(@NotNull PsiElement element, @Nullable PsiElement originalElement) {
|
||||
if (originalElement != null && PsiTreeUtil.isAncestor(element, originalElement, false)) {
|
||||
return null;
|
||||
}
|
||||
@@ -584,7 +584,7 @@ public class JavaDocumentationProvider implements CodeDocumentationProvider, Ext
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String generateRenderedDoc(@NotNull PsiDocCommentBase comment) {
|
||||
public @Nls @Nullable String generateRenderedDoc(@NotNull PsiDocCommentBase comment) {
|
||||
PsiElement target = comment.getOwner();
|
||||
if (target == null) target = comment;
|
||||
JavaDocInfoGenerator generator = JavaDocInfoGeneratorFactory.create(target.getProject(), target);
|
||||
@@ -890,7 +890,7 @@ public class JavaDocumentationProvider implements CodeDocumentationProvider, Ext
|
||||
}
|
||||
|
||||
@Override
|
||||
public String fetchExternalDocumentation(Project project, PsiElement element, List<String> docUrls, boolean onHover) {
|
||||
public @Nls String fetchExternalDocumentation(Project project, PsiElement element, List<String> docUrls, boolean onHover) {
|
||||
return fetchExternalJavadoc(element, project, docUrls);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.jsonSchema.impl;
|
||||
|
||||
import com.intellij.json.JsonBundle;
|
||||
@@ -17,6 +17,7 @@ import com.intellij.util.ObjectUtils;
|
||||
import com.jetbrains.jsonSchema.extension.JsonLikePsiWalker;
|
||||
import com.jetbrains.jsonSchema.extension.JsonSchemaFileProvider;
|
||||
import com.jetbrains.jsonSchema.ide.JsonSchemaService;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -28,13 +29,13 @@ import java.util.List;
|
||||
public class JsonSchemaDocumentationProvider implements DocumentationProvider {
|
||||
@Nullable
|
||||
@Override
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
return findSchemaAndGenerateDoc(element, originalElement, true, null);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
String forcedPropName = null;
|
||||
if (element instanceof FakeDocElement) {
|
||||
forcedPropName = ((FakeDocElement)element).myAltName;
|
||||
|
||||
@@ -111,7 +111,7 @@ public final class CompositeDocumentationProvider implements DocumentationProvid
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
for (DocumentationProvider provider : getAllProviders()) {
|
||||
String result = provider.getQuickNavigateInfo(element, originalElement);
|
||||
if (result != null) {
|
||||
@@ -135,7 +135,7 @@ public final class CompositeDocumentationProvider implements DocumentationProvid
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
for (DocumentationProvider provider : getAllProviders()) {
|
||||
String result = provider.generateDoc(element, originalElement);
|
||||
if (result != null) {
|
||||
@@ -159,7 +159,7 @@ public final class CompositeDocumentationProvider implements DocumentationProvid
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String generateRenderedDoc(@NotNull PsiDocCommentBase comment) {
|
||||
public @Nls @Nullable String generateRenderedDoc(@NotNull PsiDocCommentBase comment) {
|
||||
for (DocumentationProvider provider : getAllProviders()) {
|
||||
String result = provider.generateRenderedDoc(comment);
|
||||
if (result != null) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.codeInsight.template.impl;
|
||||
|
||||
import com.intellij.lang.documentation.AbstractDocumentationProvider;
|
||||
@@ -10,6 +10,7 @@ import com.intellij.psi.PsiManager;
|
||||
import com.intellij.psi.impl.FakePsiElement;
|
||||
import com.intellij.psi.impl.source.DummyHolder;
|
||||
import com.intellij.psi.impl.source.DummyHolderFactory;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -29,7 +30,7 @@ public class LiveTemplateDocumentationProvider extends AbstractDocumentationProv
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
if (!(element instanceof LiveTemplateElement)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.codeInspection.actions;
|
||||
|
||||
import com.intellij.codeInspection.ex.InspectionToolWrapper;
|
||||
@@ -8,11 +8,12 @@ import com.intellij.lang.documentation.AbstractDocumentationProvider;
|
||||
import com.intellij.lang.documentation.DocumentationMarkup;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class InspectionDescriptionDocumentationProvider extends AbstractDocumentationProvider {
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
if (!(element instanceof InspectionElement)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,30 +1,17 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.paths;
|
||||
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.lang.documentation.AbstractDocumentationProvider;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
|
||||
/**
|
||||
* @author Eugene.Kudelevsky
|
||||
*/
|
||||
public class WebReferenceDocumentationProvider extends AbstractDocumentationProvider {
|
||||
@Override
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
if (element instanceof WebReference.MyFakePsiElement) {
|
||||
return IdeBundle.message("open.url.in.browser.tooltip");
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.structuralsearch.plugin.ui;
|
||||
|
||||
import com.intellij.lang.documentation.AbstractDocumentationProvider;
|
||||
@@ -10,6 +10,7 @@ import com.intellij.psi.PsiManager;
|
||||
import com.intellij.psi.impl.FakePsiElement;
|
||||
import com.intellij.psi.impl.source.DummyHolder;
|
||||
import com.intellij.psi.impl.source.DummyHolderFactory;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -25,7 +26,7 @@ public class StructuralSearchTemplateDocumentationProvider extends AbstractDocum
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
if (!(element instanceof ConfigurationElement)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.lang.ant.doc;
|
||||
|
||||
import com.intellij.lang.ant.AntFilesProvider;
|
||||
@@ -21,6 +21,7 @@ import com.intellij.psi.xml.XmlTag;
|
||||
import com.intellij.util.xml.DomElement;
|
||||
import com.intellij.util.xml.DomTarget;
|
||||
import com.intellij.util.xml.reflect.DomChildrenDescription;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -36,7 +37,7 @@ public class AntDomDocumentationProvider implements DocumentationProvider {
|
||||
private static final Logger LOG = Logger.getInstance(AntDomDocumentationProvider.class);
|
||||
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
final String mainDoc = getMainDocumentation(originalElement);
|
||||
final String additionalDoc = getAdditionalDocumentation(originalElement);
|
||||
if (mainDoc == null && additionalDoc == null) {
|
||||
@@ -172,7 +173,7 @@ public class AntDomDocumentationProvider implements DocumentationProvider {
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) { // todo!
|
||||
public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) { // todo!
|
||||
if (element instanceof PomTargetPsiElement) {
|
||||
final PomTarget pomTarget = ((PomTargetPsiElement)element).getTarget();
|
||||
if (pomTarget instanceof DomTarget) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.idea.devkit.references.extensions;
|
||||
|
||||
import com.intellij.codeInsight.documentation.DocumentationManager;
|
||||
@@ -27,7 +27,7 @@ import org.jetbrains.idea.devkit.util.DescriptorUtil;
|
||||
public class ExtensionPointDocumentationProvider implements DocumentationProvider {
|
||||
|
||||
@Override
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
ExtensionPoint extensionPoint = findExtensionPoint(element);
|
||||
if (extensionPoint == null) return null;
|
||||
|
||||
@@ -56,7 +56,7 @@ public class ExtensionPointDocumentationProvider implements DocumentationProvide
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
ExtensionPoint extensionPoint = findExtensionPoint(element);
|
||||
if (extensionPoint == null) return null;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.idea.devkit.themes;
|
||||
|
||||
import com.intellij.codeInsight.javadoc.JavaDocInfoGenerator;
|
||||
@@ -25,7 +25,7 @@ public class ThemeJsonDocumentationProvider extends AbstractDocumentationProvide
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
final Pair<UIThemeMetadata, UIThemeMetadata.UIKeyMetadata> resolve = resolve(element);
|
||||
if (resolve == null) return null;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ThemeJsonDocumentationProvider extends AbstractDocumentationProvide
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
final Pair<UIThemeMetadata, UIThemeMetadata.UIKeyMetadata> resolve = resolve(element);
|
||||
if (resolve == null) return null;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.editorconfig.language.codeinsight.documentation
|
||||
|
||||
import com.intellij.lang.documentation.DocumentationProvider
|
||||
@@ -10,15 +10,16 @@ import com.intellij.psi.PsiWhiteSpace
|
||||
import org.editorconfig.language.psi.interfaces.EditorConfigDescribableElement
|
||||
import org.editorconfig.language.schema.descriptors.EditorConfigDescriptor
|
||||
import org.editorconfig.language.util.EditorConfigPsiTreeUtil.getParentOfType
|
||||
import org.jetbrains.annotations.Nls
|
||||
import kotlin.math.max
|
||||
|
||||
class EditorConfigDocumentationProvider : DocumentationProvider {
|
||||
override fun generateDoc(element: PsiElement, originalElement: PsiElement?): String? {
|
||||
override fun generateDoc(element: PsiElement, originalElement: PsiElement?): @Nls String? {
|
||||
element as? EditorConfigDocumentationHolderElement ?: return null
|
||||
return element.descriptor?.documentation
|
||||
}
|
||||
|
||||
override fun getQuickNavigateInfo(element: PsiElement, originalElement: PsiElement?): String? {
|
||||
override fun getQuickNavigateInfo(element: PsiElement, originalElement: PsiElement?): @Nls String? {
|
||||
element as? EditorConfigDocumentationHolderElement ?: return null
|
||||
return element.descriptor?.documentation
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.plugins.gradle.documentation;
|
||||
|
||||
import com.intellij.codeInsight.javadoc.JavaDocUtil;
|
||||
@@ -10,6 +10,7 @@ import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import com.intellij.psi.PsiMethod;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.gradle.util.GradleConstants;
|
||||
import org.jetbrains.plugins.gradle.util.GradleDocumentationBundle;
|
||||
@@ -27,7 +28,7 @@ public class GradleDocumentationProvider implements DocumentationProvider {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
PsiFile file = element.getContainingFile();
|
||||
if (file == null || !FileUtilRt.extensionEquals(file.getName(), GradleConstants.EXTENSION)) return null;
|
||||
if (element instanceof GrLightVariable) {
|
||||
@@ -42,7 +43,7 @@ public class GradleDocumentationProvider implements DocumentationProvider {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
PsiFile file = element.getContainingFile();
|
||||
if (file == null || !FileUtilRt.extensionEquals(file.getName(), GradleConstants.EXTENSION)) return null;
|
||||
return element instanceof GrLiteral ? findDoc(element, ((GrLiteral)element).getValue()) : null;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.plugins.groovy.lang.documentation;
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightBundle;
|
||||
@@ -14,7 +14,6 @@ import com.intellij.lang.documentation.CompositeDocumentationProvider;
|
||||
import com.intellij.lang.documentation.ExternalDocumentationProvider;
|
||||
import com.intellij.lang.java.JavaDocumentationProvider;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.*;
|
||||
@@ -22,6 +21,7 @@ import com.intellij.psi.util.PsiFormatUtil;
|
||||
import com.intellij.psi.util.PsiFormatUtilBase;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -75,7 +75,7 @@ public class GroovyDocumentationProvider implements CodeDocumentationProvider, E
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
if (element instanceof GrVariable || element instanceof GrImplicitVariable) {
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
PsiVariable variable = (PsiVariable)element;
|
||||
@@ -277,7 +277,7 @@ public class GroovyDocumentationProvider implements CodeDocumentationProvider, E
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
if (element instanceof GdslNamedParameter) {
|
||||
GdslNamedParameter parameter = (GdslNamedParameter)element;
|
||||
String result = "<pre><b>" + parameter.getName() + "</b>";
|
||||
@@ -380,7 +380,7 @@ public class GroovyDocumentationProvider implements CodeDocumentationProvider, E
|
||||
}
|
||||
|
||||
@Override
|
||||
public String fetchExternalDocumentation(final Project project, PsiElement element, final List<String> docUrls, boolean onHover) {
|
||||
public @Nls String fetchExternalDocumentation(final Project project, PsiElement element, final List<String> docUrls, boolean onHover) {
|
||||
return JavaDocumentationProvider.fetchExternalJavadoc(element, project, docUrls);
|
||||
}
|
||||
|
||||
@@ -540,7 +540,7 @@ public class GroovyDocumentationProvider implements CodeDocumentationProvider, E
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable @NlsSafe String generateRenderedDoc(@NotNull PsiDocCommentBase comment) {
|
||||
public @Nls @Nullable String generateRenderedDoc(@NotNull PsiDocCommentBase comment) {
|
||||
PsiElement owner = comment.getOwner();
|
||||
String html = new GroovyDocInfoGenerator(owner == null ? comment : owner).generateRenderedDocInfo();
|
||||
return JavaDocExternalFilter.filterInternalDocInfo(html);
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.intellij.openapi.diagnostic.Logger
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.psi.*
|
||||
import com.intellij.psi.impl.compiled.ClsMethodImpl
|
||||
import org.jetbrains.annotations.Nls
|
||||
import org.jetbrains.kotlin.asJava.LightClassUtil
|
||||
import org.jetbrains.kotlin.asJava.elements.KtLightDeclaration
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
@@ -126,10 +127,12 @@ open class KotlinDocumentationProviderCompatBase : AbstractDocumentationProvider
|
||||
return if (contextElement.isModifier()) contextElement else null
|
||||
}
|
||||
|
||||
@Nls
|
||||
override fun getQuickNavigateInfo(element: PsiElement?, originalElement: PsiElement?): String? {
|
||||
return if (element == null) null else getText(element, originalElement, true)
|
||||
}
|
||||
|
||||
@Nls
|
||||
override fun generateDoc(element: PsiElement, originalElement: PsiElement?): String? {
|
||||
return getText(element, originalElement, false)
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ package org.jetbrains.kotlin.idea
|
||||
|
||||
import com.intellij.codeInsight.javadoc.JavaDocExternalFilter
|
||||
import com.intellij.psi.PsiDocCommentBase
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.PsiFile
|
||||
import com.intellij.psi.util.PsiTreeUtil
|
||||
import org.jetbrains.annotations.Nls
|
||||
import org.jetbrains.kotlin.kdoc.psi.api.KDoc
|
||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
@@ -24,6 +24,7 @@ class KotlinDocumentationProvider : KotlinDocumentationProviderCompatBase() {
|
||||
}
|
||||
}
|
||||
|
||||
@Nls
|
||||
override fun generateRenderedDoc(comment: PsiDocCommentBase): String? {
|
||||
val docComment = comment as? KDoc ?: return null
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.idea.maven.dom;
|
||||
|
||||
import com.intellij.lang.documentation.DocumentationProvider;
|
||||
@@ -13,6 +13,7 @@ import com.intellij.psi.impl.FakePsiElement;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
import com.intellij.usageView.UsageViewTypeLocation;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.idea.maven.dom.references.MavenPsiElementWrapper;
|
||||
@@ -24,7 +25,7 @@ import java.util.List;
|
||||
|
||||
public class MavenModelDocumentationProvider implements DocumentationProvider, ElementDescriptionProvider {
|
||||
@Override
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
return getDoc(element, false);
|
||||
}
|
||||
|
||||
@@ -41,7 +42,7 @@ public class MavenModelDocumentationProvider implements DocumentationProvider, E
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
return getDoc(element, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.idea.maven.dom;
|
||||
|
||||
import com.intellij.lang.documentation.DocumentationProvider;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
|
||||
public class MavenPluginModelDocumentationProvider implements DocumentationProvider {
|
||||
@Override
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
return getDocForMavenPluginParameter(element, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
return getDocForMavenPluginParameter(element, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.idea.maven.dom;
|
||||
|
||||
import com.intellij.lang.documentation.DocumentationProvider;
|
||||
@@ -7,6 +7,7 @@ import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import com.intellij.xml.util.documentation.XmlDocumentationProvider;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
@@ -37,7 +38,7 @@ public class MavenPomXmlDocumentationProvider implements DocumentationProvider {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
if (!isFromPomXml(element)) return null;
|
||||
|
||||
return myDelegate.getQuickNavigateInfo(element, originalElement);
|
||||
@@ -53,7 +54,7 @@ public class MavenPomXmlDocumentationProvider implements DocumentationProvider {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
if (!isFromPomXml(element)) return null;
|
||||
|
||||
return myDelegate.generateDoc(element, originalElement);
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
/*
|
||||
* @author max
|
||||
@@ -27,6 +13,7 @@ import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.ui.GuiUtils;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -36,7 +23,7 @@ import java.awt.*;
|
||||
public class PropertiesDocumentationProvider extends AbstractDocumentationProvider {
|
||||
@Override
|
||||
@Nullable
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
if (element instanceof IProperty) {
|
||||
return "\"" + renderPropertyValue((IProperty)element) + "\"" + getLocationString(element);
|
||||
}
|
||||
@@ -58,7 +45,7 @@ public class PropertiesDocumentationProvider extends AbstractDocumentationProvid
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateDoc(final PsiElement element, @Nullable final PsiElement originalElement) {
|
||||
public @Nls String generateDoc(final PsiElement element, @Nullable final PsiElement originalElement) {
|
||||
if (element instanceof IProperty) {
|
||||
IProperty property = (IProperty)element;
|
||||
String text = property.getDocCommentText();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.sh;
|
||||
|
||||
import com.intellij.execution.configurations.GeneralCommandLine;
|
||||
@@ -24,6 +24,7 @@ import com.intellij.sh.psi.ShGenericCommandDirective;
|
||||
import com.intellij.sh.psi.ShLiteral;
|
||||
import com.intellij.util.EnvironmentUtil;
|
||||
import com.intellij.util.io.URLUtil;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -54,7 +55,7 @@ final class ShDocumentationProvider implements DocumentationProvider {
|
||||
};
|
||||
|
||||
@Override
|
||||
public String generateDoc(PsiElement o, PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement o, PsiElement originalElement) {
|
||||
if (!wordWithDocumentation(o)) return null;
|
||||
|
||||
DOCUMENTATION_PROVIDER_USED_EVENT_ID.log();
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.tasks.doc;
|
||||
|
||||
import com.intellij.lang.documentation.AbstractDocumentationProvider;
|
||||
@@ -24,6 +10,7 @@ import com.intellij.tasks.Comment;
|
||||
import com.intellij.tasks.Task;
|
||||
import com.intellij.xml.util.XmlStringUtil;
|
||||
import com.petebevin.markdown.MarkdownProcessor;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -46,7 +33,7 @@ public class TaskDocumentationProvider extends AbstractDocumentationProvider imp
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
if (!(element instanceof TaskPsiElement)) return null;
|
||||
final Task task = ((TaskPsiElement)element).getTask();
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
@@ -76,7 +63,7 @@ public class TaskDocumentationProvider extends AbstractDocumentationProvider imp
|
||||
|
||||
|
||||
@Override
|
||||
public String fetchExternalDocumentation(Project project, PsiElement element, List<String> docUrls, boolean onHover) {
|
||||
public @Nls String fetchExternalDocumentation(Project project, PsiElement element, List<String> docUrls, boolean onHover) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ import org.jdom.JDOMException;
|
||||
import org.jdom.input.SAXBuilder;
|
||||
import org.jdom.transform.JDOMSource;
|
||||
import org.jdom.xpath.XPath;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -96,7 +97,7 @@ public class XsltDocumentationProvider implements DocumentationProvider {
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String generateDoc(PsiElement psiElement, PsiElement psiElement1) {
|
||||
public @Nls String generateDoc(PsiElement psiElement, PsiElement psiElement1) {
|
||||
if (psiElement instanceof DocElement) {
|
||||
final DocElement element = (DocElement)psiElement;
|
||||
return getDocumentation(element.getName(), element.getCategory());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.yaml.meta.impl;
|
||||
|
||||
import com.intellij.lang.documentation.DocumentationProvider;
|
||||
@@ -10,6 +10,7 @@ import com.intellij.psi.PsiManager;
|
||||
import com.intellij.psi.impl.light.LightElement;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.yaml.YAMLLanguage;
|
||||
@@ -28,7 +29,7 @@ import java.util.Objects;
|
||||
public abstract class YamlDocumentationProviderBase implements DocumentationProvider {
|
||||
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
if (!(element instanceof DocumentationElement)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.yaml.schema;
|
||||
|
||||
import com.intellij.lang.documentation.DocumentationProvider;
|
||||
@@ -8,19 +8,20 @@ import com.intellij.psi.PsiFile;
|
||||
import com.jetbrains.jsonSchema.ide.JsonSchemaService;
|
||||
import com.jetbrains.jsonSchema.impl.JsonSchemaDocumentationProvider;
|
||||
import com.jetbrains.jsonSchema.impl.JsonSchemaObject;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class YamlJsonSchemaDocumentationProvider implements DocumentationProvider {
|
||||
@Nullable
|
||||
@Override
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
return findSchemaAndGenerateDoc(element, true);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
return findSchemaAndGenerateDoc(element, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.jetbrains.python.psi.resolve.QualifiedNameFinder;
|
||||
import com.jetbrains.python.psi.types.*;
|
||||
import com.jetbrains.python.toolbox.ChainIterable;
|
||||
import one.util.streamex.StreamEx;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -54,7 +55,7 @@ public class PythonDocumentationProvider implements DocumentationProvider {
|
||||
// provides ctrl+hover info
|
||||
@Override
|
||||
@Nullable
|
||||
public String getQuickNavigateInfo(PsiElement element, @NotNull PsiElement originalElement) {
|
||||
public @Nls String getQuickNavigateInfo(PsiElement element, @NotNull PsiElement originalElement) {
|
||||
for (PythonDocumentationQuickInfoProvider point : PythonDocumentationQuickInfoProvider.EP_NAME.getExtensions()) {
|
||||
final String info = point.getQuickInfo(originalElement);
|
||||
if (info != null) {
|
||||
@@ -490,7 +491,7 @@ public class PythonDocumentationProvider implements DocumentationProvider {
|
||||
|
||||
// provides ctrl+Q doc
|
||||
@Override
|
||||
public String generateDoc(@NotNull PsiElement element, @Nullable PsiElement originalElement) {
|
||||
public @Nls String generateDoc(@NotNull PsiElement element, @Nullable PsiElement originalElement) {
|
||||
final PythonRuntimeService runtimeService = PythonRuntimeService.getInstance();
|
||||
if (runtimeService.isInPydevConsole(element) || originalElement != null && runtimeService.isInPydevConsole(originalElement)) {
|
||||
return runtimeService.createPydevDoc(element, originalElement);
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.commandInterface.commandLine;
|
||||
|
||||
import com.intellij.lang.documentation.DocumentationProvider;
|
||||
@@ -29,6 +15,7 @@ import com.jetbrains.commandInterface.commandLine.psi.CommandLineCommand;
|
||||
import com.jetbrains.commandInterface.commandLine.psi.CommandLineOption;
|
||||
import com.jetbrains.commandInterface.commandLine.psi.CommandLineVisitor;
|
||||
import com.jetbrains.python.psi.PyUtil;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -44,7 +31,7 @@ import java.util.List;
|
||||
public final class CommandLineDocumentationProvider implements DocumentationProvider {
|
||||
@Nullable
|
||||
@Override
|
||||
public String generateDoc(final PsiElement element, @Nullable final PsiElement originalElement) {
|
||||
public @Nls String generateDoc(final PsiElement element, @Nullable final PsiElement originalElement) {
|
||||
final Help help = findHelp(element);
|
||||
if (help == null) {
|
||||
return null;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.python.console;
|
||||
|
||||
import com.intellij.lang.documentation.AbstractDocumentationProvider;
|
||||
@@ -11,6 +11,7 @@ import com.jetbrains.python.documentation.PyDocumentationBuilder;
|
||||
import com.jetbrains.python.psi.PyElement;
|
||||
import com.jetbrains.python.psi.PyReferenceExpression;
|
||||
import com.jetbrains.python.psi.PyUtil;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class PydevDocumentationProvider extends AbstractDocumentationProvider {
|
||||
@@ -24,7 +25,7 @@ public class PydevDocumentationProvider extends AbstractDocumentationProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateDoc(final PsiElement element, @Nullable final PsiElement originalElement) {
|
||||
public @Nls String generateDoc(final PsiElement element, @Nullable final PsiElement originalElement) {
|
||||
// Process PydevConsoleElement case
|
||||
if (element instanceof PydevConsoleElement){
|
||||
return PydevConsoleElement.generateDoc((PydevConsoleElement)element);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.python.documentation;
|
||||
|
||||
import com.google.common.base.Suppliers;
|
||||
@@ -22,6 +22,7 @@ import com.jetbrains.python.PyBundle;
|
||||
import com.jetbrains.python.psi.PyFile;
|
||||
import com.jetbrains.python.psi.resolve.QualifiedNameFinder;
|
||||
import com.jetbrains.python.pyi.PyiFile;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jsoup.HttpStatusException;
|
||||
import org.jsoup.Jsoup;
|
||||
@@ -38,7 +39,7 @@ public class PythonExternalDocumentationProvider extends PythonDocumentationProv
|
||||
private static final Logger LOG = Logger.getInstance(PythonExternalDocumentationProvider.class);
|
||||
|
||||
@Override
|
||||
public String fetchExternalDocumentation(Project project, PsiElement element, List<String> docUrls, boolean onHover) {
|
||||
public @Nls String fetchExternalDocumentation(Project project, PsiElement element, List<String> docUrls, boolean onHover) {
|
||||
PsiNamedElement namedElement = ApplicationManager.getApplication().runReadAction((Computable<PsiNamedElement>)() -> {
|
||||
PsiElement moduleAnchor = element instanceof PsiDirectory ? element : element.getContainingFile();
|
||||
final Module module = ModuleUtilCore.findModuleForPsiElement(moduleAnchor);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.util.xml;
|
||||
|
||||
import com.intellij.lang.documentation.DocumentationProvider;
|
||||
@@ -6,6 +6,7 @@ import com.intellij.pom.PomTarget;
|
||||
import com.intellij.pom.PomTargetPsiElement;
|
||||
import com.intellij.psi.DelegatePsiTarget;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
|
||||
/**
|
||||
* @author Dmitry Avdeev
|
||||
@@ -13,7 +14,7 @@ import com.intellij.psi.PsiElement;
|
||||
public class DomDocumentationProvider implements DocumentationProvider {
|
||||
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, final PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, final PsiElement originalElement) {
|
||||
if (element instanceof PomTargetPsiElement) {
|
||||
PomTarget target = ((PomTargetPsiElement)element).getTarget();
|
||||
if (target instanceof DelegatePsiTarget) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.xml.util.documentation;
|
||||
|
||||
import com.intellij.documentation.mdn.MdnSymbolDocumentation;
|
||||
@@ -18,6 +18,7 @@ import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.xml.XmlElementDescriptor;
|
||||
import com.intellij.xml.util.XmlUtil;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -51,7 +52,7 @@ public class HtmlDocumentationProvider implements DocumentationProvider {
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
if (element instanceof SchemaPrefix) {
|
||||
return ((SchemaPrefix)element).getQuickNavigateInfo();
|
||||
}
|
||||
@@ -70,7 +71,7 @@ public class HtmlDocumentationProvider implements DocumentationProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
String result = generateDocForHtml(element, originalElement);
|
||||
if (result != null) return result;
|
||||
return generateDocFromStyleOrScript(element, originalElement);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.xml.util.documentation;
|
||||
|
||||
import com.intellij.lang.Language;
|
||||
@@ -22,6 +22,7 @@ import com.intellij.util.Processor;
|
||||
import com.intellij.xml.*;
|
||||
import com.intellij.xml.impl.schema.*;
|
||||
import com.intellij.xml.util.XmlUtil;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -43,7 +44,7 @@ public class XmlDocumentationProvider implements DocumentationProvider {
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
if (element instanceof SchemaPrefix) {
|
||||
return ((SchemaPrefix)element).getQuickNavigateInfo();
|
||||
}
|
||||
@@ -76,7 +77,7 @@ public class XmlDocumentationProvider implements DocumentationProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, final PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, final PsiElement originalElement) {
|
||||
if (element instanceof XmlElementDecl) {
|
||||
PsiElement curElement = XmlUtil.findPreviousComment(element);
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet;
|
||||
import org.intellij.plugins.relaxNG.model.descriptors.CompositeDescriptor;
|
||||
import org.intellij.plugins.relaxNG.model.descriptors.RngElementDescriptor;
|
||||
import org.intellij.plugins.relaxNG.model.descriptors.RngXmlAttributeDescriptor;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.kohsuke.rngom.digested.DElementPattern;
|
||||
@@ -44,7 +45,7 @@ final class RngDocumentationProvider implements DocumentationProvider {
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
final XmlElement c = PsiTreeUtil.getParentOfType(originalElement, XmlTag.class, XmlAttribute.class);
|
||||
if (c != null && c.getManager() == null) {
|
||||
LOG.warn("Invalid context element passed to generateDoc()", new Throwable("<stack trace>"));
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.intellij.plugins.relaxNG.compact.psi.RncDefine;
|
||||
import org.intellij.plugins.relaxNG.compact.psi.RncElement;
|
||||
import org.intellij.plugins.relaxNG.compact.psi.util.EscapeUtil;
|
||||
import org.intellij.plugins.relaxNG.compact.psi.util.RenameUtil;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -117,7 +118,7 @@ public final class RngCompactLanguage extends Language {
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
public @Nls String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
if (element instanceof RncElement) {
|
||||
PsiElement comment = element.getPrevSibling();
|
||||
while (comment instanceof PsiWhiteSpace) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.documentation.mdn
|
||||
|
||||
import com.intellij.lang.documentation.DocumentationProvider
|
||||
@@ -11,13 +11,14 @@ import com.intellij.psi.xml.XmlTag
|
||||
import com.intellij.psi.xml.XmlToken
|
||||
import com.intellij.xml.util.HtmlUtil
|
||||
import com.intellij.xml.util.XmlUtil
|
||||
import org.jetbrains.annotations.Nls
|
||||
|
||||
class XmlMdnDocumentationProvider : DocumentationProvider {
|
||||
|
||||
override fun getUrlFor(element: PsiElement, originalElement: PsiElement?): List<String>? =
|
||||
getMdnDocumentation(element, originalElement)?.let { listOf(it.url) }
|
||||
|
||||
override fun generateDoc(element: PsiElement, originalElement: PsiElement?): String? =
|
||||
override fun generateDoc(element: PsiElement, originalElement: PsiElement?): @Nls String? =
|
||||
getMdnDocumentation(element, originalElement)?.getDocumentation(true)
|
||||
|
||||
companion object {
|
||||
|
||||
Reference in New Issue
Block a user