Exemplo n.º 1
0
        protected override void DoRun(IT4AttributeValue element, IHighlightingConsumer consumer)
        {
            var attribute = DirectiveAttributeNavigator.GetByValue(element);

            if (!(DirectiveNavigator.GetByAttribute(attribute) is IT4AssemblyDirective assemblyDirective))
            {
                return;
            }
            var path = AssemblyReferenceResolver.Resolve(assemblyDirective);

            if (path != null)
            {
                if (ProjectReferenceResolver.TryResolveProject(path) != null)
                {
                    return;
                }
                if (path.ExistsFile)
                {
                    return;
                }
            }

            var pathNode = assemblyDirective.GetAttributeValueToken(T4DirectiveInfoManager.Assembly.NameAttribute.Name);

            if (pathNode == null)
            {
                return;
            }
            consumer.AddHighlighting(new UnresolvedAssemblyError(pathNode));
        }
Exemplo n.º 2
0
        protected override void DoRun(IT4AttributeValue element, IHighlightingConsumer consumer)
        {
            var attribute = DirectiveAttributeNavigator.GetByValue(element);

            if (!(DirectiveNavigator.GetByAttribute(attribute) is IT4AssemblyDirective assemblyDirective))
            {
                return;
            }
            var project = ProjectReferenceResolver.TryResolveProject(assemblyDirective.Path.ResolvePath());

            if (project != null)
            {
                return;
            }
            var path = AssemblyReferenceResolver.Resolve(assemblyDirective);

            if (path != null && path.ExistsFile)
            {
                return;
            }
            consumer.AddHighlighting(new UnresolvedAssemblyWarning(assemblyDirective.Name));
        }