public override void Call(ParseInfo parseInfo, DocRange callRange) { MarkupBuilder hoverContents = new MarkupBuilder() .StartCodeLine() .Add((_constant ? "constant " : "enum ") + Name) .EndCodeLine(); if (_constant) { hoverContents.NewSection().Add("Constant workshop types cannot be stored. Variables with this type cannot be changed from their initial value."); } parseInfo.Script.AddHover(callRange, hoverContents.ToString()); parseInfo.Script.AddToken(callRange, TokenType, TokenModifiers.ToArray()); }
/// <summary>Calls a type from the specified document range.</summary> /// <param name="parseInfo">The script that the type was called from.</param> /// <param name="callRange">The range of the call.</param> public virtual void Call(ParseInfo parseInfo, DocRange callRange) { parseInfo.Script.AddToken(callRange, TokenType, TokenModifiers.ToArray()); var hover = new MarkupBuilder().StartCodeLine().Add(Kind.ToString().ToLower() + " " + Name); if (Generics.Length != 0) { hover.Add("<" + string.Join(", ", Generics.Select(g => g.GetName())) + ">"); } hover.EndCodeLine(); if (Description != null) { hover.NewSection().Add(Description); } parseInfo.Script.AddHover(callRange, hover); }
/// <summary>Calls a type from the specified document range.</summary> /// <param name="parseInfo">The script that the type was called from.</param> /// <param name="callRange">The range of the call.</param> public virtual void Call(ParseInfo parseInfo, DocRange callRange) { parseInfo.TranslateInfo.Types.CallType(this); parseInfo.Script.AddHover(callRange, HoverHandler.Sectioned(Kind + " " + Name, Description)); parseInfo.Script.AddToken(callRange, TokenType, TokenModifiers.ToArray()); }