private void AnalyzeNamespaceDeclaration(IModuleDeclaration source) { // Namespace name could be chained together in a form of 'namespace A.B' // in this case we need to get full name, not just source.Name.Text string fullName = string.Join(".", source.GetFullName()); AddOrCreateDeclarationSymbol(SymbolKind.NamespaceDeclaration, fullName); using (m_currentLocationStack.AutoPush(fullName)) { AnalyzeDeclarationStatements(source.GetModuleBlock().Statements); } }
/// <nodoc/> public static IEnumerable <SymbolInformation> GetModuleDeclarationChildren(IModuleDeclaration moduleDeclaration, Uri uri) { // dive into the module, grab the full namespace name and list all the exported variables var namespacePrefix = moduleDeclaration.GetFullNameString() + "."; return(moduleDeclaration.GetModuleBlock().GetChildNodes() .Where(childNode => childNode.IsTopLevelOrNamespaceLevelDeclaration()) .Where(childNode => !childNode.IsInjectedForDScript()) .Select(childNode => new SymbolInformation() { Name = namespacePrefix + GetIdentifierForNode(childNode), Kind = GetSymbolKind(childNode), Location = new Location() { Uri = uri, Range = childNode.ToRange(), }, })); }