mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 05:31:01 +00:00 
			
		
		
		
	GDScript LSP: Implement signatureHelp
Enable smart resolve default to true as it is required for script symbol lookup
This commit is contained in:
		
							parent
							
								
									bdcfc6d633
								
							
						
					
					
						commit
						d35c018a7a
					
				
					 8 changed files with 232 additions and 1 deletions
				
			
		|  | @ -50,6 +50,7 @@ void GDScriptTextDocument::_bind_methods() { | |||
| 	ClassDB::bind_method(D_METHOD("hover"), &GDScriptTextDocument::hover); | ||||
| 	ClassDB::bind_method(D_METHOD("definition"), &GDScriptTextDocument::definition); | ||||
| 	ClassDB::bind_method(D_METHOD("declaration"), &GDScriptTextDocument::declaration); | ||||
| 	ClassDB::bind_method(D_METHOD("signatureHelp"), &GDScriptTextDocument::signatureHelp); | ||||
| 	ClassDB::bind_method(D_METHOD("show_native_symbol_in_editor"), &GDScriptTextDocument::show_native_symbol_in_editor); | ||||
| } | ||||
| 
 | ||||
|  | @ -387,6 +388,20 @@ Variant GDScriptTextDocument::declaration(const Dictionary &p_params) { | |||
| 	return arr; | ||||
| } | ||||
| 
 | ||||
| Variant GDScriptTextDocument::signatureHelp(const Dictionary &p_params) { | ||||
| 	Variant ret; | ||||
| 
 | ||||
| 	lsp::TextDocumentPositionParams params; | ||||
| 	params.load(p_params); | ||||
| 
 | ||||
| 	lsp::SignatureHelp s; | ||||
| 	if (OK == GDScriptLanguageProtocol::get_singleton()->get_workspace()->resolve_signature(params, s)) { | ||||
| 		ret = s.to_json(); | ||||
| 	} | ||||
| 
 | ||||
| 	return ret; | ||||
| } | ||||
| 
 | ||||
| GDScriptTextDocument::GDScriptTextDocument() { | ||||
| 	file_checker = FileAccess::create(FileAccess::ACCESS_RESOURCES); | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 geequlim
						geequlim