mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 13:41:03 +00:00 
			
		
		
		
	Tweak unknown annotation GDScript error for @deprecated/@experimental/@tutorial
				
					
				
			These annotations don't exist at a source level, so the error messages point to the documentation comment syntax.
This commit is contained in:
		
							parent
							
								
									aa8d9b83f6
								
							
						
					
					
						commit
						6095a37d64
					
				
					 7 changed files with 31 additions and 1 deletions
				
			
		|  | @ -1624,7 +1624,15 @@ GDScriptParser::AnnotationNode *GDScriptParser::parse_annotation(uint32_t p_vali | |||
| 	bool valid = true; | ||||
| 
 | ||||
| 	if (!valid_annotations.has(annotation->name)) { | ||||
| 		push_error(vformat(R"(Unrecognized annotation: "%s".)", annotation->name)); | ||||
| 		if (annotation->name == "@deprecated") { | ||||
| 			push_error(R"("@deprecated" annotation does not exist. Use "## @deprecated: Reason here." instead.)"); | ||||
| 		} else if (annotation->name == "@experimental") { | ||||
| 			push_error(R"("@experimental" annotation does not exist. Use "## @experimental: Reason here." instead.)"); | ||||
| 		} else if (annotation->name == "@tutorial") { | ||||
| 			push_error(R"("@tutorial" annotation does not exist. Use "## @tutorial(Title): https://example.com" instead.)");
 | ||||
| 		} else { | ||||
| 			push_error(vformat(R"(Unrecognized annotation: "%s".)", annotation->name)); | ||||
| 		} | ||||
| 		valid = false; | ||||
| 	} | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Hugo Locurcio
						Hugo Locurcio