Package com.dubture.symfony.core.codeassist.contexts

Examples of com.dubture.symfony.core.codeassist.contexts.EntityCompletionContext



    @Override
    public void apply(ICompletionReporter reporter) throws BadLocationException {

        EntityCompletionContext context = (EntityCompletionContext) getContext();
        SymfonyModelAccess model = SymfonyModelAccess.getDefault();
        IScriptProject project = context.getSourceModule().getScriptProject();
        SourceRange range = getReplacementRange(context);
        IDLTKSearchScope projectScope = SearchEngine.createSearchScope(context.getSourceModule().getScriptProject());
        DoctrineModelAccess doctrineModel =  DoctrineModelAccess.getDefault();
        IModelAccessCache cache = null;
        if (context instanceof IModelCacheContext) {
          cache = ((IModelCacheContext) context).getCache();
        }
        EntityAlias alias = context.getAlias();
        String prefix = context.getPrefix();
       
        if (alias.hasBundle() == false) {
            List<Bundle> bundles = model.findBundles(project);
            for (Bundle b : bundles) {
                IType[] bundleTypes = EMPTY_TYPES;
                if (cache != null) {
                  Collection<IType> types = cache.getTypes(context.getSourceModule(), b.getElementName(), null, null);
                  if (types != null) {
                    bundleTypes = types.toArray(new IType[types.size()]);
                  }
                } else {
                  bundleTypes = PhpModelAccess.getDefault().findTypes(b.getElementName(), MatchRule.EXACT, 0, 0, projectScope, null);
View Full Code Here


        new AnnotationCompletionContext(),
        new ServiceContainerContext(),
        new TemplateVariableContext(),
        new RouteCompletionContext(),
        new ViewPathArgumentContext(),
        new EntityCompletionContext(),
        new TransUnitCompletionContext(),
    };
  }
View Full Code Here

TOP

Related Classes of com.dubture.symfony.core.codeassist.contexts.EntityCompletionContext

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.