public TableFieldTypeInformation(FieldSyntax fieldSyntax) : this(fieldSyntax.GetNameStringValue()) { PropertyValueSyntax propValue = fieldSyntax.GetPropertyValue("Caption"); if (propValue != null) { this.Caption = ALSyntaxHelper.DecodeString(propValue.ToString()); } this.DataType = fieldSyntax.Type.ToString(); }
protected bool ProcessSyntaxNodeAttribute(SyntaxTree syntaxTree, ALSymbolInformation parent, SyntaxNode node) { switch (node.Kind.ConvertToLocalType()) { case ConvertedSyntaxKind.PropertyList: bool hasProperties = this.ProcessSyntaxNodePropertyList(syntaxTree, parent, node); return(!this.IncludeProperties); // || (!hasProperties); case ConvertedSyntaxKind.SimpleTypeReference: case ConvertedSyntaxKind.RecordTypeReference: case ConvertedSyntaxKind.DotNetTypeReference: parent.subtype = node.ToFullString(); parent.elementsubtype = node.GetType().TryGetPropertyValueAsString(node, "DataType"); if (String.IsNullOrWhiteSpace(parent.elementsubtype)) { parent.elementsubtype = parent.subtype; } return(true); case ConvertedSyntaxKind.MemberAttribute: string memberAttributeName = node.GetSyntaxNodeName().NotNull(); if ((parent.kind == ALSymbolKind.MethodDeclaration) || (parent.kind == ALSymbolKind.LocalMethodDeclaration)) { ALSymbolKind newKind = ALSyntaxHelper.MemberAttributeToMethodKind(memberAttributeName); if (newKind != ALSymbolKind.Undefined) { parent.kind = newKind; return(true); } } parent.subtype = memberAttributeName; return(true); case ConvertedSyntaxKind.ObjectId: ObjectIdSyntax objectIdSyntax = (ObjectIdSyntax)node; if ((objectIdSyntax.Value != null) && (objectIdSyntax.Value.Value != null)) { parent.id = (int)objectIdSyntax.Value.Value; } return(true); case ConvertedSyntaxKind.IdentifierName: var lineSpan = syntaxTree.GetLineSpan(node.Span); parent.selectionRange = new Range(lineSpan.StartLinePosition.Line, lineSpan.StartLinePosition.Character, lineSpan.EndLinePosition.Line, lineSpan.EndLinePosition.Character); return(true); case ConvertedSyntaxKind.VariableListDeclaration: //safe call as variable list declaration nodes are not supported by Nav2018 this.SafeProcessVariableListDeclarationNode(syntaxTree, parent, node); return(true); } return(false); }
protected void ProcessEnumValueNode(ALSymbolInformation symbol, EnumValueSyntax syntax) { string idText = syntax.Id.ToString(); if (!String.IsNullOrWhiteSpace(idText)) { int id; if (Int32.TryParse(idText, out id)) { symbol.id = id; } } symbol.fullName = ALSyntaxHelper.EncodeName(symbol.name); // + ": " + syntax.EnumValueToken.ToFullString(); }