diff options
Diffstat (limited to 'modules/gdscript/language_server/gdscript_extend_parser.cpp')
-rw-r--r-- | modules/gdscript/language_server/gdscript_extend_parser.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/modules/gdscript/language_server/gdscript_extend_parser.cpp b/modules/gdscript/language_server/gdscript_extend_parser.cpp index 146ed10ceb..3a5a54e275 100644 --- a/modules/gdscript/language_server/gdscript_extend_parser.cpp +++ b/modules/gdscript/language_server/gdscript_extend_parser.cpp @@ -337,7 +337,7 @@ void ExtendGDScriptParser::parse_function_symbol(const GDScriptParser::FunctionN symbol.kind = lsp::SymbolKind::Variable; symbol.name = parameter->identifier->name; symbol.range.start.line = LINE_NUMBER_TO_INDEX(parameter->start_line); - symbol.range.start.character = LINE_NUMBER_TO_INDEX(parameter->start_line); + symbol.range.start.character = LINE_NUMBER_TO_INDEX(parameter->start_column); symbol.range.end.line = LINE_NUMBER_TO_INDEX(parameter->end_line); symbol.range.end.character = LINE_NUMBER_TO_INDEX(parameter->end_column); symbol.uri = uri; @@ -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; } @@ -717,7 +731,7 @@ Dictionary ExtendGDScriptParser::dump_class_api(const GDScriptParser::ClassNode class_api["path"] = path; Array extends_class; for (int i = 0; i < p_class->extends.size(); i++) { - extends_class.append(String(p_class->extends[i])); + extends_class.append(String(p_class->extends[i]->name)); } class_api["extends_class"] = extends_class; class_api["extends_file"] = String(p_class->extends_path); |