/// <summary> /// Gets the formatted text to display in quick info for the specified function call /// </summary> private string GetQuickInfoForFunctionCall(LuatValue func, int parameterIndex) { var functionType = func.Type as LuatTypeFunction; var sb = new StringBuilder(); sb.Append("<img src=\"resource:PublicMethod\" align=\"absbottom\"/> "); sb.Append("<span style=\"color: blue;\">function</span> "); // sb.Append(String.Format("<span style=\"color: teal;\">{0}</span>", IntelliPrompt.EscapeMarkupText(functionDeclaration.Name.Text))); sb.Append("("); string[] parameters = functionType == null ? new string[0] : functionType.Arguments; for (int index = 0; index < parameters.Length; index++) { if (index > 0) { sb.Append(", "); } if (parameterIndex == index) { sb.Append("<b>"); } sb.Append(IntelliPrompt.EscapeMarkupText(parameters[index])); if (parameterIndex == index) { sb.Append("</b>"); } } sb.Append(")<br/>"); sb.Append(FormatText(func.Description)); return(sb.ToString()); }
public LuatVariable CreateReflectedVariable(string strTypeName, LuatValue parent) { foreach (ReflectedTypeResolver resolver in m_reflectedTypeResolvers) { LuatVariable variable; if (resolver(strTypeName, parent, out variable)) { return(variable); } } return(new LuatVariable(parent, new LuatTypeReflected(strTypeName), LuatVariableFlags.FixedType)); }
// Attempts to index the given variable by examining the assigned values public override LuatValue Index(string index, bool bAssignment, ref HashSet <LuatValue> visited) { visited.Add(this); foreach (LuatValue value in ValueAssignments) { if (visited.Contains(value)) { continue; } LuatValue var = value.Index(index, bAssignment, ref visited); if (null != var) { return(var); } } return(null); }
// Removes an item from the table by value public void RemoveChild(LuatValue value) { var names = new List <string>(); foreach (KeyValuePair <string, LuatValue> child in m_children) { if (child.Value == value) { names.Add(child.Key); } } if (names.Count == 0) { throw new Exception("Child not found"); } foreach (string name in names) { m_children.Remove(name); } }
public AutoCompleteItem(string name, LuatValue value) { Name = name; Description = value.Description; Icon = value.Type.Icon; }
public void AddAlias(string name, LuatValue value) { Metatable.CreateIndex(); Metatable.Index.AddChild(name, value); }
public LuatTable(LuatValue parent) : base(parent) { }
public LuatVariable(LuatValue parent, LuatType type, LuatVariableFlags flags) : base(parent) { m_flags = flags; m_type = type; }
public LuatVariable(LuatValue parent, LuatVariableFlags flags) : base(parent) { m_flags = flags; }
public LuatFunction(LuatValue returnValue, string[] arguments) : base(null) { m_type = new LuatTypeFunction(arguments); ReturnValue = returnValue; }
protected LuatValue(LuatValue parent) { Parent = parent; }