Package org.eclipse.dltk.core.index2.IIndexingRequestor

Examples of org.eclipse.dltk.core.index2.IIndexingRequestor.ReferenceInfo


        final List<TemplateField> variables = new ArrayList<TemplateField>();
        if (scope == null || engine == null) {
            return variables;
        }

        final IElementResolver resolver = ModelAccess.getElementResolver(SymfonyLanguageToolkit.getDefault());
        engine.search(ISymfonyModelElement.TEMPLATE_VARIABLE, null, null, 0, 0, 100, SearchFor.REFERENCES, MatchRule.PREFIX, scope, new ISearchRequestor() {
            @Override
            public void match(int elementType, int flags, int offset, int length,
                    int nameOffset, int nameLength, String elementName,
                    String metadata, String doc, String qualifier, String parent,
                    ISourceModule sourceModule, boolean isReference) {
                IModelElement element = resolver.resolve(elementType, flags, offset, length, nameOffset, nameLength, elementName, metadata, doc, qualifier, parent, sourceModule);

                if (element != null) {
                    if (element instanceof TemplateField)
                        variables.add((TemplateField) element);
                }
View Full Code Here


        if (scope == null || engine == null) {
            return null;
        }

        final List<TemplateField> variables = new ArrayList<TemplateField>();
        final IElementResolver resolver = ModelAccess.getElementResolver(SymfonyLanguageToolkit.getDefault());

        engine.search(ISymfonyModelElement.TEMPLATE_VARIABLE, null, variableName, 0, 0, 100, SearchFor.REFERENCES, MatchRule.EXACT, scope, new ISearchRequestor() {
            @Override
            public void match(int elementType, int flags, int offset, int length,
                    int nameOffset, int nameLength, String elementName,
                    String metadata, String doc, String qualifier, String parent,
                    ISourceModule sourceModule, boolean isReference) {
                IModelElement element = resolver.resolve(elementType, flags, offset, length, nameOffset, nameLength, elementName, metadata, doc, qualifier, parent, sourceModule);

                if (element != null && element instanceof TemplateField) {
                    variables.add((TemplateField) element);
                }
            }
View Full Code Here

        if (scope == null || engine == null) {
            return null;
        }

        final List<TemplateField> variables = new ArrayList<TemplateField>();
        final IElementResolver resolver = ModelAccess.getElementResolver(SymfonyLanguageToolkit.getDefault());

        // handle twig variables
        if (!varName.startsWith("$")) {
            varName = "$" + varName;
        }

        engine.search(ISymfonyModelElement.TEMPLATE_VARIABLE, viewPath, varName, 0, 0, 100, SearchFor.REFERENCES, MatchRule.EXACT, scope, new ISearchRequestor() {
            @Override
            public void match(int elementType, int flags, int offset, int length,
                    int nameOffset, int nameLength, String elementName,
                    String metadata, String doc, String qualifier, String parent,
                    ISourceModule sourceModule, boolean isReference) {
                IModelElement element = resolver.resolve(elementType, flags, offset, length, nameOffset, nameLength, elementName, metadata, doc, qualifier, parent, sourceModule);

                if (element != null) {
                    if (element instanceof TemplateField)
                        variables.add((TemplateField) element);
                }
View Full Code Here

    }

    // Add method declaration:
    modifyDeclaration(
        method,
        new DeclarationInfo(IModelElement.METHOD, modifiers, method
            .sourceStart(), method.sourceEnd()
            - method.sourceStart(), method.getNameStart(), method
            .getNameEnd() - method.getNameStart(), methodName,
            metadata.length() == 0 ? null : metadata.toString(),
            encodeDocInfo(method), fCurrentQualifier,
View Full Code Here

      }
    }
    modifiers = markAsDeprecated(modifiers, type);
    modifyDeclaration(
        type,
        new DeclarationInfo(IModelElement.TYPE, modifiers, type
            .sourceStart(), type.sourceEnd() - type.sourceStart(),
            type.getNameStart(), type.getNameEnd()
                - type.getNameStart(), type.getName(), metadata
                .length() == 0 ? null : metadata.toString(),
            encodeDocInfo(type), isNamespace ? null
View Full Code Here

            }

            String name = removeParenthesis(split);
            int offset = docTag.sourceStart();
            int length = docTag.sourceStart() + 9;
            modifyDeclaration(null, new DeclarationInfo(
                IModelElement.FIELD, Modifiers.AccPublic,
                offset, length, offset, length, name, null,
                null, fCurrentQualifier, fCurrentParent));

          } else if (tagKind == PHPDocTag.METHOD) {
            // http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.method.pkg.html
            final String[] split = WHITESPACE_SEPERATOR
                .split(docTag.getValue().trim());
            if (split.length < 2) {
              break;
            }

            String name = removeParenthesis(split);
            int index = name.indexOf('(');
            if (index > 0) {
              name = name.substring(0, index);
            }
            int offset = docTag.sourceStart();
            int length = docTag.sourceStart() + 6;
            modifyDeclaration(null, new DeclarationInfo(
                IModelElement.METHOD, Modifiers.AccPublic,
                offset, length, offset, length, name, null,
                null, fCurrentQualifier, fCurrentParent));
          }
        }
View Full Code Here

    int modifiers = decl.getModifiers();
    modifiers = markAsDeprecated(modifiers, decl);

    modifyDeclaration(
        decl,
        new DeclarationInfo(IModelElement.FIELD, modifiers, decl
            .sourceStart(), decl.sourceEnd() - decl.sourceStart(),
            decl.getNameStart(), decl.getNameEnd()
                - decl.getNameStart(), decl.getName(), null,
            encodeDocInfo(decl), null, null));
View Full Code Here

    // This is variable declaration:
    int modifiers = markAsDeprecated(decl.getModifiers(), decl);

    modifyDeclaration(
        decl,
        new DeclarationInfo(IModelElement.FIELD, modifiers, decl
            .sourceStart(), decl.sourceEnd() - decl.sourceStart(),
            decl.getNameStart(), decl.getNameEnd()
                - decl.getNameStart(), decl.getName(), null,
            encodeDocInfo(decl), fCurrentQualifier, fCurrentParent));
View Full Code Here

      if (idx != -1) {
        lastSegment = lastSegment.substring(idx + 1);
      }
      modifyDeclaration(
          include,
          new DeclarationInfo(IModelElement.IMPORT_DECLARATION, 0,
              include.sourceStart(), include.sourceEnd()
                  - include.sourceStart(), filePath
                  .sourceStart(), filePath.sourceEnd()
                  - filePath.sourceStart(), lastSegment,
              fullPath, null, null, null));
View Full Code Here

    ConstantReference constantName = declaration.getConstantName();
    int offset = constantName.sourceStart();
    int length = constantName.sourceEnd();
    modifyDeclaration(
        declaration,
        new DeclarationInfo(IModelElement.FIELD, modifiers, offset,
            length, offset, length, ASTUtils
                .stripQuotes(constantName.getName()), null,
            encodeDocInfo(declaration), fCurrentQualifier,
            fCurrentParent));
    return visitGeneral(declaration);
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.core.index2.IIndexingRequestor.ReferenceInfo

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.