| 1360 | } |
| 1361 | |
| 1362 | void ScriptTextEditor::_validate_symbol(const String &p_symbol) { |
| 1363 | CodeEdit *text_edit = code_editor->get_text_editor(); |
| 1364 | |
| 1365 | Node *base = get_tree()->get_edited_scene_root(); |
| 1366 | if (base) { |
| 1367 | base = _find_node_for_script(base, base, script); |
| 1368 | } |
| 1369 | |
| 1370 | ScriptLanguage::LookupResult result; |
| 1371 | String lc_text = code_editor->get_text_editor()->get_text_for_symbol_lookup(); |
| 1372 | Error lc_error = script->get_language()->lookup_code(lc_text, p_symbol, script->get_path(), base, result); |
| 1373 | bool is_singleton = ProjectSettings::get_singleton()->has_autoload(p_symbol) && ProjectSettings::get_singleton()->get_autoload(p_symbol).is_singleton; |
| 1374 | if (lc_error == OK || is_singleton || ScriptServer::is_global_class(p_symbol) || p_symbol.is_resource_file() || p_symbol.begins_with("uid://")) { |
| 1375 | text_edit->set_symbol_lookup_word_as_valid(true); |
| 1376 | } else if (p_symbol.is_relative_path()) { |
| 1377 | String path = _get_absolute_path(p_symbol); |
| 1378 | if (FileAccess::exists(path)) { |
| 1379 | text_edit->set_symbol_lookup_word_as_valid(true); |
| 1380 | } else { |
| 1381 | text_edit->set_symbol_lookup_word_as_valid(false); |
| 1382 | } |
| 1383 | } else { |
| 1384 | text_edit->set_symbol_lookup_word_as_valid(false); |
| 1385 | } |
| 1386 | } |
| 1387 | |
| 1388 | void ScriptTextEditor::_show_symbol_tooltip(const String &p_symbol, int p_row, int p_column) { |
| 1389 | if (!EDITOR_GET("text_editor/behavior/documentation/enable_tooltips").booleanize()) { |
nothing calls this directly
no test coverage detected