Merge pull request #61226 from Chaosus/shader_fix_keyword_completion

This commit is contained in:
Rémi Verschelde 2022-05-23 19:05:29 +02:00 committed by GitHub
commit 126470caa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -5379,6 +5379,11 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
if (tk.type == TK_CURSOR) { if (tk.type == TK_CURSOR) {
//do nothing //do nothing
} else if (tk.type == TK_PERIOD) { } else if (tk.type == TK_PERIOD) {
#ifdef DEBUG_ENABLED
uint32_t prev_keyword_completion_context = keyword_completion_context;
keyword_completion_context = CF_UNSPECIFIED;
#endif
DataType dt = expr->get_datatype(); DataType dt = expr->get_datatype();
String st = expr->get_datatype_name(); String st = expr->get_datatype_name();
@ -5734,6 +5739,10 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
} }
expr = mn; expr = mn;
#ifdef DEBUG_ENABLED
keyword_completion_context = prev_keyword_completion_context;
#endif
//todo //todo
//member (period) has priority over any operator //member (period) has priority over any operator
//creates a subindexing expression in place //creates a subindexing expression in place

View File

@ -503,7 +503,7 @@ public:
BlockNode *parent_block = nullptr; BlockNode *parent_block = nullptr;
enum BlockType { enum BlockType {
BLOCK_TYPE_STANDART, BLOCK_TYPE_STANDARD,
BLOCK_TYPE_FOR_INIT, BLOCK_TYPE_FOR_INIT,
BLOCK_TYPE_FOR_CONDITION, BLOCK_TYPE_FOR_CONDITION,
BLOCK_TYPE_FOR_EXPRESSION, BLOCK_TYPE_FOR_EXPRESSION,
@ -512,7 +512,7 @@ public:
BLOCK_TYPE_DEFAULT, BLOCK_TYPE_DEFAULT,
}; };
int block_type = BLOCK_TYPE_STANDART; int block_type = BLOCK_TYPE_STANDARD;
SubClassTag block_tag = SubClassTag::TAG_GLOBAL; SubClassTag block_tag = SubClassTag::TAG_GLOBAL;
struct Variable { struct Variable {