From 854fc3cb97052109d85c037c2d4ab0a9768a4c0c Mon Sep 17 00:00:00 2001 From: Overblob Date: Sat, 14 Jul 2018 19:59:11 +0200 Subject: [PATCH] Fixed error due to bad cursor handling when parsing shader code Fixed completion error log thrown on "no auto-completion found" for typings with no completion. (cherry picked from commit 7a74d310aac3bd980d1bffe9b3cd13de2539d356) --- servers/visual/shader_language.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 90c037ab687..48108d5c5e0 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -2550,7 +2550,9 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons TkPos pos = _get_tkpos(); tk = _get_token(); - if (tk.type == TK_PERIOD) { + if (tk.type == TK_CURSOR) { + //do nothing + } else if (tk.type == TK_PERIOD) { StringName identifier; if (_get_completable_identifier(p_block, COMPLETION_INDEX, identifier)) { @@ -4140,8 +4142,8 @@ Error ShaderLanguage::complete(const String &p_code, const Map::Element *E = p_render_modes.front(); E; E = E->next()) {