Add editor settings for autocompletion with NodePath and StringName

This commit is contained in:
VolTer 2022-10-06 22:08:01 +02:00 committed by MewPurPur
parent fe01776f05
commit de8b6f7a3c
7 changed files with 38 additions and 4 deletions

View file

@ -3398,9 +3398,16 @@ void CodeEdit::_filter_code_completion_candidates_impl() {
int offset = option.default_value.get_type() == Variant::COLOR ? line_height : 0;
if (in_string != -1) {
// The completion string may have a literal behind it, which should be removed before re-quoting.
String literal;
if (option.insert_text.substr(1).is_quoted()) {
literal = option.display.left(1);
option.display = option.display.substr(1);
option.insert_text = option.insert_text.substr(1);
}
String quote = single_quote ? "'" : "\"";
option.display = option.display.unquote().quote(quote);
option.insert_text = option.insert_text.unquote().quote(quote);
option.display = literal + (option.display.unquote().quote(quote));
option.insert_text = literal + (option.insert_text.unquote().quote(quote));
}
if (option.display.length() == 0) {