private DisplayText GetDisplayTextForScript(ScriptSymbol symbol) { var sb = new StringBuilder(); var scriptType = symbol.GetPapyrusType(); sb.Append($"Scriptname {scriptType?.Name.FullyQualifiedDisplayName ?? symbol.Name}"); if (symbol.ExtendedScript != null) { var extendedType = symbol.ExtendedScript.GetPapyrusType(); sb.Append(" extends " + extendedType?.Name.FullyQualifiedDisplayName ?? symbol.ExtendedScript.Name); } if (symbol.Flags != LanguageFlags.None) { sb.Append(" "); sb.Append(symbol.Flags.ToString().Replace(",", string.Empty)); } return(new DisplayText() { Kind = "script", Text = sb.ToString(), Documentation = symbol.GetDocumentationMarkdown() }); }
public override PapyrusSymbol VisitScript(ScriptNode node, PapyrusSymbol parent) { var script = new ScriptSymbol(node); if (!script.Definition.ScopedSymbols.ContainsKey("self")) { script.Definition.ScopedSymbols.Add("self", new AliasedSymbol("self", SymbolKinds.Variable, script, null)); } if (script.ExtendedScript != null && !script.Definition.ScopedSymbols.ContainsKey("parent")) { script.Definition.ScopedSymbols.Add("parent", new AliasedSymbol("parent", SymbolKinds.Variable, script.ExtendedScript, null)); } return(script); }