Esempio n. 1
0
        /// <summary>
        /// Visits enums and adds script enums to the package
        /// </summary>
        /// <param name="node">The node</param>
        public override void VisitEnumDeclaration(EnumDeclarationSyntax node)
        {
            INamedTypeSymbol namedType       = Compilation.GetSemanticModel(node.SyntaxTree).GetDeclaredSymbol(node);
            RoslynNamedType  namedTypeResult = RoslynType.CreateNamedType(
                namedType,
                new ParseContext(Compilation, new SourceCommentsDocumentationProvider(), _options)
                );

            _visitor.Visit(namedTypeResult);
        }
        /// <summary>
        /// Trys to add a type declaration node to the extract depending on whether it has
        /// the <see cref="ScriptObjectAttribute"/>
        /// </summary>
        /// <param name="node">The type declaration node</param>
        private void TryAddTypeDeclaration(TypeDeclarationSyntax node)
        {
            INamedTypeSymbol namedType = Compilation.GetSemanticModel(node.SyntaxTree).GetDeclaredSymbol(node);

            RoslynNamedType namedTypeResult = RoslynType.CreateNamedType(
                namedType,
                new ParseContext(Compilation, new SourceCommentsDocumentationProvider())
                );

            _visitor.Visit(namedTypeResult);
        }