Package com.dubture.symfony.twig.codeassist.context

Examples of com.dubture.symfony.twig.codeassist.context.TemplateVariableCompletionContext


  @Override
  public void apply(ICompletionReporter reporter) {

    try {
     
      TemplateVariableCompletionContext ctxt = (TemplateVariableCompletionContext) getContext();
     
      SymfonyModelAccess model = SymfonyModelAccess.getDefault();
      ISourceModule module = ctxt.getSourceModule();
      IType controller = model.findControllerByTemplate(module);
      List<TemplateField>variables = model.findTemplateVariables(controller);
      String viewPath = PathUtils.createViewPathFromTemplate(ctxt.getSourceModule(), true);
     
      SourceRange range = getReplacementRange(ctxt);
     
      // prepend the php dollar variable for the equals check
      String prefix = "$" +ctxt.getPrefix();
     
      for(TemplateField element : variables) {

        if (viewPath.equals(element.getViewPath()) && CodeAssistUtils.startsWithIgnoreCase(element.getElementName(), prefix)) {
          reporter.reportField(new FakeField(element, element.getElementName(), Modifiers.AccPublic), "", range, true);
View Full Code Here


  @Override
  public ICompletionContext[] createContexts() {
   
    return new ICompletionContext[] {
        new TemplateVariableCompletionContext(),
        new TemplateVariableFieldCompletionContext(),
        new RouteCompletionContext(),
        new ViewPathArgumentContext(),
        new TranslationCompletionContext(),
       
View Full Code Here

TOP

Related Classes of com.dubture.symfony.twig.codeassist.context.TemplateVariableCompletionContext

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.