Uploaded image for project: 'yangide'
  1. yangide
  2. YANGIDE-3

Yang parser is only run on the current buffer when it changes, which results in inconsistencies in compile errors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • unspecified
    • General
    • None
    • Operating System: All
      Platform: All

    • 5847

      When a change is made to a Yang module in the editor, only that Yang module is compiled by the Yang parser.

      This can create inconsistencies. The required situations may be contrived, but they can be easily demonstrated.

      Say a project has both a "foo.yang" and a "bar.yang", and the former imports the latter.

      Assume there are no parser errors at this point.

      Now go into "bar.yang" and change the module name from "bar" to "baz". Save it.

      What you would expect to happen at this point is to see a compile error marker in "foo", because it references a module that isn't defined. That is not the case.

      Now go into "foo.yang". Put the cursor at the end of any line and add a space. The error about the missing import file will immediately appear (although not necessarily as a proper compile marker in the editor view). Save the file.

      Go back into "bar.yang". Change the module name back to "bar". Save the file. The error in "foo.yang" should still be there.

      Now go back to "foo.yang". Add a space again. See the error go away.

      The crux of the problem here is that the Yang parser is only run on a single file at once (unless you're doing a full build).

      I believe the solution to this requires implementing a "Builder" and a "Nature". I understand the basic structure of these, but I don't understand how the Builder is going to invoke the Yang parser on the modules that need to be recompiled. I don't know if there's a way to know which ones need to be recompiled, except to recompile all the modules in the project.

      The Nature is perhaps simpler. I believe the Nature would be associated with the project in "com.cisco.yangide.ui.wizards.YangProjectWizard.performFinish()".

            Unassigned Unassigned
            dkarr David M. Karr
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: