fredyvonvinet / ANTLR4-Plugins-for-NetBeans

NetBeans plugins for ANTLR 4 enabling to integrate ANTLR grammar files in standard NetBeans projects (ant-based or Maven-based).
9 stars 11 forks source link

Adding a grammar file indexer for updating error badge at file level. #26

Closed fredyvonvinet closed 7 years ago

fredyvonvinet commented 7 years ago

When a file contains some error badges due to a non existent token file, when this file is created (by hand or by build process), NetBeans editor framework launches a new parsing of the file. So error badges inside editor disappear.

Unfortunately, it does not update file error badge (by calling ErrorsCache.setError()), so the file remains with an error badge although editor displays no error badge.

A build process may even validate several files for instance if several grammar file import a generated token file.

The best way to solve that issue is to add a grammar file indexer that will be launched each time new files are created. We do not need to index grammar rules or other stuff but we will use it for updating ErrorsCache that manages file badging.

fredyvonvinet commented 7 years ago

Solved by adding class ErrorBadgingUpdater.