GFExtensionUsageAudit¶
API Reference / Kernel / 类索引
- 路径:
addons/gf/kernel/extension/gf_extension_usage_audit.gd - 模块:
Kernel - 继承:
RefCounted - API:
public - 类别:编辑器 API (
editor_api) - 首次版本:
3.17.0
检查禁用扩展是否仍被项目文件直接引用。
成员概览¶
| 类型 | 名称 | 签名 |
|---|---|---|
| 常量 | DEFAULT_SCAN_ROOTS |
const DEFAULT_SCAN_ROOTS: Array[String] = ["res://"] |
| 常量 | DEFAULT_MAX_SCAN_DEPTH |
const DEFAULT_MAX_SCAN_DEPTH: int = 32 |
| 常量 | DEFAULT_MAX_SCANNED_FILES |
const DEFAULT_MAX_SCANNED_FILES: int = 10000 |
| 常量 | DEFAULT_IGNORED_ROOTS |
const DEFAULT_IGNORED_ROOTS: Array[String] = [ |
| 常量 | TEXT_FILE_EXTENSIONS |
const TEXT_FILE_EXTENSIONS: Array[String] = [ |
| 方法 | audit_disabled_extensions |
static func audit_disabled_extensions( manifests: Array[GFExtensionManifest], options: Dictionary = {} ) -> Dictionary: |
| 方法 | find_references_to_root |
static func find_references_to_root(root_path: String, options: Dictionary = {}) -> Array[Dictionary]: |
常量¶
DEFAULT_SCAN_ROOTS¶
- API:
public
默认扫描根目录。
DEFAULT_MAX_SCAN_DEPTH¶
- API:
public
默认最大扫描深度。
DEFAULT_MAX_SCANNED_FILES¶
- API:
public
默认最大扫描文件数。
DEFAULT_IGNORED_ROOTS¶
- API:
public
默认忽略的根目录。
TEXT_FILE_EXTENSIONS¶
- API:
public
作为文本扫描的资源扩展名。
方法¶
audit_disabled_extensions¶
- API:
public
static func audit_disabled_extensions( manifests: Array[GFExtensionManifest], options: Dictionary = {} ) -> Dictionary:
检查一组禁用扩展是否仍被项目文件直接引用。
参数:
| 名称 | 说明 |
|---|---|
manifests |
要检查的禁用扩展 manifest 列表。 |
options |
可选参数,支持 scan_roots、ignored_roots、max_references_per_extension、max_scan_depth、max_scanned_files。 |
返回:引用审计报告。
结构:
options: Dictionary controlling scan roots, ignored roots, reference limits, depth, and scanned file count.return: Dictionary containing ok, extension_count, reference_count, extensions, and references.
find_references_to_root¶
- API:
public
static func find_references_to_root(root_path: String, options: Dictionary = {}) -> Array[Dictionary]:
查找项目文件中对指定扩展根目录的直接路径引用。
参数:
| 名称 | 说明 |
|---|---|
root_path |
扩展根目录。 |
options |
可选参数,支持 scan_roots、ignored_roots、max_references_per_extension、max_scan_depth、max_scanned_files。 |
返回:引用列表。
结构:
options: Dictionary controlling scan roots, ignored roots, reference limits, depth, and scanned file count.return: Array of Dictionary file reference records.