コード例 #1
0
        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());
        }
コード例 #2
0
        public override void Call(ScriptFile script, DocRange callRange)
        {
            MarkupBuilder hoverContents = new MarkupBuilder();

            if (Constant() == TypeSettable.Convertable)
            {
                hoverContents
                .StartCodeLine()
                .Add("enum " + Name)
                .EndCodeLine();
            }
            else if (Constant() == TypeSettable.Constant)
            {
                hoverContents
                .StartCodeLine()
                .Add("constant " + Name)
                .EndCodeLine()
                .NewSection()
                .Add("Constant workshop types cannot be stored. Variables with this type cannot be changed from their initial value.");
            }

            script.AddHover(callRange, hoverContents.ToString());
        }