File tree Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -4042,15 +4042,24 @@ void GDScriptAnalyzer::reduce_identifier_from_base(GDScriptParser::IdentifierNod
40424042
40434043 if (base.kind == GDScriptParser::DataType::ENUM) {
40444044#if DEBUG_ENABLED
4045- DocTools *dd = EditorHelp::get_doc_data ();
4046- StringName class_name = String (base.native_type ).get_slicec (' .' , 0 );
4047- if (dd && dd->class_list .has (class_name)) {
4048- for (const DocData::ConstantDoc &doc : dd->class_list [class_name].constants ) {
4049- if (doc.enumeration == base.enum_type && doc.name == name) {
4050- if (doc.is_deprecated ) {
4051- parser->push_warning (p_identifier, GDScriptWarning::DEPRECATED_IDENTIFIER);
4045+ if (base.class_type && base.class_type ->identifier && base.class_type ->identifier ->name ) {
4046+ DocTools *dd = EditorHelp::get_doc_data ();
4047+ StringName class_name = base.class_type ->identifier ->name ;
4048+
4049+ // It's an inner class, so we need to get the outer class's name
4050+ // as well to construct its full name as found in the doc data.
4051+ if (base.class_type ->outer != nullptr ) {
4052+ class_name = String (base.class_type ->outer ->identifier ->name ) + " ." + class_name;
4053+ }
4054+
4055+ if (dd && dd->class_list .has (class_name)) {
4056+ for (const DocData::ConstantDoc &doc : dd->class_list [class_name].constants ) {
4057+ if (doc.enumeration == base.enum_type && doc.name == name) {
4058+ if (doc.is_deprecated ) {
4059+ parser->push_warning (p_identifier, GDScriptWarning::DEPRECATED_IDENTIFIER);
4060+ }
4061+ break ;
40524062 }
4053- break ;
40544063 }
40554064 }
40564065 }
You can’t perform that action at this time.
0 commit comments