コード例 #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);
            }
        }
コード例 #2
0
        /// <summary>
        /// Adds keywords based on the current scope to the declarations.
        /// </summary>
        private void AddKeywords(IntellisenseDeclarations declarations, IBooParseTreeNode scopedParseTree)
        {
            var keywords = new TypeKeywordResolver();

            declarations.Add(keywords.GetForScope(scopedParseTree));
        }
コード例 #3
0
        private void AddMemberLookupDeclarations(IntellisenseDeclarations declarations, string lineSource, int line)
        {
            var members = GetMembersFromCurrentScope(line, lineSource);

            members.ForEach(e =>
            {
                IBooParseTreeNode node = e.ToTreeNode();

                if (node != null)
                    declarations.Add(node);
            });

            declarations.Sort();
        }
コード例 #4
0
        private void AddSpecialTypes(IntellisenseDeclarations declarations)
        {
            ISourceOrigin origin = new TypeSourceOrigin(typeof(string));

            declarations.Add(origin.ToTreeNode());
        }