Package org.eclipse.php.internal.core.typeinference.context

Examples of org.eclipse.php.internal.core.typeinference.context.FileContext


          namespace = null;
        }
      }
      String fullName = AbstractOccurrencesFinder.getFullName(identifier,
          fLastUseParts, namespace);
      FileContext context = new FileContext(getSourceModule(),
          SourceParserUtil.getModuleDeclaration(getSourceModule(),
              null), identifier.getStart());

      IModelElement[] elements = PHPTypeInferenceUtils.getModelElements(
          PHPClassType.fromTypeName(fullName, getSourceModule(),
View Full Code Here


    public boolean visit(TraitUseStatement node) {
      ISourceModule sourceModule = getSourceModule();
      ModuleDeclaration moduleDeclaration = SourceParserUtil
          .getModuleDeclaration(sourceModule, null);
      FileContext context = new FileContext(sourceModule,
          moduleDeclaration, node.getStart());
      List<TraitStatement> tsList = node.getTsList();
      for (TraitStatement traitStatement : tsList) {
        if (traitStatement instanceof TraitAliasStatement) {
          TraitAliasStatement statement = (TraitAliasStatement) traitStatement;
View Full Code Here

    public boolean visit(TraitUseStatement node) {
      ISourceModule sourceModule = getSourceModule();
      ModuleDeclaration moduleDeclaration = SourceParserUtil
          .getModuleDeclaration(sourceModule, null);
      FileContext context = new FileContext(sourceModule,
          moduleDeclaration, node.getStart());
      List<TraitStatement> tsList = node.getTsList();
      for (TraitStatement traitStatement : tsList) {
        if (traitStatement instanceof TraitAliasStatement) {
          TraitAliasStatement statement = (TraitAliasStatement) traitStatement;
View Full Code Here

      for (IType type : types) {
        PHPClassType classType = PHPClassType.fromIType(type);

        ModuleDeclaration moduleDeclaration = SourceParserUtil
            .getModuleDeclaration(type.getSourceModule(), null);
        FileContext fileContext = new FileContext(
            type.getSourceModule(), moduleDeclaration, offset);
        TypeContext typeContext = new TypeContext(fileContext,
            classType);
        PHPTypeInferencer typeInferencer = new PHPTypeInferencer();
View Full Code Here

        phpVersion, statementText, propertyEndPosition, true);
    String className = statementText.subSequence(classNameStart,
        propertyEndPosition).toString();
    ModuleDeclaration moduleDeclaration = SourceParserUtil
        .getModuleDeclaration(sourceModule, null);
    FileContext context = new FileContext(sourceModule, moduleDeclaration,
        offset);
    IEvaluatedType type = PHPClassType.fromTraitName(className,
        sourceModule, offset);
    IType[] modelElements = PHPTypeInferenceUtils.getModelElements(type,
        context, offset);
View Full Code Here

          return getVariableType(sourceModule, className,
              statementStart);
        } else {
          ModuleDeclaration moduleDeclaration = SourceParserUtil
              .getModuleDeclaration(sourceModule, null);
          FileContext context = new FileContext(sourceModule,
              moduleDeclaration, offset);
          IEvaluatedType type = PHPClassType.fromTypeName(className,
              sourceModule, offset);
          IType[] modelElements = PHPTypeInferenceUtils
              .getModelElements(type, context, offset);
View Full Code Here

      /*
       * offset can be bigger than unit.end when sourceunit have syntax
       * error on end
       */
      Logger.log(Logger.WARNING_DEBUG, "Context is null"); //$NON-NLS-1$
      return new FileContext(sourceModule, unit, offset);
    }
    return visitor.getContext();
  }
View Full Code Here

    ISourceModule sourceModule = abstractContext.getSourceModule();
    List<String> useTypes = abstractContext.getUseTypes();
    String prefix = abstractContext.getPrefix();
    ModuleDeclaration moduleDeclaration = SourceParserUtil
        .getModuleDeclaration(sourceModule, null);
    FileContext fileContext = new FileContext(sourceModule,
        moduleDeclaration, offset);
    SourceRange replacementRange = getReplacementRange(abstractContext);
    for (String useType : useTypes) {
      if (useType.trim().toLowerCase().startsWith(prefix.toLowerCase())) {
View Full Code Here

      ExpressionTypeGoal expressionGoal = (ExpressionTypeGoal) goal;
     
      if (expressionGoal.getContext() instanceof FileContext) {

        FileContext context = (FileContext) expressionGoal.getContext();
       
        ASTNode node = expressionGoal.getExpression();
       
        if (node instanceof VariableReference) {
         
          VariableReference variable = (VariableReference) node;
          TemplateField element = SymfonyModelAccess.getDefault().findTemplateVariableType(variable.toString(), context.getSourceModule());
          
           if (element != null) {
                        
             String viewName = PathUtils.createViewPathFromTemplate(context.getSourceModule(), false);
            
             if (viewName != null && element.getViewPath().equals(viewName))
               return new TemplateVariableGoalEvaluator(goal, element);
           }
        }
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.core.typeinference.context.FileContext

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.