GNOME Bugzilla – Bug 696325
libvala: Get a list of all used defines ("pp conditionals")
Last modified: 2018-05-22 14:44:16 UTC
Created attachment 239496 [details] Proof of concept (10+) Currently it is not possible to get a list of all used defines, e.g. #if FOOBAR, ... #elif BAR, etc -> FOOBAR, BAR, ... which is necessary for an IDE to provide a comprehensive language feature support. Currently I am working around this limitation with a slightly modified local version of valaparser.vala and valascanner.vala (see attached patch for a proof of concept). But would like to avoid those modified copies (cause of code duplication, overhead, maintenance). As the proof of concept shows it would be enough to provide a list of all defines by source file (and not by complete CodeContext - which also would be ok).
Created attachment 239783 [details] [review] Proof of concept (fixed) (12+) With the first patch removing of used defines was not supported. With a defines list by source file (currently hash keys are strings: SourceFile.filename) removal is now possible.
used_defines in the parser is unused, right?
Yes, but libraries/apps using the Parser to update a source file will profit.
Another approach to avoid extending libvala with an unused list is to use lots of protected virtual members.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/366.