EditorCode beta
Class of @v12-engine/editor
export declare class EditorCodeThe game's code, shown and not edited (E2E plan EDF6, decision 3): the files of the game's folder with the definitions found in them, one file read, searched, and opened in the code editor (VS Code stays the editor of code). What the Code panel shows, in code
A part of the editor, as it gives it (editor.code)
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the EditorCode class.
Members
definitions
definitions(): readonly CodeDefinition[];The definitions found in the file shown
files
files(): readonly CodeFile[];The files of the game, as load last read them. A signal
hits
hits(): CodeHit[];The lines of the file shown that have every word of the search (not case sensitive; the kit's matchWords): none for no search
line
line(): number | undefined;The line to scroll to and mark in the file shown, from 1. A signal
load
load(): Promise<void>;Reads the list of the game's files again. What cannot be read is said
loaded
loaded(): boolean;Whether load has answered once. A signal
loadScaffolds
loadScaffolds(): Promise<void>;Reads which folders those are
matching
matching(): readonly CodeFile[];The files that match the search (every one with none): by their path, or a definition in them
newWithCode
newWithCode(kind: ScaffoldKind, id: string, name?: string, folder?: string): Promise<EditorResult<string>>;New with code: a stub from the editor's templates written into a folder the project lists (never over a file) and opened in the code editor, and the data side made at once: a unit type or an ability is a new definition of the game's data (editor.data.make, kept by Keep; a game that lets nothing of that kind be changed has the code alone), a mission a mission of the game's campaign file where it has one. An order, a system and a panel are code alone. Done with the file from the project's root, or refused saying why, with nothing made
openInEditor
openInEditor(path?: string | undefined, line?: number | undefined): Promise<void>;Opens the file shown, or path, in the code editor (at a line): the game's folder first. Where there is a project
path
path(): string | undefined;The file shown, by its path from the game's folder. A signal
query
query(): string;The search words. A signal
scaffoldFolders
scaffoldFolders(): readonly string[];The folders the project lets new code be written into (editorFiles({ scaffold })), as last read: none by default. A signal
search
search(query: string): void;Searches: the files list narrows to those whose path or definitions say every word, and hits finds the lines of the file shown
show
show(path: string, line?: number): Promise<boolean>;Shows a file of the game, at a line. Whether it could be read (a path out of the game's folder is refused by the dev server)
showDefinition
showDefinition(name: string): Promise<boolean>;Shows where something of the game is defined (id: 'x') in this panel, opened: the first definition of that name. Whether one was found
text
text(): string | undefined;The text of the file shown: none until it is read. A signal