summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorocean (they/them) <anvilfolk@gmail.com>2022-11-18 15:20:26 -0500
committerocean (they/them) <anvilfolk@gmail.com>2022-11-18 15:20:26 -0500
commitef2aeca5dfbc7fd88132093b766439be244741fe (patch)
tree8e8f2cc1606bb6847c0fd0efc4855471df9626aa
parentd93bec61c3e8f5e047f12ae3ce6a68fbc7a37273 (diff)
Add error highlighting for duplicate variables/constants
-rw-r--r--modules/gdscript/gdscript_parser.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 053d81893d..5e7e67d0d9 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -1535,7 +1535,7 @@ GDScriptParser::SuiteNode *GDScriptParser::parse_suite(const String &p_context,
VariableNode *variable = static_cast<VariableNode *>(statement);
const SuiteNode::Local &local = current_suite->get_local(variable->identifier->name);
if (local.type != SuiteNode::Local::UNDEFINED) {
- push_error(vformat(R"(There is already a %s named "%s" declared in this scope.)", local.get_name(), variable->identifier->name));
+ push_error(vformat(R"(There is already a %s named "%s" declared in this scope.)", local.get_name(), variable->identifier->name), variable->identifier);
}
current_suite->add_local(variable, current_function);
break;
@@ -1550,7 +1550,7 @@ GDScriptParser::SuiteNode *GDScriptParser::parse_suite(const String &p_context,
} else {
name = "variable";
}
- push_error(vformat(R"(There is already a %s named "%s" declared in this scope.)", name, constant->identifier->name));
+ push_error(vformat(R"(There is already a %s named "%s" declared in this scope.)", name, constant->identifier->name), constant->identifier);
}
current_suite->add_local(constant, current_function);
break;