YarnYSLSGenerator
generates .ysls.json files for yarn spinner language server integration. scans for YarnCommandBinding resources, _yarn_command_*/_yarn_function_* methods, and registered library commands/functions.
class_name YarnYSLSGenerator
extends RefCountedInherits from RefCounted
#Constants
#YSLS_VERSION
const YSLS_VERSION = 2#Methods
#clear()
func clear() -> void#find_reachable_files(String)
static func find_reachable_files(yarn_project_path: String) -> PackedStringArrayParameters
yarn_project_pathString
Returns PackedStringArray
#find_scan_root(String)
Find the directory to scan for a .yarnproject file. Starts at the project file's folder and moves up while that folder's tree has no .gd files, but never into a folder that holds another Yarn Project, so unrelated projects next to this one are left alone.
static func find_scan_root(yarn_project_path: String) -> StringParameters
yarn_project_pathString
Returns String
#generate_for_project(String, String)
Generate YSLS for a project. With no scan_root, scans the folder from find_scan_root plus the files from find_reachable_files. Pass "res://" to scan the entire Godot project.
static func generate_for_project(yarn_project_path: String, scan_root: String = "") -> intParameters
yarn_project_pathStringscan_rootString
Returns int
#generate_from_runner(String, Variant)
static func generate_from_runner(yarn_project_path: String, dialogue_runner: Variant) -> intParameters
yarn_project_pathStringdialogue_runnerVariant
Returns int
#generate_ysls_dict()
func generate_ysls_dict() -> DictionaryReturns Dictionary
#generate_ysls_file_dict()
The .ysls.json as it's written to disk. Functions go under PascalCase "Functions", which ysc needs when it reads a project's "definitions" file to know each function's types. The VS Code extension reads either case.
func generate_ysls_file_dict() -> DictionaryReturns Dictionary
#generate_ysls_json(bool)
func generate_ysls_json(pretty: bool = true) -> StringParameters
prettybool
Returns String
#save_ysls_for_project(String)
func save_ysls_for_project(yarn_project_path: String) -> intParameters
yarn_project_pathString
Returns int
#save_ysls(String)
func save_ysls(path: String) -> intParameters
pathString
Returns int
#scan_dialogue_runner(Variant)
func scan_dialogue_runner(runner: Variant) -> voidParameters
runnerVariant
#scan_directory(String)
func scan_directory(path: String) -> voidParameters
pathString
#scan_for_project(String, String)
func scan_for_project(yarn_project_path: String, scan_path: String = "") -> voidParameters
yarn_project_pathStringscan_pathString
#scan_gdscript_file(String)
func scan_gdscript_file(path: String) -> voidParameters
pathString
#scan_library(YarnLibrary)
#scan_node(Node, bool)
func scan_node(node: Node, recursive: bool = true) -> voidParameters
nodeNoderecursivebool
Generated from Yarn Spinner for Godot GDScript 3.3.