sancarn / stdVBA

VBA Standard Library - A Collection of libraries to form a common standard layer for modern VBA applications.
MIT License
295 stars 60 forks source link

VB6 vs VBA classes #78

Closed DecimalTurn closed 1 year ago

DecimalTurn commented 1 year ago

There is currently about 20% of the code detected as VB6.

image

That is because these 5 classes have the Persistable metadata key at the top of the file[^1]:

Normally, for VBA classes, this metadata is absent and we simply have:

BEGIN
  MultiUse = -1  'True
END

I'd suggest to standardize the metadata section accross all classes since the extra metadata is ignored by VBA anyway.

[^1]: This detection rule comes from this regex in github-linguist: https://github.com/github-linguist/linguist/blob/7ca3799b8b5f1acde1dd7a8dfb7ae849d3dfb4cd/lib/linguist/heuristics.yml#L156C7-L156C7

sancarn commented 1 year ago

Thanks @DecimalTurn for another great issue. Agreed.

Many of the above classes are likely in need of removal also as they are mostly legacy ideas which are just copies of existing classes from VB6 at present. Unsure if they are adding unnecessary clutter.

sancarn commented 1 year ago

Looking now it is mostly bas modules not sure if there is a method to get these to show up properly?

DecimalTurn commented 1 year ago

@sancarn There is a way if you want to make it all VBA. For modules, there are a few regexes that can make the file detected as VBA but the easiest is to have simply "VBA" appear somewhere in the code. Hence, a simple comment at the top like this would be enough:

'Lang: VBA