Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-2787

can't support "<#include" tag for parse all marcos for freemarker library

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • LATER
    • None
    • freemarker
    • None

      there is one freemarker library file "a.ftl". in the "a.ftl" file, it use code "<#include "b.ftl" />" to include "b.ftl". In this way, when Content Assist list all marcos, it only get all marcos from "a.ftl" and can't get from "b.ftl".
      for this bug, I read all related codes, I find it only parse "#marco" for ftl file, the "#include" can't be supported now. so I need other temp solution for this case. I try to add the two ftl file into freemarker library as same namespace "w" on ".freemarker-ide.xml". but it only can get all marcos from the last ftl file. I read all related codes, I find it use the namespace to the key of Map on "org.jboss.ide.eclipse.freemarker.configuration.ConfigurationManager", It only support one namespace at one time. So I hack this codes, before add a MacroLibrary into the Map, I will check the Map, if it contain the current namespace, I will append some "" char in the namespace begain, and use this new namespace for key to add MacroLibrary into the Map. When the Content Assist need list all marcos by file "org.jboss.ide.eclipse.freemarker.model.MacroInstance" on line 109, I will remove all begins "" char for namespace.
      I know this is a bad solution for this case, but it can fixed this bug. I sincerely hope you can fix this bug by a good solution.

            nivologd@gmail.com Denis Golovin (Inactive)
            watano_jira super watano (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: