Package com.intellij.psi

Examples of com.intellij.psi.PsiComment


      builder.append(" ");
      builder.append(type.toString().toLowerCase());
      builder.append(" ");
      builder.append(namedComponent.getName());
    }
    final PsiComment comment = HaxeResolveUtil.findDocumentation(namedComponent);
    if (comment != null) {
      builder.append("<br/>");
      builder.append(HaxePresentableUtil.unwrapCommentDelimiters(comment.getText()));
    }
    return builder.toString();
  }
View Full Code Here


  @Nullable
  private static PsiComment getSuppressedIn(@NotNull PsiElement place, @NotNull String toolId) {
    // find suppression holder with suppression comment about given inspection tool
    PsiElement suppressionHolder = PsiTreeUtil.getNonStrictParentOfType(place, GherkinSuppressionHolder.class);
    while (suppressionHolder != null) {
      final PsiComment suppressionHolderElement = getSuppressionComment(toolId, suppressionHolder);
      if (suppressionHolderElement != null) {
        return suppressionHolderElement;
      }
      suppressionHolder = PsiTreeUtil.getParentOfType(suppressionHolder, GherkinSuppressionHolder.class);
    }
View Full Code Here

  @Override
  public void getLanguagesToInject(@NotNull PsiLanguageInjectionHost host,
                                   @NotNull InjectedLanguagePlaces injectionPlacesRegistrar) {
    if (host instanceof PsiComment) {
      PsiComment comment = (PsiComment) host;
      if (comment.getTokenType() == JSTokenTypes.C_STYLE_COMMENT) {
        String commentStr = comment.getText();
        TextRange htmlTextRange = findTextRange(commentStr);
        if (htmlTextRange != null && HTML_LANGUAGE != null) {
          injectionPlacesRegistrar.addPlace(HTML_LANGUAGE, htmlTextRange, null, null);
        }
      }
View Full Code Here

  @Nullable
  @Override
  public String getDocText() {
    PsiElement parent = myErlangModule.getParent();
    PsiComment comment = PsiTreeUtil.getPrevSiblingOfType(parent, PsiComment.class);
    if (comment != null && comment.getTokenType() == ErlangParserDefinition.ERL_MODULE_DOC_COMMENT) {
      List<PsiComment> comments = ErlangDocUtil.collectPrevComments(comment);
      String commentsText = ErlangDocUtil.getCommentsText(comments, "%%%", ErlangDocUtil.EDOC_MODULE_TAGS);
      return ErlangDocUtil.wrapInPreTag(commentsText);
    }
    return null;
View Full Code Here

  @Nullable
  @Override
  public String getDocText() {
    ErlangFunction prevFunction = PsiTreeUtil.getPrevSiblingOfType(myErlangFunction, ErlangFunction.class);
    ErlangSpecification spec = ErlangPsiImplUtil.getSpecification(myErlangFunction);
    PsiComment comment = PsiTreeUtil.getPrevSiblingOfType(myErlangFunction, PsiComment.class);

    String commentText = "";
    if (spec != null && ErlangPsiImplUtil.notFromPreviousFunction(spec, prevFunction)) {
      commentText += spec.getText().replaceFirst("spec", "<b>Specification:</b><br/>") + "<br/><br/>";
    }
    if (comment != null && comment.getTokenType() == ErlangParserDefinition.ERL_FUNCTION_DOC_COMMENT &&
      ErlangPsiImplUtil.notFromPreviousFunction(comment, prevFunction)) {
      commentText += "<b>Comment:</b><br/>" + ErlangDocUtil.getCommentsText(
        ErlangDocUtil.collectPrevComments(comment), "%%", ErlangDocUtil.EDOC_FUNCTION_TAGS);
    }
    return ErlangDocUtil.wrapInPreTag(commentText);
View Full Code Here

TOP

Related Classes of com.intellij.psi.PsiComment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.