/// <summary>
        /// Find Natvis visualizer by variable.
        /// </summary>
        public VisualizerInfo FindType(IVariableInformation variable)
        {
            // Check for custom visualizers first.
            if (variable.CustomVisualizer != CustomVisualizer.None)
            {
                // Custom visualizers are keyed by pseudo-types "$" + CustomVisualizer enum name.
                string pseudoTypeName = "$" + variable.CustomVisualizer;

                VisualizerInfo visualizer;
                if (_visualizerCache.TryGetValue(pseudoTypeName, out visualizer))
                {
                    _logger.Verbose(() => $"Selected cached custom Natvis Visualizer " +
                                    $"'{visualizer?.Visualizer.Name ?? "null"} '" +
                                    $"for custom visualizer '{variable.CustomVisualizer}'");

                    return(visualizer);
                }

                visualizer = Scan(pseudoTypeName, TypeName.Parse(pseudoTypeName));
                if (visualizer != null)
                {
                    _logger.Verbose(() => $"Selected Natvis Visualizer " +
                                    $"'{visualizer.Visualizer.Name}'" +
                                    $" for custom visualizer '{variable.CustomVisualizer}'");

                    return(visualizer);
                }
            }

            string initialTypeName = variable.TypeName;

            _logger.Verbose($"Finding Natvis Visualizer for type '{initialTypeName}'");
            if (_visualizerCache.ContainsKey(initialTypeName))
            {
                VisualizerInfo visualizer = _visualizerCache[variable.TypeName];
                _logger.Verbose(() => $"Selected cached Natvis Visualizer " +
                                $"'{visualizer?.Visualizer.Name ?? "null"}' for type " +
                                $"'{initialTypeName}'");

                return(visualizer);
            }

            uint count = 0;

            foreach (string typeName in variable.GetAllInheritedTypes())
            {
                var parsedName = TypeName.Parse(typeName);
                if (parsedName == null)
                {
                    break;
                }

                _logger.Verbose(
                    () => $"Scanning for Natvis Visualizer for type '{parsedName.BaseName}' for " +
                    $"variable of type '{initialTypeName}'");

                VisualizerInfo visualizer = Scan(initialTypeName, parsedName);

                if (visualizer != null)
                {
                    _logger.Verbose(
                        () => $"Selected Natvis Visualizer '{visualizer.Visualizer.Name}'" +
                        $" for type '{initialTypeName}'");

                    return(visualizer);
                }

                ++count;

                // Safety check to make sure we don't get in to an expensive loop.
                if (count > _maxInheritedTypes)
                {
                    _logger.Warning($"The '{initialTypeName}' type exceeds the" +
                                    $" maximum number ({_maxInheritedTypes}) of searchable base " +
                                    $"classes.");

                    break;
                }
            }

            _logger.Verbose($"No Natvis Visualizer found for type '{initialTypeName}'");
            return(null);
        }