feat: updated godot version
This commit is contained in:
parent
0c508b0831
commit
42b028dbb5
4694 changed files with 236470 additions and 401376 deletions
|
|
@ -32,11 +32,10 @@
|
|||
|
||||
#include "../gdscript.h"
|
||||
#include "../gdscript_analyzer.h"
|
||||
#include "editor/settings/editor_settings.h"
|
||||
#include "gdscript_language_protocol.h"
|
||||
#include "gdscript_workspace.h"
|
||||
|
||||
#include "editor/settings/editor_settings.h"
|
||||
|
||||
int get_indent_size() {
|
||||
if (EditorSettings::get_singleton()) {
|
||||
return EditorSettings::get_singleton()->get_setting("text_editor/behavior/indent/size");
|
||||
|
|
@ -136,12 +135,18 @@ void ExtendGDScriptParser::update_diagnostics() {
|
|||
diagnostic.severity = LSP::DiagnosticSeverity::Error;
|
||||
diagnostic.message = error.message;
|
||||
diagnostic.source = "gdscript";
|
||||
|
||||
GodotRange godot_range(
|
||||
GodotPosition(error.start_line, error.start_column),
|
||||
GodotPosition(error.end_line, error.end_column));
|
||||
|
||||
diagnostic.range = godot_range.to_lsp(get_lines());
|
||||
diagnostic.code = -1;
|
||||
LSP::Range range;
|
||||
LSP::Position pos;
|
||||
const PackedStringArray line_array = get_lines();
|
||||
int line = CLAMP(LINE_NUMBER_TO_INDEX(error.line), 0, line_array.size() - 1);
|
||||
const String &line_text = line_array[line];
|
||||
pos.line = line;
|
||||
pos.character = line_text.length() - line_text.strip_edges(true, false).length();
|
||||
range.start = pos;
|
||||
range.end = range.start;
|
||||
range.end.character = line_text.strip_edges(false).length();
|
||||
diagnostic.range = range;
|
||||
diagnostics.push_back(diagnostic);
|
||||
}
|
||||
|
||||
|
|
@ -151,12 +156,17 @@ void ExtendGDScriptParser::update_diagnostics() {
|
|||
diagnostic.severity = LSP::DiagnosticSeverity::Warning;
|
||||
diagnostic.message = "(" + warning.get_name() + "): " + warning.get_message();
|
||||
diagnostic.source = "gdscript";
|
||||
|
||||
GodotRange godot_range(
|
||||
GodotPosition(warning.start_line, warning.start_column),
|
||||
GodotPosition(warning.end_line, warning.end_column));
|
||||
|
||||
diagnostic.range = godot_range.to_lsp(get_lines());
|
||||
diagnostic.code = warning.code;
|
||||
LSP::Range range;
|
||||
LSP::Position pos;
|
||||
int line = LINE_NUMBER_TO_INDEX(warning.start_line);
|
||||
const String &line_text = get_lines()[line];
|
||||
pos.line = line;
|
||||
pos.character = line_text.length() - line_text.strip_edges(true, false).length();
|
||||
range.start = pos;
|
||||
range.end = pos;
|
||||
range.end.character = line_text.strip_edges(false).length();
|
||||
diagnostic.range = range;
|
||||
diagnostics.push_back(diagnostic);
|
||||
}
|
||||
}
|
||||
|
|
@ -860,6 +870,30 @@ const List<LSP::DocumentLink> &ExtendGDScriptParser::get_document_links() const
|
|||
return document_links;
|
||||
}
|
||||
|
||||
const Array &ExtendGDScriptParser::get_member_completions() {
|
||||
if (member_completions.is_empty()) {
|
||||
for (const KeyValue<String, const LSP::DocumentSymbol *> &E : members) {
|
||||
const LSP::DocumentSymbol *symbol = E.value;
|
||||
LSP::CompletionItem item = symbol->make_completion_item();
|
||||
item.data = JOIN_SYMBOLS(path, E.key);
|
||||
member_completions.push_back(item.to_json());
|
||||
}
|
||||
|
||||
for (const KeyValue<String, ClassMembers> &E : inner_classes) {
|
||||
const ClassMembers *inner_class = &E.value;
|
||||
|
||||
for (const KeyValue<String, const LSP::DocumentSymbol *> &F : *inner_class) {
|
||||
const LSP::DocumentSymbol *symbol = F.value;
|
||||
LSP::CompletionItem item = symbol->make_completion_item();
|
||||
item.data = JOIN_SYMBOLS(path, JOIN_SYMBOLS(E.key, F.key));
|
||||
member_completions.push_back(item.to_json());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return member_completions;
|
||||
}
|
||||
|
||||
Dictionary ExtendGDScriptParser::dump_function_api(const GDScriptParser::FunctionNode *p_func) const {
|
||||
ERR_FAIL_NULL_V(p_func, Dictionary());
|
||||
Dictionary func;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue