/// <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); } }
/// <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)); }
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(); }
private void AddSpecialTypes(IntellisenseDeclarations declarations) { ISourceOrigin origin = new TypeSourceOrigin(typeof(string)); declarations.Add(origin.ToTreeNode()); }