rubberduck-vba / Rubberduck

Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).
https://rubberduckvba.com
GNU General Public License v3.0
1.91k stars 299 forks source link

Create HostApplicationModel in resources for storing stringified metadata #4628

Open bclothier opened 5 years ago

bclothier commented 5 years ago

Originally from the discussion:

https://github.com/rubberduck-vba/Rubberduck/pull/4601#discussion_r240046688

It seems that with upcoming PR #4601, we will need metadata about host applications in multiple places in different projects.

Though we already have a IHostApplication, this is a SCW, and we don't really need one just to get the file name, the allowable list of extensions and other stringified metadata that should be kept uniform for all potential consumers. Thus, the idea is that we create a dumb POCO model that provides all the metadata and update the consumers to use that instead of hard-coding those metadata about host applications.

bclothier commented 5 years ago

Ref #2799 and #4784

The bugfix introduces a HostAutoMacro struct that provides a description of signatures that different hosts may treat specially. It is still attached to a IHostApplication, however. It is known that the rename refactoring has some code that checks the auto_ naming. There may be other similar check scattered in the RD codebase which should be consolidated.

The original reasoning behind attaching the structs to the IHostApplication was to remove the need to determine the host application using stringified name or something like that. Further thoughts may be needed to better architecture this, considering that the data in the HostAutoMacro don't require any SCWs.