mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 21:51:22 +00:00 
			
		
		
		
	Makes LSP report new() as _init; fixes docstrings
This commit is contained in:
		
							parent
							
								
									8fb06b45d1
								
							
						
					
					
						commit
						ae3aec1dbc
					
				
					 3 changed files with 10 additions and 3 deletions
				
			
		|  | @ -603,7 +603,7 @@ 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 *GDScriptWorkspace::resolve_symbol(const lsp::TextDocumentPositionParams &p_doc_pos, const String &p_symbol_name, bool p_func_required) { | ||||
| 	const lsp::DocumentSymbol *symbol = nullptr; | ||||
| 
 | ||||
| 	String path = get_file_path(p_doc_pos.textDocument.uri); | ||||
|  | @ -628,7 +628,10 @@ const lsp::DocumentSymbol *GDScriptWorkspace::resolve_symbol(const lsp::TextDocu | |||
| 
 | ||||
| 			} 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, nullptr, ret)) { | ||||
| 				if (symbol_identifier == "new" && parser->get_lines()[p_doc_pos.position.line].replace(" ", "").replace("\t", "").find("new(") > -1) { | ||||
| 					symbol_identifier = "_init"; | ||||
| 				} | ||||
| 				if (OK == GDScriptLanguage::get_singleton()->lookup_code(parser->get_text_for_lookup_symbol(pos, symbol_identifier, p_func_required), symbol_identifier, path, nullptr, ret)) { | ||||
| 					if (ret.type == ScriptLanguage::LookupResult::RESULT_SCRIPT_LOCATION) { | ||||
| 						String target_script_path = path; | ||||
| 						if (!ret.script.is_null()) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Francois Belair
						Francois Belair