protected override void Analyze(IAttribute element, ElementProblemAnalyzerData data, IHighlightingConsumer consumer) { var arguments = element.Arguments; var argument = UnityShortcutCache.GetArgument(0, "itemName", arguments); var name = argument?.Value?.ConstantValue.Value as string; if (name == null) { return; } var shortcut = UnityShortcutCache.ExtractShortcutFromName(name); if (shortcut == null) { return; } if (myCache.GetCount(shortcut) > 1) { var files = myCache.GetSourceFileWithShortCut(shortcut); var sourceFile = element.GetSourceFile(); var anotherFile = files.FirstOrDefault(t => t != sourceFile); if (anotherFile == null) { consumer.AddHighlighting(new DuplicateShortcutWarning(argument, "this file")); } else { consumer.AddHighlighting(new DuplicateShortcutWarning(argument, anotherFile.Name)); } } }