[WS] New feature [Include]

Some time now Mp3Tag introduced the [Include]=... command.
One example is official Discogs.src.
[SearchBy]=Album||%album%||&release_title=%s
[Include]=Discogs.inc
So, I build a long myInclude.inc file intended to be reused in many WS and added it to each src file ([Include]=myInclude.inc).
It did not work.
Some people would expect [Include]=file.inc command would act as copy/pasting the file.inc content in the main WS src file.

[ParserScriptIndex]=...
#
... code ...
[Include]=Include1.inc
... more code ...
[Include]=Include2.inc
... even more code ...
[Include]=Include3.inc
... other code...

[ParserScriptAlbum]=...
... code ...
[Include]=Include4.inc
... more code ...
[Include]=Include5.inc
... even more code ...
[Include]=Include6.inc
... other code...

I am not blaming existing feature, just probably have wrong expectation.

1 Like

It works only at the top-level, i.e., you can't include from within [ParserScriptIndex], [ParserScriptAlbum] or other [Include].

I can see how this might be helpful in reusing snippets and reducing boilerplate. However, it also increases complexity even further and creates new challenges in debugging.

That said, it's not planned for now.