Don't complain about re-usable terms not getting referenced.

This commit is contained in:
Matthias Mailänder
2022-07-03 09:50:38 +02:00
committed by teinarss
parent 2c8c6e50da
commit 8201a57b10

View File

@@ -61,8 +61,11 @@ namespace OpenRA.Mods.Common.Lint
foreach (var entry in result.Entries)
{
if (!referencedKeys.Contains(entry.GetId()))
emitWarning($"Unused key `{entry.GetId()}` in {file}.");
// Don't flag definitions referenced (only) within the .ftl definitions as unused
var isReusableTerm = entry.GetType() == typeof(AstTerm);
var key = entry.GetId();
if (!referencedKeys.Contains(key) && !isReusableTerm)
emitWarning($"Unused key `{key}` in {file}.");
variableReferences.Clear();
if (entry is AstMessage message)