mirror of
https://github.com/godotengine/godot-vscode-plugin.git
synced 2026-01-04 10:09:58 +03:00
Add command to list godot native classes
This commit is contained in:
@@ -34,6 +34,10 @@
|
||||
{
|
||||
"command": "godot-tool.run_project",
|
||||
"title": "Godot Tools: Run workspace as Godot project"
|
||||
},
|
||||
{
|
||||
"command": "godot-tool.list_native_classes",
|
||||
"title": "Godot Tools: List native classes of godot"
|
||||
}
|
||||
],
|
||||
"configuration": {
|
||||
|
||||
@@ -14,6 +14,7 @@ marked.setOptions({
|
||||
const enum WebViewMessageType {
|
||||
INSPECT_NATIVE_SYMBOL = 'INSPECT_NATIVE_SYMBOL',
|
||||
};
|
||||
const LIST_NATIVE_CLASS_COMMAND = 'godot-tool.list_native_classes';
|
||||
|
||||
export default class NativeDocumentManager extends EventEmitter {
|
||||
|
||||
@@ -39,6 +40,21 @@ export default class NativeDocumentManager extends EventEmitter {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
vscode.commands.registerCommand(LIST_NATIVE_CLASS_COMMAND, this.list_native_classes.bind(this));
|
||||
}
|
||||
|
||||
private async list_native_classes() {
|
||||
let classname = await vscode.window.showQuickPick(
|
||||
Object.keys(this.native_classes).sort(),
|
||||
{
|
||||
placeHolder: 'Type godot class name here',
|
||||
canPickMany: false
|
||||
}
|
||||
);
|
||||
if (classname) {
|
||||
this.inspect_native_symbol({native_class: classname, symbol_name: classname});
|
||||
}
|
||||
}
|
||||
|
||||
private inspect_native_symbol(params: NativeSymbolInspectParams) {
|
||||
|
||||
Reference in New Issue
Block a user