diff options
author | Adam Scott <ascott.ca@gmail.com> | 2023-04-15 12:29:11 -0400 |
---|---|---|
committer | Adam Scott <ascott.ca@gmail.com> | 2023-04-22 14:35:34 -0400 |
commit | 10fe6f14bba67950bde486051f1fd5e06c7f6dcd (patch) | |
tree | fbe42ad5f7ca09ed22b790be6bb7d9367460933d /modules/gdscript/language_server/gdscript_extend_parser.cpp | |
parent | 24cb43a8741c7b10abbbbc77bb6e2bc188662ce0 (diff) | |
download | redot-engine-10fe6f14bba67950bde486051f1fd5e06c7f6dcd.tar.gz |
Fix GDScript LSP variable rename
Diffstat (limited to 'modules/gdscript/language_server/gdscript_extend_parser.cpp')
-rw-r--r-- | modules/gdscript/language_server/gdscript_extend_parser.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/gdscript/language_server/gdscript_extend_parser.cpp b/modules/gdscript/language_server/gdscript_extend_parser.cpp index 07f9465516..3a5a54e275 100644 --- a/modules/gdscript/language_server/gdscript_extend_parser.cpp +++ b/modules/gdscript/language_server/gdscript_extend_parser.cpp @@ -400,6 +400,20 @@ void ExtendGDScriptParser::parse_function_symbol(const GDScriptParser::FunctionN } } break; + case GDScriptParser::TypeNode::VARIABLE: { + GDScriptParser::VariableNode *variable_node = (GDScriptParser::VariableNode *)(node); + lsp::DocumentSymbol symbol; + symbol.kind = lsp::SymbolKind::Variable; + symbol.name = variable_node->identifier->name; + symbol.range.start.line = LINE_NUMBER_TO_INDEX(variable_node->start_line); + symbol.range.start.character = LINE_NUMBER_TO_INDEX(variable_node->start_column); + symbol.range.end.line = LINE_NUMBER_TO_INDEX(variable_node->end_line); + symbol.range.end.character = LINE_NUMBER_TO_INDEX(variable_node->end_column); + symbol.uri = uri; + symbol.script_path = path; + r_symbol.children.push_back(symbol); + } break; + default: continue; } |