private static void AppendMethodSymbolInfo(this ICollection<SymbolMarkupToken> markup, MethodSymbol symbol) { markup.AppendType(symbol.AssociatedType); markup.AppendSpace(); markup.AppendName(SymbolMarkupKind.MethodName, symbol.Name); markup.AppendParameters(symbol.Parameters); }
private static void AppendFunctionSymbolInfo(this ICollection<SymbolMarkupToken> markup, FunctionSymbol symbol) { markup.AppendType(symbol.ValueType); markup.AppendSpace(); markup.AppendName(SymbolMarkupKind.FunctionName, symbol.Name); markup.AppendParameters(symbol.Parameters); }
private static void AppendFunctionSymbolInfo(this ICollection<SymbolMarkupToken> markup, FunctionSymbol symbol) { markup.AppendType(symbol.ReturnType, false); markup.AppendSpace(); if (symbol.Parent is TypeSymbol) { markup.AppendTypeName((TypeSymbol) symbol.Parent); markup.AppendPunctuation("."); } if (symbol.IsNumericConstructor) markup.AppendKeyword(symbol.Name); else markup.AppendName(SymbolMarkupKind.FunctionName, symbol.Name); markup.AppendParameters(symbol.Parameters); }
private static void AppendParameters(this ICollection<SymbolMarkupToken> markup, ImmutableArray<ParameterSymbol> parameters) { markup.AppendPunctuation("("); var isFirst = true; foreach (var parameterSymbol in parameters) { if (isFirst) isFirst = false; else { markup.AppendPunctuation(","); markup.AppendSpace(); } markup.AppendParameterSymbolInfo(parameterSymbol); } markup.AppendPunctuation(")"); }
private static void AppendParameterSymbolInfo(this ICollection<SymbolMarkupToken> markup, ParameterSymbol symbol) { markup.AppendType(symbol.ValueType); markup.AppendSpace(); markup.AppendParameterName(symbol.Name); }
private static void AppendNamespace(this ICollection<SymbolMarkupToken> markup, NamespaceSymbol symbol) { markup.AppendKeyword("namespace"); markup.AppendSpace(); if (symbol.Parent != null) markup.AppendParentScope(symbol.Parent); markup.AppendName(SymbolMarkupKind.NamespaceName, symbol.Name); }
private static void AppendTypeAlias(this ICollection<SymbolMarkupToken> markup, TypeAliasSymbol symbol) { markup.AppendKeyword("typedef"); markup.AppendSpace(); markup.AppendType(symbol.ValueType, true); markup.AppendSpace(); markup.AppendName(SymbolMarkupKind.GlobalVariableName, symbol.Name); }
private static void AppendTechnique(this ICollection<SymbolMarkupToken> markup, TechniqueSymbol symbol) { markup.AppendKeyword("technique"); markup.AppendSpace(); markup.AppendName(SymbolMarkupKind.TechniqueName, symbol.Name); }
private static void AppendConstantBuffer(this ICollection<SymbolMarkupToken> markup, ConstantBufferSymbol symbol) { markup.AppendPlainText("(constant buffer)"); markup.AppendSpace(); markup.AppendName(SymbolMarkupKind.ConstantBufferVariableName, symbol.Name); }
private static void AppendSemantic(this ICollection<SymbolMarkupToken> markup, SemanticSymbol symbol) { markup.AppendPlainText("(semantic)"); markup.AppendSpace(); markup.AppendName(SymbolMarkupKind.SemanticName, symbol.Name); }
private static void AppendTypeDeclaration(this ICollection<SymbolMarkupToken> markup, TypeSymbol symbol) { switch (symbol.Kind) { case SymbolKind.Class: markup.AppendKeyword("class"); markup.AppendSpace(); break; case SymbolKind.Interface: markup.AppendKeyword("interface"); markup.AppendSpace(); break; case SymbolKind.Struct: markup.AppendKeyword("struct"); markup.AppendSpace(); break; } if (symbol.Parent != null) markup.AppendParentScope(symbol.Parent); markup.AppendTypeName(symbol); }
private static void AppendVariableSymbolInfo(this ICollection<SymbolMarkupToken> markup, VariableSymbol symbol) { VariableType variableType; if (symbol.Parent == null) variableType = VariableType.Global; else if (symbol.Parent.Kind == SymbolKind.ConstantBuffer) variableType = VariableType.ConstantBuffer; else variableType = VariableType.Local; switch (variableType) { case VariableType.Local: markup.AppendPlainText("(local variable)"); break; case VariableType.ConstantBuffer: markup.AppendPlainText("(constant buffer variable)"); break; case VariableType.Global: markup.AppendPlainText("(global variable)"); break; default: throw new ArgumentOutOfRangeException(); } markup.AppendSpace(); markup.AppendType(symbol.ValueType, true); markup.AppendSpace(); switch (variableType) { case VariableType.Local: markup.AppendName(SymbolMarkupKind.LocalVariableName, symbol.Name); break; case VariableType.ConstantBuffer: markup.AppendName(SymbolMarkupKind.ConstantBufferVariableName, symbol.Name); break; case VariableType.Global: markup.AppendName(SymbolMarkupKind.GlobalVariableName, symbol.Name); break; default: throw new ArgumentOutOfRangeException(); } }
private static void AppendFieldSymbolInfo(this ICollection<SymbolMarkupToken> markup, FieldSymbol symbol) { markup.AppendPlainText("(field)"); markup.AppendSpace(); markup.AppendType(symbol.ValueType, true); markup.AppendSpace(); markup.AppendType((TypeSymbol) symbol.Parent, false); markup.AppendPunctuation("."); markup.AppendName(SymbolMarkupKind.FieldName, symbol.Name); }
private static void AppendParameterSymbolInfo(this ICollection<SymbolMarkupToken> markup, ParameterSymbol symbol, bool includeInfo) { if (includeInfo) { markup.AppendPlainText("(parameter)"); markup.AppendSpace(); } if (symbol.Direction == ParameterDirection.Inout) { markup.AppendKeyword("inout"); markup.AppendSpace(); } else if (symbol.Direction == ParameterDirection.Out) { markup.AppendKeyword("out"); markup.AppendSpace(); } markup.AppendType(symbol.ValueType, false); markup.AppendSpace(); markup.AppendParameterName(symbol.Name); }