mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
This commit is contained in:
parent
64a63e0861
commit
b5e1e05ef2
1439 changed files with 1 additions and 34187 deletions
|
|
@ -83,7 +83,6 @@ void GDScriptWorkspace::remove_cache_parser(const String &p_path) {
|
|||
}
|
||||
|
||||
const lsp::DocumentSymbol *GDScriptWorkspace::get_native_symbol(const String &p_class, const String &p_member) const {
|
||||
|
||||
StringName class_name = p_class;
|
||||
StringName empty;
|
||||
|
||||
|
|
@ -202,7 +201,6 @@ Error GDScriptWorkspace::initialize() {
|
|||
|
||||
DocData *doc = EditorHelp::get_doc_data();
|
||||
for (Map<String, DocData::ClassDoc>::Element *E = doc->class_list.front(); E; E = E->next()) {
|
||||
|
||||
const DocData::ClassDoc &class_data = E->value();
|
||||
lsp::DocumentSymbol class_symbol;
|
||||
String class_name = E->key();
|
||||
|
|
@ -327,14 +325,12 @@ Error GDScriptWorkspace::initialize() {
|
|||
}
|
||||
|
||||
Error GDScriptWorkspace::parse_script(const String &p_path, const String &p_content) {
|
||||
|
||||
ExtendGDScriptParser *parser = memnew(ExtendGDScriptParser);
|
||||
Error err = parser->parse(p_content, p_path);
|
||||
Map<String, ExtendGDScriptParser *>::Element *last_parser = parse_results.find(p_path);
|
||||
Map<String, ExtendGDScriptParser *>::Element *last_script = scripts.find(p_path);
|
||||
|
||||
if (err == OK) {
|
||||
|
||||
remove_cache_parser(p_path);
|
||||
parse_results[p_path] = parser;
|
||||
scripts[p_path] = parser;
|
||||
|
|
@ -398,7 +394,6 @@ void GDScriptWorkspace::_get_owners(EditorFileSystemDirectory *efsd, String p_pa
|
|||
}
|
||||
|
||||
for (int i = 0; i < efsd->get_file_count(); i++) {
|
||||
|
||||
Vector<String> deps = efsd->get_file_deps(i);
|
||||
bool found = false;
|
||||
for (int j = 0; j < deps.size(); j++) {
|
||||
|
|
@ -434,7 +429,6 @@ Node *GDScriptWorkspace::_get_owner_scene_node(String p_path) {
|
|||
}
|
||||
|
||||
void GDScriptWorkspace::completion(const lsp::CompletionParams &p_params, List<ScriptCodeCompletionOption> *r_options) {
|
||||
|
||||
String path = get_file_path(p_params.textDocument.uri);
|
||||
String call_hint;
|
||||
bool forced = false;
|
||||
|
|
@ -450,12 +444,10 @@ void GDScriptWorkspace::completion(const lsp::CompletionParams &p_params, List<S
|
|||
}
|
||||
|
||||
const lsp::DocumentSymbol *GDScriptWorkspace::resolve_symbol(const lsp::TextDocumentPositionParams &p_doc_pos, const String &p_symbol_name, bool p_func_requred) {
|
||||
|
||||
const lsp::DocumentSymbol *symbol = NULL;
|
||||
|
||||
String path = get_file_path(p_doc_pos.textDocument.uri);
|
||||
if (const ExtendGDScriptParser *parser = get_parse_result(path)) {
|
||||
|
||||
String symbol_identifier = p_symbol_name;
|
||||
Vector<String> identifier_parts = symbol_identifier.split("(");
|
||||
if (identifier_parts.size()) {
|
||||
|
|
@ -470,19 +462,14 @@ const lsp::DocumentSymbol *GDScriptWorkspace::resolve_symbol(const lsp::TextDocu
|
|||
}
|
||||
|
||||
if (!symbol_identifier.empty()) {
|
||||
|
||||
if (ScriptServer::is_global_class(symbol_identifier)) {
|
||||
|
||||
String class_path = ScriptServer::get_global_class_path(symbol_identifier);
|
||||
symbol = get_script_symbol(class_path);
|
||||
|
||||
} else {
|
||||
|
||||
ScriptLanguage::LookupResult ret;
|
||||
if (OK == GDScriptLanguage::get_singleton()->lookup_code(parser->get_text_for_lookup_symbol(pos, symbol_identifier, p_func_requred), symbol_identifier, path, NULL, ret)) {
|
||||
|
||||
if (ret.type == ScriptLanguage::LookupResult::RESULT_SCRIPT_LOCATION) {
|
||||
|
||||
String target_script_path = path;
|
||||
if (!ret.script.is_null()) {
|
||||
target_script_path = ret.script->get_path();
|
||||
|
|
@ -493,7 +480,6 @@ const lsp::DocumentSymbol *GDScriptWorkspace::resolve_symbol(const lsp::TextDocu
|
|||
}
|
||||
|
||||
} else {
|
||||
|
||||
String member = ret.class_member;
|
||||
if (member.empty() && symbol_identifier != ret.class_name) {
|
||||
member = symbol_identifier;
|
||||
|
|
@ -511,10 +497,8 @@ const lsp::DocumentSymbol *GDScriptWorkspace::resolve_symbol(const lsp::TextDocu
|
|||
}
|
||||
|
||||
void GDScriptWorkspace::resolve_related_symbols(const lsp::TextDocumentPositionParams &p_doc_pos, List<const lsp::DocumentSymbol *> &r_list) {
|
||||
|
||||
String path = get_file_path(p_doc_pos.textDocument.uri);
|
||||
if (const ExtendGDScriptParser *parser = get_parse_result(path)) {
|
||||
|
||||
String symbol_identifier;
|
||||
Vector2i offset;
|
||||
symbol_identifier = parser->get_identifier_under_position(p_doc_pos.position, offset);
|
||||
|
|
@ -538,7 +522,6 @@ void GDScriptWorkspace::resolve_related_symbols(const lsp::TextDocumentPositionP
|
|||
const HashMap<String, ClassMembers> &inner_classes = script->get_inner_classes();
|
||||
const String *_class = inner_classes.next(NULL);
|
||||
while (_class) {
|
||||
|
||||
const ClassMembers *inner_class = inner_classes.getptr(*_class);
|
||||
if (const lsp::DocumentSymbol *const *symbol = inner_class->getptr(symbol_identifier)) {
|
||||
r_list.push_back(*symbol);
|
||||
|
|
@ -551,7 +534,6 @@ void GDScriptWorkspace::resolve_related_symbols(const lsp::TextDocumentPositionP
|
|||
}
|
||||
|
||||
const lsp::DocumentSymbol *GDScriptWorkspace::resolve_native_symbol(const lsp::NativeSymbolInspectParams &p_params) {
|
||||
|
||||
if (Map<StringName, lsp::DocumentSymbol>::Element *E = native_symbols.find(p_params.native_class)) {
|
||||
const lsp::DocumentSymbol &symbol = E->get();
|
||||
if (p_params.symbol_name.empty() || p_params.symbol_name == symbol.name) {
|
||||
|
|
@ -587,12 +569,10 @@ Dictionary GDScriptWorkspace::generate_script_api(const String &p_path) {
|
|||
|
||||
Error GDScriptWorkspace::resolve_signature(const lsp::TextDocumentPositionParams &p_doc_pos, lsp::SignatureHelp &r_signature) {
|
||||
if (const ExtendGDScriptParser *parser = get_parse_result(get_file_path(p_doc_pos.textDocument.uri))) {
|
||||
|
||||
lsp::TextDocumentPositionParams text_pos;
|
||||
text_pos.textDocument = p_doc_pos.textDocument;
|
||||
|
||||
if (parser->get_left_function_call(p_doc_pos.position, text_pos.position, r_signature.activeParameter) == OK) {
|
||||
|
||||
List<const lsp::DocumentSymbol *> symbols;
|
||||
|
||||
if (const lsp::DocumentSymbol *symbol = resolve_symbol(text_pos)) {
|
||||
|
|
@ -604,7 +584,6 @@ Error GDScriptWorkspace::resolve_signature(const lsp::TextDocumentPositionParams
|
|||
for (List<const lsp::DocumentSymbol *>::Element *E = symbols.front(); E; E = E->next()) {
|
||||
const lsp::DocumentSymbol *symbol = E->get();
|
||||
if (symbol->kind == lsp::SymbolKind::Method || symbol->kind == lsp::SymbolKind::Function) {
|
||||
|
||||
lsp::SignatureInformation signature_info;
|
||||
signature_info.label = symbol->detail;
|
||||
signature_info.documentation = symbol->render();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue