public override string GetDescription(int index) { string description = string.Empty; NVIdNode idNode = _declarations[index].IdNode; if (idNode is NVClassNode) { NVClassNode classNode = (NVClassNode)idNode; XmlDocumentationProvider documentationProvider = new XmlDocumentationProvider(classNode.AssemblyFileName); string classSummary = documentationProvider.GetTypeDocumentation(classNode.FullName); if (!string.IsNullOrEmpty(classSummary)) { description = string.Format("class {0}\n{1}", classNode.FullName, classSummary); } else { description = string.Format("class {0}", classNode.FullName); } } else if (idNode is NVLocalNode) { NVClassNode classNode = (NVClassNode)idNode.Type; if (classNode != null) { XmlDocumentationProvider documentationProvider = new XmlDocumentationProvider(classNode.AssemblyFileName); description = documentationProvider.GetTypeDocumentation(classNode.FullName); } } else if (idNode is NVMethodNode) { NVClassNode classNode = (NVClassNode)((NVMethodNode)idNode).Parent; if (classNode != null) { XmlDocumentationProvider documentationProvider = new XmlDocumentationProvider(classNode.AssemblyFileName); description = documentationProvider.GetMethodDocumentation(classNode.FullName, idNode.Name); } } // Return the documentation or an error message if (!string.IsNullOrEmpty(description)) { return(description); } return(string.Format("Could not retrieve documentation for AST node '{0}' (because it is not supported).", idNode != null ? idNode.GetType().Name : "")); }
public NVelocityDeclaration(string name, NVIdNode idNode, IntelliSenseIcon icon) { _name = name; _idNode = idNode; _icon = icon; }
public NVTypeNode DoSemanticChecks(ErrorHandler errs, Scope currentScope, NVTypeNode currentType) { currentType = ResolveNamedTypeNodes(errs, currentScope, currentType); // Check to see if the current node is an empty placeholder selector if (_id.Name == "") { return currentType; } if (currentType == null) { //TODO: Uncomment this when support for objects passed through the property bag is much better //AddSemanticError(errs, "Type of identifier unknown", _pos, ErrorSeverity.Warning); return null; } if (!(currentType is NVClassNode)) { AddSemanticError(errs, string.Format( "Cannot apply identifier selector to type '{0}', the type must be a class type", currentType.Name), _pos, ErrorSeverity.Warning); return currentType; } // Check if the member exists _id = ((NVClassNode)currentType).FindMember(errs, _pos, _id.Name); if (_id == null) { return currentType; } _id.Type = ResolveNamedTypeNodes(errs, currentScope, _id.Type); _type = _id.Type; return _type; }
public NVSelector(NVIdNode id, NVReference nvReference) { _id = id; _nvReference = nvReference; }
/// <summary> /// Adds an identifier to the current scope. /// </summary> public void Add(NVIdNode id) { _scope.Add(id.Name, id); }