Examples of PsiElementVisitor


Examples of com.intellij.psi.PsiElementVisitor

  @Override
  public void visitFunction(final Function function) {
    setHighlighting(function, myHolder, MathematicaSyntaxHighlighterColors.ANONYMOUS_FUNCTION);

    PsiElementVisitor patternVisitor = new MathematicaVisitor() {
      @Override
      public void visitElement(PsiElement element) {
        element.acceptChildren(this);
      }

      @Override
      public void visitSymbol(Symbol symbol) {
        if (MathematicaElementTypes.SLOTS.contains(symbol.getNode().getFirstChildNode().getElementType())) {
          setHighlighting(symbol, myHolder, MathematicaSyntaxHighlighterColors.PATTERN);
        }
      }
    };

    patternVisitor.visitElement(function);
  }
View Full Code Here

Examples of com.intellij.psi.PsiElementVisitor

    final Project project = context.getProject();
    SonarConsole.get(project).clear();
    final Set<Module> modules = Sets.newHashSet();
    final ImmutableList.Builder<PsiFile> filesBuilder = ImmutableList.builder();

    context.getRefManager().getScope().accept(new PsiElementVisitor() {
      @Override
      public void visitFile(PsiFile psiFile) {
        filesBuilder.add(psiFile);
        final Module module = ModuleUtil.findModuleForPsiElement(psiFile);
        if (module != null) modules.add(module);
View Full Code Here

Examples of com.intellij.psi.PsiElementVisitor

  @Override
  public void inspectionFinished(@NotNull InspectionManager manager, @NotNull GlobalInspectionContext context, @NotNull ProblemDescriptionsProcessor problemDescriptionsProcessor) {
    super.inspectionFinished(manager, context, problemDescriptionsProcessor);

    final ImmutableList.Builder<PsiFile> pfb = ImmutableList.builder();
    context.getRefManager().getScope().accept(new PsiElementVisitor() {
      @Override
      public void visitFile(PsiFile file) {
        pfb.add(file);
      }
    });
View Full Code Here

Examples of com.intellij.psi.PsiElementVisitor

      return new NullableComputable<String>() {
        @Nullable
        @Override
        public String compute() {
          dir.accept(new PsiElementVisitor() {
            @Override
            public void visitFile(final PsiFile file) {
              if (file instanceof GherkinFile) {
                for (CucumberJvmExtensionPoint extension : extensions) {
                  extension.getGlues((GherkinFile)file, glues);
View Full Code Here

Examples of com.intellij.psi.PsiElementVisitor

    if (compoundValue == null) {
      holder.createErrorAnnotation(value, "File sequence should start with a dash symbol");
      return;
    }
    final String firstIndent = toIndentString(compoundValue.getPrevSibling());
    compoundValue.acceptChildren(new PsiElementVisitor() {
      @Override
      public void visitElement(PsiElement element) {
        final YAMLSequence sequence = ObjectUtils.tryCast(element, YAMLSequence.class);
        if (sequence != null) {
          annotateFileSequence(sequence, holder, basePath, firstIndent);
View Full Code Here

Examples of com.intellij.psi.PsiElementVisitor

  private static void annotateFileSequence(@NotNull YAMLSequence sequence,
                                           @NotNull final AnnotationHolder holder,
                                           @Nullable final VirtualFile basePath,
                                           @NotNull final String expectedIndent) {
    checkSequenceIndent(sequence, holder, expectedIndent);
    sequence.acceptChildren(new PsiElementVisitor() {
      @Override
      public void visitElement(PsiElement element) {
        if (element instanceof YAMLSequence) {
          YAMLSequence childSequence = (YAMLSequence) element;
          annotateFileSequence(childSequence, holder, basePath, expectedIndent);
View Full Code Here

Examples of com.intellij.psi.PsiElementVisitor

    if (document == null) {
      return null;
    }
    final List<YAMLKeyValue> keyValues = Lists.newArrayList();
    final Ref<Integer> previousKeyValueEndLineNumberRef = Ref.create(-1);
    yamlDocument.acceptChildren(new PsiElementVisitor() {
      @Override
      public void visitElement(PsiElement element) {
        if (JsPsiUtils.isElementOfType(element, YAMLTokenTypes.EOL, YAMLTokenTypes.INDENT)
            || element instanceof PsiComment) {
          return;
View Full Code Here

Examples of com.intellij.psi.PsiElementVisitor

  @Nullable
  public static PsiElementFragment<YAMLSequence> buildSequenceTextFragment(@NotNull YAMLSequence sequence) {
    final Ref<Integer> startOffsetRef = Ref.create(null);
    final Ref<Integer> endOffsetRef = Ref.create(null);
    sequence.acceptChildren(new PsiElementVisitor() {
      @Override
      public void visitElement(PsiElement element) {
        if (JsPsiUtils.isElementOfType(
          element,
          YAMLTokenTypes.TEXT, YAMLTokenTypes.SCALAR_DSTRING, YAMLTokenTypes.SCALAR_STRING
View Full Code Here

Examples of com.intellij.psi.PsiElementVisitor

* Date: 2/13/12
*/
public class CfmlFileReferenceInspection extends LocalInspectionTool {
  @NotNull
  public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, final boolean isOnTheFly) {
    return new PsiElementVisitor() {
      public void visitElement(final PsiElement element) {
        PsiElement tagParent = PsiTreeUtil.getParentOfType((element), CfmlTag.class);
        if ((element.getNode().getElementType() == CfmlTokenTypes.STRING_TEXT)) {
          if ((tagParent == null ||
               (!((CfmlTag)tagParent).getTagName().equalsIgnoreCase("cfinclude") &&
View Full Code Here

Examples of com.intellij.psi.PsiElementVisitor

* Date: 17.02.2009
*/
public abstract class CfmlInspectionBase extends LocalInspectionTool {
  @NotNull
  public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, final boolean isOnTheFly) {
    return new PsiElementVisitor() {
      public void visitElement(final PsiElement element) {
        registerProblems(element, holder);
      }
    };
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.