diff options
| author | Andreas Haas | 2017-08-02 19:20:27 +0200 |
|---|---|---|
| committer | Andreas Haas | 2017-08-02 19:23:57 +0200 |
| commit | 708ddb05af51a1dcc4cc19ace67e7c4bc23d785b (patch) | |
| tree | 948f8df35c0dcc11a73b4d9d30f971d2cf0c8e23 /editor/plugins/script_text_editor.cpp | |
| parent | 0586524b9ce67bdcab5cef88397c44bb7b9e46fb (diff) | |
| download | godot-708ddb05af51a1dcc4cc19ace67e7c4bc23d785b.tar.gz godot-708ddb05af51a1dcc4cc19ace67e7c4bc23d785b.tar.zst godot-708ddb05af51a1dcc4cc19ace67e7c4bc23d785b.zip | |
Diffstat (limited to 'editor/plugins/script_text_editor.cpp')
| -rw-r--r-- | editor/plugins/script_text_editor.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index e260b1ea2..e3184a028 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -634,7 +634,17 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c } ScriptLanguage::LookupResult result; - if (script->get_language()->lookup_code(code_editor->get_text_edit()->get_text_for_lookup_completion(), p_symbol, script->get_path().get_base_dir(), base, result) == OK) { + if (p_symbol.is_resource_file()) { + List<String> scene_extensions; + ResourceLoader::get_recognized_extensions_for_type("PackedScene", &scene_extensions); + + if (scene_extensions.find(p_symbol.get_extension())) { + EditorNode::get_singleton()->load_scene(p_symbol); + } else { + EditorNode::get_singleton()->load_resource(p_symbol); + } + + } else if (script->get_language()->lookup_code(code_editor->get_text_edit()->get_text_for_lookup_completion(), p_symbol, script->get_path().get_base_dir(), base, result) == OK) { _goto_line(p_row); |
