Inheritance: AbstractTreeNode
Ejemplo n.º 1
0
        /// <summary>
        /// Adds any types and namespaces, imported at the start of the document, to the declarations.
        /// </summary>
        private void AddImports(IntellisenseDeclarations declarations, DocumentTreeNode document)
        {
            // add imports to declarations
            foreach (var importNamespace in document.Imports.Keys)
            {
                ImportedNamespaceTreeNode importedNodes = document.Imports[importNamespace];

                foreach (var member in importedNodes.SourceOrigin.GetMembers(false))
                {
                    declarations.Add(member.ToTreeNode());
                }

                declarations.Add(importedNodes);
            }
        }
Ejemplo n.º 2
0
        public override bool EnterModule(Module node)
        {
            var document = new DocumentTreeNode(new EntitySourceOrigin(GetEntity(node)), node.LexicalInfo.FileName);

            Push(document, 0);
            currentDocument = document;

            return base.EnterModule(node);
        }
Ejemplo n.º 3
0
        public override void LeaveModule(Module node)
        {
            base.LeaveModule(node);

            // todo: de-nasty this
            var linesInFile = -1;

            if (node.LexicalInfo.FileName != null)
                linesInFile = File.ReadAllLines(node.LexicalInfo.FileName).Length;

            Pop(linesInFile);
            currentDocument = null;
        }