diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-04 18:55:27 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-04 18:55:27 +0200 |
commit | 721d280b8a7aad3ba409fad0ee9d9833876dc8fa (patch) | |
tree | b9a5dba70fc1aba29008890d4a991a9e80bb736a /modules/gdscript/gdscript_parser.h | |
parent | a1012058dd8cf9da42c36a75232e54f738f51314 (diff) | |
parent | 171c522290101aa3f30f4442dd5a078820b64d74 (diff) | |
download | redot-engine-721d280b8a7aad3ba409fad0ee9d9833876dc8fa.tar.gz |
Merge pull request #96326 from HolonProduction/completion-hacks-and-fixes
Autocompletion: Reintroduce enum options on assignment
Diffstat (limited to 'modules/gdscript/gdscript_parser.h')
-rw-r--r-- | modules/gdscript/gdscript_parser.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h index 43c5a48fa7..2c7e730772 100644 --- a/modules/gdscript/gdscript_parser.h +++ b/modules/gdscript/gdscript_parser.h @@ -1455,8 +1455,11 @@ private: } void apply_pending_warnings(); #endif - void make_completion_context(CompletionType p_type, Node *p_node, int p_argument = -1); - void make_completion_context(CompletionType p_type, Variant::Type p_builtin_type); + // Setting p_force to false will prevent the completion context from being update if a context was already set before. + // This should only be done when we push context before we consumed any tokens for the corresponding structure. + // See parse_precedence for an example. + void make_completion_context(CompletionType p_type, Node *p_node, int p_argument = -1, bool p_force = true); + void make_completion_context(CompletionType p_type, Variant::Type p_builtin_type, bool p_force = true); // In some cases it might become necessary to alter the completion context after parsing a subexpression. // For example to not override COMPLETE_CALL_ARGUMENTS with COMPLETION_NONE from string literals. void override_completion_context(const Node *p_for_node, CompletionType p_type, Node *p_node, int p_argument = -1); |