#1568 CtagsInterface broken if invocation options removed

closed
Tom Power
None
6
2012-05-30
2012-03-13
Jarek Czekalski
No

CtagsInterface relies strongly on default invocation options it provides. When one removes the option --fields=+anzKiS it throws a lot of exceptions and generally doesn't work. The least fix would be to include a remark in the documentation that some switches are necessary. And to give that switches explicitly so that the user was able to restore them.

Discussion

  • I was able to avoid most of the exceptions after changing the fallback kind from null to something in Tag.java:

    kind = extensions.containsKey(KIND_KEY) ? extensions.get(KIND_KEY) : "XXX";

     
  • Tom Power
    Tom Power
    2012-05-24

    • assigned_to: nobody --> tp21
    • status: open --> open-fixed
     
  • Tom Power
    Tom Power
    2012-05-24

    • status: open-fixed --> closed-fixed
     
  • Maybe it is now safe to remove the options. But the real scenario was as follows:

    1. I need to add --language-force=xxxx to the ctags invocation options
    2. Hmm, I don't need all these "fields"
    3. I remove the "fields" leaving only my required option
    4. Plugin fails with the exception
    5. No way to guess what must be put in the fields, because doc is silent about it

    8:21:45 PM [jEdit Worker #3] [error] TaskManager$MyTask: java.lang.NullPointerException
    8:21:45 PM [jEdit Worker #3] [error] TaskManager$MyTask: at ctagsinterface.dockables.TagBrowser$NameSorter.compare(TagBrowser.java:245)
    8:21:45 PM [jEdit Worker #3] [error] TaskManager$MyTask: at ctagsinterface.dockables.TagBrowser.addChild(TagBrowser.java:167)
    8:21:45 PM [jEdit Worker #3] [error] TaskManager$MyTask: at ctagsinterface.dockables.TagBrowser.addToTree(TagBrowser.java:149)
    8:21:45 PM [jEdit Worker #3] [error] TaskManager$MyTask: at ctagsinterface.dockables.TagBrowser$4.run(TagBrowser.java:131)
    8:21:45 PM [jEdit Worker #3] [error] TaskManager$MyTask: at org.gjt.sp.util.TaskManager$MyTask._run(TaskManager.java:175)
    8:21:45 PM [jEdit Worker #3] [error] TaskManager$MyTask: at org.gjt.sp.util.Task.run(Task.java:64)
    8:21:45 PM [jEdit Worker #3] [error] TaskManager$MyTask: at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    8:21:45 PM [jEdit Worker #3] [error] TaskManager$MyTask: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    8:21:45 PM [jEdit Worker #3] [error] TaskManager$MyTask: at java.lang.Thread.run(Thread.java:662)

     
    • status: closed-fixed --> open
     
  • Tom Power
    Tom Power
    2012-05-24

    This was a push problem too but I only made the basic changes you suggested, I think --fields=+anzKiSl is included in the "invocation options" (rather than in the props file) so the user can add flags to that option if they want and also see all the options they're using. Hopefully putting a note on the field and something in help will be enough to put users off removing those options while keeping the other uses open. Maybe a check too, if the flags on that option are removed they show up next time?

     
  • Tom Power
    Tom Power
    2012-05-30

    OK I hope the note and extra docs will be enough now, think adding checks for the options that are entered could cause more problems than it'd solve.

     
  • Tom Power
    Tom Power
    2012-05-30

    • status: open --> closed