Remove unneeded quotes from autocomplete % nodes

Removes unnecessary quotes for suggestions like $"%MyNode".
This commit is contained in:
aXu-AP 2024-09-06 23:41:32 +03:00
parent 05d985496c
commit 2525311538
3 changed files with 16 additions and 2 deletions

View File

@ -3482,10 +3482,10 @@ static void _find_call_arguments(GDScriptParser::CompletionContext &p_context, c
opt = opt.substr(1);
}
// The path needs quotes if at least one of its components (excluding `/` separations)
// The path needs quotes if at least one of its components (excluding `%` prefix and `/` separations)
// is not a valid identifier.
bool path_needs_quote = false;
for (const String &part : opt.split("/")) {
for (const String &part : opt.trim_prefix("%").split("/")) {
if (!part.is_valid_ascii_identifier()) {
path_needs_quote = true;
break;

View File

@ -0,0 +1,9 @@
[input]
scene="res://completion/get_node/get_node.tscn"
[output]
include=[
{"display": "%UniqueA"},
]
exclude=[
{"display": "\"%UniqueA\""},
]

View File

@ -0,0 +1,5 @@
extends Node
func a():
$
pass