Documentation
¶
Index ¶
- func ClassName(class proto.Class) string
- func ClassNamed(short string) (proto.Class, bool)
- func ConstSeconds(val string) (float64, bool)
- func Format(path string, src []byte, names *Names, open Opener) ([]byte, error)
- func Identifier(s string) string
- func IsTalentSpell(id int32) bool
- func LLMText() (string, error)
- func LoadBuild(s, b *proto.IndividualSimSettings)
- func Normalize(m googleProto.Message, names *Names, spec proto.Spec) googleProto.Message
- func ParseRequest(req *proto.SimlParseRequest, names *Names) (result *proto.SimlParseResult)
- func Print(kind Kind, spec proto.Spec, s *proto.IndividualSimSettings, ...) []byte
- func PrintRequest(req *proto.SimlPrintRequest, names *Names) (result *proto.SimlPrintResult)
- func ReadSource(path string) ([]byte, error)
- func RepositoryRoot(file string) (string, bool)
- func Reserved(word string) bool
- func SamePath(a, b string) bool
- func SettingsOf(m googleProto.Message) *proto.IndividualSimSettings
- func TokenModifiers() []string
- func TokenTypes() []string
- func UnderSpecs(path string) bool
- type AplEdit
- type BlockRow
- type CatalogConsumable
- type CatalogEnchant
- type CatalogItem
- type CatalogSuffix
- type Completion
- type CompletionKind
- type DatabaseCatalog
- func (c *DatabaseCatalog) Consumables() []CatalogConsumable
- func (c *DatabaseCatalog) EnchantRows(effectID int32) []CatalogEnchant
- func (c *DatabaseCatalog) Item(id int32) (CatalogItem, bool)
- func (c *DatabaseCatalog) ItemIcons() map[int32][2]string
- func (c *DatabaseCatalog) ItemName(id int32) (string, bool)
- func (c *DatabaseCatalog) Items() []CatalogItem
- func (c *DatabaseCatalog) SpellIcons() map[int32][2]string
- func (c *DatabaseCatalog) SpellName(spellID int32) (string, bool)
- func (c *DatabaseCatalog) Suffix(id int32) (CatalogSuffix, bool)
- func (c *DatabaseCatalog) Suffixes(itemID int32) []int32
- type DefCall
- type DefInfo
- type Diagnostic
- type Diagnostics
- type Doc
- func (d *Doc) Complete(at Position, c *DatabaseCatalog) []Completion
- func (d *Doc) Definition(at Position) []Location
- func (d *Doc) Diagnostics() Diagnostics
- func (d *Doc) EditorDiagnostics(c *DatabaseCatalog) Diagnostics
- func (d *Doc) File() (*File, error)
- func (d *Doc) Folds() []Fold
- func (d *Doc) Hover(at Position, c *DatabaseCatalog) (Hover, bool)
- func (d *Doc) Kind() Kind
- func (d *Doc) Links() []Link
- func (d *Doc) Offset(p Position) int
- func (d *Doc) Path() string
- func (d *Doc) PathAt(p Position) []any
- func (d *Doc) Position(offset int) Position
- func (d *Doc) PrepareRename(at Position) (Range, string, error)
- func (d *Doc) QuickFixes(r Range) []Fix
- func (d *Doc) References(at Position, includeDeclaration bool) []Location
- func (d *Doc) Refs() []NameRef
- func (d *Doc) Rename(at Position, newName string) ([]FileEdits, error)
- func (d *Doc) RotationJSON() json.RawMessage
- func (d *Doc) SpanFor(path []any) (Range, bool)
- func (d *Doc) Spans() []PathSpan
- func (d *Doc) Splice(edits []AplEdit) ([]TextEdit, error)
- func (d *Doc) Structure() *Structure
- func (d *Doc) Symbols() []Symbol
- func (d *Doc) Text() string
- func (d *Doc) Tokens() []Token
- type EnchantName
- type File
- type FileEdits
- type FileStamp
- type Finding
- type Fix
- type Fold
- type Hover
- type Kind
- type Link
- type Location
- type NameRef
- type NamedEntry
- type Names
- func (t *Names) Enchant(name string) (int32, bool)
- func (t *Names) EnchantName(effectID int32, slot proto.ItemSlot) (string, bool)
- func (t *Names) Encode() []byte
- func (t *Names) Holding(class proto.Class, name string) []Namespace
- func (t *Names) Item(name string) (int32, bool)
- func (t *Names) ItemName(id int32) (string, bool)
- func (t *Names) Registered(class proto.Class, spec string, ns Namespace) []NamedEntry
- func (t *Names) Spell(class proto.Class, ns Namespace, name string) (*proto.ActionID, bool)
- func (t *Names) SpellName(class proto.Class, ns Namespace, id *proto.ActionID) (string, bool)
- func (t *Names) Suffix(name string) (int32, bool)
- func (t *Names) SuffixName(id int32) (string, bool)
- func (t *Names) Visible(class proto.Class, ns Namespace) []string
- type NamesFile
- type Namespace
- type Opener
- type PathSpan
- type Position
- type Range
- type RelatedLocation
- type Reread
- type Severity
- type SlotRow
- type SpecInfo
- type SpellName
- type SpellNames
- type Structure
- type Symbol
- type SymbolKind
- type TextEdit
- type Token
- type WhenBlock
- type Words
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClassName ¶
The short name of a class (SPEC.md §8.2), which keys its entries in names.json: warrior.
func ClassNamed ¶
The class whose short name is short (SPEC.md §8.2); false for none and for ClassUnknown.
func ConstSeconds ¶
A const value's number as the sim reads it, a duration in seconds; false when the sim reads it as a string.
func Format ¶
Re-prints src, the text of the file at path, in canonical form, its names read and written with names, and the files its use lines name read through open; with a nil open, it reads the file alone. The error is Diagnostics when the file has an error.
func Identifier ¶
The identifier a game name reads as (SPEC.md §7.6): ASCII letters lowercased and digits kept, ' and ’ dropped, and every run of other characters one _, with none at either end. "Hunter's Mark" is hunters_mark.
func IsTalentSpell ¶
Whether id is a talent's own spell, the one a talent kind reads.
func LoadBuild ¶
func LoadBuild(s, b *proto.IndividualSimSettings)
Loads the settings of a preset build b over s, a spec's defaults, as the site applies a build (applyBuild in ui/features/settings/model/apply_build.ts). Each message b holds replaces s's own, except an Auto rotation, which keeps s's, and a build with no item swap set turns item swap off. An encounter brings the tanks and the target dummies with it, and the healing model when b sets one. When b sets the spec's options it also sets the distance and whether the player stands in front of the target, and the race, professions and timings it does not leave at 0.
func Normalize ¶
func Normalize(m googleProto.Message, names *Names, spec proto.Spec) googleProto.Message
A copy of m normalised as SPEC.md §12.4 compares a proto with the parse of its print: uuid and api_version cleared, the items of an EquipmentSpec or ItemSwap padded to 17, every array an enum indexes padded to its enum's length, an absent one too, spec_rotation_json rewritten as the canonical JSON of the spec's Rotation it holds (an empty string, or one that does not read as the Rotation, as {}, which is what its print reads back as), and the rank cleared of each ActionID whose spell id and tag a name of the spec's class names, since the name reads back with the rank of its entry. The spec is spec, or for SpecUnknown the one IndividualSimSettings sets. It panics if the protos break a rule of SPEC.md §8, as Print does.
func ParseRequest ¶
func ParseRequest(req *proto.SimlParseRequest, names *Names) (result *proto.SimlParseResult)
Reads req.Text as the file at req.Path, with names. Text over the size a file may have is refused.
func Print ¶
func Print(kind Kind, spec proto.Spec, s *proto.IndividualSimSettings, categories []string, names *Names) []byte
Prints s as a file of kind. The spec is spec, or with SpecUnknown the one whose message the player holds. categories are the site's category letters whose sections a full file writes; with nil, it writes every section that holds something. A section file writes its own section. Spells, auras, items, enchants and suffixes are written by their names in names, and as raw JSON where it has none (SPEC.md §7.4). It panics if the protos break a rule of SPEC.md §8, as Specs does.
func PrintRequest ¶
func PrintRequest(req *proto.SimlPrintRequest, names *Names) (result *proto.SimlPrintResult)
Prints req.Settings as a file of req.Section, with names. A print that does not read back as a file of that kind gives no text, and the diagnostics of the read.
func ReadSource ¶
Reads the file at path, which a use line or a command names: a regular file of at most 16 MB. A FIFO or a device is refused unread, since reading one can block forever or never end.
func RepositoryRoot ¶
The repository root above a file: the first folder up that holds sim/siml/names.json.
func Reserved ¶
Whether the generator must not write word as a name: a keyword, head or unit word (SPEC.md §4 note 6).
func SamePath ¶
Whether two paths name one file, whichever separator each is written with, without case on Windows.
func SettingsOf ¶
func SettingsOf(m googleProto.Message) *proto.IndividualSimSettings
The settings a loader's message stands for: an APLRotation as the rotation, an EquipmentSpec as the equipment.
func TokenModifiers ¶
func TokenModifiers() []string
func TokenTypes ¶
func TokenTypes() []string
func UnderSpecs ¶
Whether the file lies under ui/specs of the repository it sits in, where warnings are errors and raw refs are reported (SPEC.md §7.3, §13).
Types ¶
type AplEdit ¶
type AplEdit struct {
Op string `json:"op"` // set, insert, move, wrap, inline, extract, defInsert, defDelete, defSet or defRename.
Path []any `json:"path"` // JSON names and list indices; insert's, move's and wrap's name the list.
Value json.RawMessage `json:"value,omitempty"` // set's new value, where none removes the property or element; insert's element; wrap's condition.
Index int `json:"index,omitempty"` // Where insert puts its element.
From int `json:"from,omitempty"` // The element move takes; the first row wrap puts in a block.
To int `json:"to,omitempty"` // The index the moved element ends at; the last row wrap puts in a block.
Call string `json:"call,omitempty"` // set's def call, written as SIML in place of the value: fits(multi_shot).
Name string `json:"name,omitempty"` // The def that extract, defInsert, defDelete, defSet and defRename write.
Params []string `json:"params,omitempty"` // defInsert's and defSet's parameters.
Text string `json:"text,omitempty"` // defInsert's and defSet's value, as SIML; defRename's new name.
}
An edit the rotation panel asks for, addressed by the JSON path, within the rotation, of what it changes. A path ["whens", id, …] leads into the when block id of Structure: "condition" and the path in it, "hide", or the block itself, which set to none takes apart.
type BlockRow ¶
type BlockRow struct {
Path []any `json:"path"`
Inherited int `json:"inherited"`
Own bool `json:"own"`
}
A row of a when block: how many conjuncts at the start of its condition its blocks join to it, and whether its condition holds conjuncts of its own after them.
type CatalogConsumable ¶
type CatalogConsumable struct {
ID int32
Name string
Type proto.ConsumableType
OnUse bool
}
type CatalogEnchant ¶
type CatalogItem ¶
type CatalogItem struct {
ID int32
Name string
Icon string
Type proto.ItemType
RangedType proto.RangedWeaponType
HandType proto.HandType
WeaponType proto.WeaponType
Quality proto.ItemQuality
Ilvl int32
Phase int32
SetName string
Effects []string // The buff names of its item effects.
OnUse bool // Whether it has a use, which item.<name> casts.
}
type CatalogSuffix ¶
type Completion ¶
type CompletionKind ¶
type CompletionKind int
What a completion offers, numbered as the protocol's CompletionItemKind.
const ( CompletionMethod CompletionKind = 2 CompletionFunction CompletionKind = 3 CompletionField CompletionKind = 5 CompletionVariable CompletionKind = 6 CompletionClass CompletionKind = 7 CompletionModule CompletionKind = 9 CompletionProperty CompletionKind = 10 CompletionValue CompletionKind = 12 CompletionKeyword CompletionKind = 14 CompletionFile CompletionKind = 17 CompletionReference CompletionKind = 18 CompletionEnumMember CompletionKind = 20 CompletionConstant CompletionKind = 21 CompletionTypeParameter CompletionKind = 25 )
type DatabaseCatalog ¶
type DatabaseCatalog struct {
// contains filtered or unexported fields
}
The catalog read from the database files.
func CatalogAt ¶
func CatalogAt(root string) *DatabaseCatalog
The catalog of the repository at root, read again whenever a database file changes on disk.
func ReadCatalog ¶
func ReadCatalog(root string) *DatabaseCatalog
Reads the database files of the repository at root. A file that is missing or does not read is left out.
func (*DatabaseCatalog) Consumables ¶
func (c *DatabaseCatalog) Consumables() []CatalogConsumable
func (*DatabaseCatalog) EnchantRows ¶
func (c *DatabaseCatalog) EnchantRows(effectID int32) []CatalogEnchant
func (*DatabaseCatalog) Item ¶
func (c *DatabaseCatalog) Item(id int32) (CatalogItem, bool)
func (*DatabaseCatalog) ItemIcons ¶
func (c *DatabaseCatalog) ItemIcons() map[int32][2]string
Item names and icons by id, [name, icon]: a gear item's own, else its item icon's.
func (*DatabaseCatalog) Items ¶
func (c *DatabaseCatalog) Items() []CatalogItem
func (*DatabaseCatalog) SpellIcons ¶
func (c *DatabaseCatalog) SpellIcons() map[int32][2]string
Spell names and icons by id, [name, icon], from the database's spell icons.
func (*DatabaseCatalog) SpellName ¶
func (c *DatabaseCatalog) SpellName(spellID int32) (string, bool)
func (*DatabaseCatalog) Suffix ¶
func (c *DatabaseCatalog) Suffix(id int32) (CatalogSuffix, bool)
func (*DatabaseCatalog) Suffixes ¶
func (c *DatabaseCatalog) Suffixes(itemID int32) []int32
type DefCall ¶
type DefCall struct {
Path []any `json:"path"`
Name string `json:"name"`
Args []string `json:"args"`
}
A def call: the rotation path of the value it reads as, or ["whens", id, "condition", …] in a block's condition.
type Diagnostic ¶
type Diagnostic struct {
Path string // The file it is in.
Start, End Position
Severity Severity
Code string // A code of SPEC.md §13 such as unknown-name, a lint code, or unregistered-name.
Message string
Related *RelatedLocation // For an error of a used file reported at the use line: where it is in that file.
}
func (Diagnostic) String ¶
func (d Diagnostic) String() string
"path:line:col code message", without the path when there is none.
type Diagnostics ¶
type Diagnostics []Diagnostic
A file's diagnostics in the order SPEC.md §13 fixes. As an error, one "path:line:col code message" per line.
func (Diagnostics) Error ¶
func (d Diagnostics) Error() string
type Doc ¶
type Doc struct {
// contains filtered or unexported fields
}
A file's text, read. Its spans and the paths of its names lead into the loader's message (SPEC.md §1): the APLRotation of an x.apl.siml, the EquipmentSpec of an x.gear.siml, and the IndividualSimSettings of any other file.
func Analyze ¶
Reads src as the file at path, as Parse does; the result holds the diagnostics, and an error only when the schema itself does not read.
func (*Doc) Complete ¶
func (d *Doc) Complete(at Position, c *DatabaseCatalog) []Completion
What may go at a position: keywords, kinds, names, fields and values, each with the text it replaces.
func (*Doc) Definition ¶
What the occurrence at a position names, where it is declared; or the file a use path there names, at its start.
func (*Doc) Diagnostics ¶
func (d *Doc) Diagnostics() Diagnostics
The errors and warnings, in the order SPEC.md §13 fixes.
func (*Doc) EditorDiagnostics ¶
func (d *Doc) EditorDiagnostics(c *DatabaseCatalog) Diagnostics
The parser's diagnostics and the checks, as the editor shows them: under ui/specs the parser's warnings are errors.
func (*Doc) Folds ¶
Each section, each statement that runs over several lines, the block of use lines and each run of comment lines.
func (*Doc) Hover ¶
func (d *Doc) Hover(at Position, c *DatabaseCatalog) (Hover, bool)
What the word at a position is: a name and what it means, a kind, field, unit, section or spec, or a variable, group, sequence or placeholder with its declaration.
func (*Doc) PathAt ¶
The rotation path the text at p writes: the path of the shortest span around it, the deeper one of two the same length. Empty outside the rotation's spans.
func (*Doc) PrepareRename ¶
The occurrence a rename starts from, with its name, or why there is none.
func (*Doc) QuickFixes ¶
The code actions at a range: a word the parser does not know changed to a candidate its diagnostic names, and the rewrites of conditions that change the proto, which are only made when asked (SPEC.md §16.2).
func (*Doc) References ¶
Every occurrence of what the occurrence at a position names, in this file, the file that declares it and, for a group, a def or a variable, the files near that one that name it through a use line.
func (*Doc) Refs ¶
The names the text writes, in file order, with the ones no namespace holds (Known false). A name a used file's def writes is at the call in this file that reads the def. Each one's Path is within the loader's message, and nil for a name outside it.
func (*Doc) Rename ¶
The edits that rename what the occurrence at a position names, in every file that names it, the files in the order they are first found; or why it cannot be. Nothing and no error when nothing there renames.
func (*Doc) RotationJSON ¶
func (d *Doc) RotationJSON() json.RawMessage
The rotation's JSON, in the form of SPEC.md §5.4; nil when the text has an error or holds no rotation.
func (*Doc) SpanFor ¶
The text of the innermost node a rotation path leads into: the path's own span, else the deepest span that holds it. The path is within the rotation, in a file of any kind.
func (*Doc) Spans ¶
The text of each JSON path into the loader's message that the text writes: each row, var line and group header, each value, action, unit, spell and field value within them, each entry's values and slot row, and the talents line. A path can have more than one span; they come in the order typing reads the nodes.
func (*Doc) Splice ¶
The edits that apply edits, in order, to the rotation the text writes: only the statements they change are printed again, and every other line of the text is kept. The error says why not: the file is no x.apl.siml, the text has an error or uses another file, a path leads through an index or a field that does not exist, or the edited rotation has an error.
func (*Doc) Structure ¶
The structure of an x.apl.siml's rotation; nil when the text has an error, uses another file, or is no x.apl.siml.
func (*Doc) Symbols ¶
The sections, with their variables, sequences, defs and when blocks, and the file's variables and defs before the first header, for the outline.
type EnchantName ¶
An enchant entry: an effect id, and the slots of the item types its rows fit.
type File ¶
type File struct {
Path string
Kind Kind
Spec proto.Spec // SpecUnknown when the file names no spec.
Settings *proto.IndividualSimSettings // What the file and the files it uses set (SPEC.md §5.1).
Categories []string // The import categories the file holds, in the site's order (SPEC.md §5.1).
Names []NameRef // The names the file itself writes, in file order.
Uses []string // The paths its use lines name, read against its own path, in file order.
RawRefs Diagnostics // raw-ref at each raw token that holds an id a name could write, which no file under ui/specs holds (SPEC.md §7.3).
Warnings Diagnostics
}
A parsed file. One with an error holds no settings, categories or warnings, and still lists the names and raw refs that read.
func Parse ¶
Parses src, the text of the file at path, whose names mean what names says (SPEC.md §7). The error is Diagnostics when the file has an error, which then holds its warnings too, and the file holds what read. open reads the files that use lines name, at paths read against path; with no open, a use line is use-refused.
func ReadFile ¶
Reads and parses the file at path with the committed name table, reading the files its use lines name from the file system. A build without the with_db tag holds no table, and reads only a file that writes no name.
func (*File) Equipment ¶
func (f *File) Equipment() *proto.EquipmentSpec
The 17 items of an x.gear.siml, or of a full file that holds gear:.
func (*File) Message ¶
func (f *File) Message() googleProto.Message
What the file loads as (SPEC.md §1): an x.apl.siml its rotation, an x.gear.siml its equipment, any other file its settings.
func (*File) Rotation ¶
func (f *File) Rotation() *proto.APLRotation
The rotation of an x.apl.siml, or of a full file that holds one.
type FileStamp ¶
A file's size and modification time, which say it changed since a read. A missing file's size is -1.
type Finding ¶
type Finding struct {
Path []any `json:"path"` // JSON names and list indices.
Severity string `json:"severity"` // error, warning or info.
Code string `json:"code"`
Message string `json:"message"`
}
A finding of Lint, at the JSON path within the rotation of what it is about.
func Lint ¶
func Lint(r *proto.APLRotation) []Finding
The findings on r, in the order the checks find them.
type Fix ¶
type Fix struct {
Title string
Kind string // quickfix, or refactor.rewrite for a rewrite no diagnostic asks for.
Diagnostic Diagnostic
Edits []TextEdit
Preferred bool
}
type Fold ¶
A folding range: its first and last lines, 1-based, and what it folds (region, imports, comment or "").
type Kind ¶
type Kind struct {
Section string // The section an x.<section>.siml holds, such as apl or gear; "" for a full setup, x.siml.
}
Which sections a file holds, from its double extension (SPEC.md §1).
func KindOf ¶
The kind of the file at path. A path that does not end in .siml, or whose double extension names no section, is an error.
func (Kind) Message ¶
func (k Kind) Message() googleProto.Message
The loader's message for a file of kind (SPEC.md §1), empty: an APLRotation, an EquipmentSpec or IndividualSimSettings.
type NameRef ¶
type NameRef struct {
Name string
Namespace Namespace
Start, End Position
ID int32 // The spell id, item id, enchant effect id or random suffix id it means.
Row *SlotRow // The slot row it is written on, if any.
Path []any // The JSON path, within the loader's message (SPEC.md §1), of the field it fills; nil outside it.
Known bool // Whether its namespace holds it; Doc.Refs gives the names it does not hold too.
}
A name a file writes, and what it means there (SPEC.md §7).
type NamedEntry ¶
A name of a spell-like namespace and its entry.
type Names ¶
type Names struct {
Classes map[proto.Class]SpellNames
Items map[string]int32
Enchants map[string]EnchantName
Suffixes map[string]int32
// The specs that know an item's effect only as an ICD trigger, which only the ICD kinds find, by
// the item's name.
ICDOnlyItems map[string][]string
// contains filtered or unexported fields
}
A name table. Lookups index it on first use, so the maps must not change after the first lookup.
func DefaultNames ¶
The committed table, names.json, which a build holds only with the with_db tag.
func ParseNames ¶
Reads a name table in the form of SPEC.md §7.4, and refuses one that breaks a rule of what a loader checks. The JSON is read with keys exactly, numbers by value, so 1.0 is the whole number 1, and null as absent.
func (*Names) EnchantName ¶
The name an enchant effect prints with on an item in slot: of the effect's names whose slots hold slot, the one with the most slots and the first in byte order of those, else the effect's first name in byte order. An effect a one-hand and a two-hand weapon row share thus prints with the one-hand row's name (main and off hand), which fits a two-hander too, where the two-hand row's (main hand) fits no one-hander.
func (*Names) Encode ¶
The table in the form of SPEC.md §7.4: every object's keys in byte order, one entry to a line, and empty namespaces and classes left out.
func (*Names) Holding ¶
The namespaces in which name means something for a file of class, in the order of AllNamespaces.
func (*Names) Registered ¶
The names of a spell-like namespace a file of class reads (the class's own, then the shared ones it does not hide), each in byte order, that a build of spec registers; with no spec, those any build registers.
func (*Names) Spell ¶
The spell-like entry name means in ns for a file of class: the class's own entry, else the shared one. A file with no spec line passes ClassUnknown and reads the shared entries only.
type NamesFile ¶
type NamesFile struct {
Path string
// contains filtered or unexported fields
}
The name table at Path, read again when the file changes on disk.
type Namespace ¶
type Namespace string
Where a name is looked up. The position decides the namespace (SPEC.md §7.2). The five spell-like namespaces are per class, and items, enchants and suffixes are one namespace each for every file.
const ( NamespaceSpell Namespace = "spell" // What the player casts. NamespaceAura Namespace = "aura" // Auras on the player. NamespaceTargetAura Namespace = "target_aura" // Auras on a target. NamespaceTargetSpell Namespace = "target_spell" // What a target casts, which boss_spell reads. NamespacePetAura Namespace = "pet_aura" // Auras on a pet. NamespaceItem Namespace = "item" NamespaceEnchant Namespace = "enchant" NamespaceSuffix Namespace = "suffix" )
func AllNamespaces ¶
func AllNamespaces() []Namespace
Every namespace, in the order SPEC.md §7.1 lists them, which is the order Holding reports them in.
type Position ¶
type Position struct{ Line, Col int }
A place in a file. Line and Col count from 1, and Col counts UTF-16 code units, as editors do.
type Range ¶
type Range struct{ Start, End Position }
A stretch of a file's text. Its positions count lines and columns from 1, columns in UTF-16 code units, as a Diagnostic's do.
type RelatedLocation ¶
A place in another file that a diagnostic is about.
type Reread ¶
type Reread[T any] struct { // contains filtered or unexported fields }
A value read from files, read again when one of them changes on disk. Callers of one Reread wait for its read; those of another do not.
type Severity ¶
type Severity int
Whether a diagnostic stops a file from loading: a file with an error yields no proto, and one with only warnings does. Information is the editor's: a rotation lint that points something out (Lint's info).
type SpecInfo ¶
type SpecInfo struct {
Field protoreflect.FieldDescriptor // The oneof field the spec line names: hunter, dps_warrior.
Spec proto.Spec // Spec + the message name.
Class proto.Class // The class whose short name ends the message name in snake case.
Options protoreflect.MessageDescriptor // The type of the spec message's options field, which settings: flattens.
ClassOptions protoreflect.FieldDescriptor // The options' class_options field, flattened after the rest; nil when there is none.
Rotation protoreflect.MessageDescriptor // The spec message's nested Rotation, which simple: writes as spec_rotation_json.
}
One field of Player's spec oneof, and what the spec line and the settings: and simple: sections read through it (SPEC.md §8.4).
type SpellName ¶
type SpellName struct {
SpellID, Tag, Rank int32
RegisteredBy []string // The specs that register it, by Player spec field name in byte order; empty when no build does.
ICDOnlyBy []string // The specs of RegisteredBy that know the aura only as an ICD trigger, which only the ICD kinds find.
TalentOnlyBy []string // The specs of RegisteredBy that know the spell only as a talent, which only the talent kinds find.
Uncastable bool // A spell no build lets a rotation cast (the sim's APL flag), as an inner spell.
}
A spell-like entry: the spell id, tag and rank of an ActionID. A file means the spell id and tag; the rank is what the sim registers, which the site shows (SPEC.md §7.3).
type SpellNames ¶
The spell-like entries of a class, or the shared ones, by namespace and then name.
type Structure ¶
type Structure struct {
Whens []WhenBlock `json:"whens"`
Rows []BlockRow `json:"rows"`
Calls []DefCall `json:"calls"`
Defs []DefInfo `json:"defs"`
}
What the rotation panel shows of an x.apl.siml beyond the rotation's JSON: the when blocks its rows are in, the def calls its values are written as, and its defs (SPEC.md §6.9, §6.10).
type Symbol ¶
type Symbol struct {
Name, Detail string
Kind SymbolKind
Range, Selection Range
Children []Symbol
}
type SymbolKind ¶
type SymbolKind int
What a symbol is, numbered as the protocol's SymbolKind.
const ( SymbolModule SymbolKind = 2 SymbolNamespace SymbolKind = 3 SymbolFunction SymbolKind = 12 SymbolVariable SymbolKind = 13 SymbolBoolean SymbolKind = 17 SymbolEvent SymbolKind = 24 )
type WhenBlock ¶
type WhenBlock struct {
ID int `json:"id"`
List []any `json:"list"` // The rotation path of the list its rows are in.
Parent int `json:"parent"` // The block it is in, -1 for none.
First int `json:"first"` // The index of its first row in the list.
Last int `json:"last"` // The index of its last row, nested blocks' included; First-1 when it has none.
Hide bool `json:"hide,omitempty"`
Condition json.RawMessage `json:"condition"`
Conjuncts []json.RawMessage `json:"conjuncts"` // What it joins to the condition of each row in it, in order.
Range Range `json:"-"`
}
A when block. Its id is its place among the file's when lines, which a ["whens", id, …] edit names.
type Words ¶
type Words struct {
Keywords, Heads, Units, UnitPrefixes, Sections []string
DurationUnits []string // The units a duration literal takes (SPEC.md §2).
}
The words of SIML that the editor's grammar colours (SPEC.md §2-§4): the keywords, the accessor heads, the unit words, the prefixes of the indexed units (target1, player2), and every section name, in the schema's order.
func GrammarWords ¶
Source Files
¶
- api.go
- build.go
- check.go
- def.go
- diagnostics.go
- doc.go
- file.go
- format.go
- forms.go
- identifier.go
- index.go
- json.go
- lang_api.go
- lang_catalog.go
- lang_checks.go
- lang_classify.go
- lang_complete.go
- lang_context.go
- lang_doc.go
- lang_symbols.go
- lazy.go
- lex.go
- lint.go
- llm.go
- names.go
- names_noembed.go
- normalize.go
- print.go
- schema.go
- specs.go
- splice.go
- splice_blocks.go
- stamp.go
- structure.go
- syntax.go
- typed_names.go
- typed_rotation.go
- typed_setup.go
- typing.go
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
simlnames
command
Generates the SIML name table (sim/siml/SPEC.md §7.4) from what the sim registers and the database, keeping every name the committed table holds, and reports what it added on standard error.
|
Generates the SIML name table (sim/siml/SPEC.md §7.4) from what the sim registers and the database, keeping every name the committed table holds, and reports what it added on standard error. |
|
Package gen writes the SIML name table, sim/siml/names.json (SPEC.md §7.4): it asks the sim what every spec registers, adds a name for each spell, aura, item, enchant and random suffix the table does not name yet, and keeps every name the table already holds.
|
Package gen writes the SIML name table, sim/siml/names.json (SPEC.md §7.4): it asks the sim what every spec registers, adds a name for each spell, aura, item, enchant and random suffix the table does not name yet, and keeps every name the table already holds. |
|
Package lsp is the SIML language server: diagnostics, completion, hover, navigation, rename, outline, folding, semantic tokens, formatting and code actions for every *.siml file, and the requests the rotation panel of the VS Code extension makes.
|
Package lsp is the SIML language server: diagnostics, completion, hover, navigation, rename, outline, folding, semantic tokens, formatting and code actions for every *.siml file, and the requests the rotation panel of the VS Code extension makes. |
|
jsonrpc
Package jsonrpc is JSON-RPC 2.0 over a stream, framed as the language server protocol frames it: a Content-Length header, a blank line and the body.
|
Package jsonrpc is JSON-RPC 2.0 over a stream, framed as the language server protocol frames it: a Content-Length header, a blank line and the body. |
|
launch
command
Starts the SIML language server, `wowsimcli siml lsp`, for an editor, from the repository root.
|
Starts the SIML language server, `wowsimcli siml lsp`, for an editor, from the repository root. |