- 
                Notifications
    You must be signed in to change notification settings 
- Fork 45
Introduce custom JavaDoc tags #565 #585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
                
     Merged
            
            
          Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    
              
                    amandelpie
  
              
              reviewed
              
                  
                    Jul 27, 2022 
                  
              
              
            
            
        
          
                utbot-framework-api/src/main/kotlin/org/utbot/framework/UtSettings.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/visitor/CgAbstractRenderer.kt
          
            Show resolved
            Hide resolved
        
              
          
                utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/javadoc/UtJavaDocInfoGenerator.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocCommentBuilder.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
      55d9b35    to
    38ca8c6      
    Compare
  
    | I would like to discuss several things. 
 | 
              
                    Damtev
  
              
              previously requested changes
              
                  
                    Aug 8, 2022 
                  
              
              
            
            
        
          
                utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/Api.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/tree/CgElement.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/visitor/CgAbstractRenderer.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/javadoc/UtCustomJavaDocTagProvider.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/javadoc/UtCustomJavaDocTagProvider.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocCommentBuilder.kt
          
            Show resolved
            Hide resolved
        
              
          
                utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocCommentBuilder.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocCommentBuilder.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocTagProvider.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                utbot-summary/src/main/kotlin/org/utbot/summary/comment/SimpleCommentBuilder.kt
          
            Show resolved
            Hide resolved
        
      
              
                    Damtev
  
              
              reviewed
              
                  
                    Aug 8, 2022 
                  
              
              
            
            
| 
 
 | 
c067536    to
    22b6623      
    Compare
  
    
              
                    amandelpie
  
              
              reviewed
              
                  
                    Aug 22, 2022 
                  
              
              
            
            
              
                    amandelpie
  
              
              requested changes
              
                  
                    Aug 22, 2022 
                  
              
              
            
            
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make some minor changes
        
          
                utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/tree/CgElement.kt
          
            Show resolved
            Hide resolved
        
              
          
                utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/tree/CgElement.kt
          
            Show resolved
            Hide resolved
        
              
          
                utbot-summary/src/main/kotlin/org/utbot/summary/Summarization.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocCommentBuilder.kt
          
            Show resolved
            Hide resolved
        
              
          
                utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocCommentBuilder.kt
          
            Show resolved
            Hide resolved
        
      3723680    to
    7ad3155      
    Compare
  
    …erate comment content with HTML tags, we need only replace custom tags' names with their messages to make it look nice
5ceb39f    to
    bd616a9      
    Compare
  
    
              
                    amandelpie
  
              
              approved these changes
              
                  
                    Aug 24, 2022 
                  
              
              
            
            
The most part of requirements were implemented
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      Labels
      
    comp-summaries
  Something related to the method names, code comments and display names generation 
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Description
Introduce custom JavaDoc tags to make generated code comments structured.
@utbot.classUnderTest- Inline link to the enclosing class.@utbot.methodUnderTest- Inline link to the method we test.@utbot.expectedResult- Value we expect to get.@utbot.actualResult- Value we got.@utbot.executes- Executed condition.@utbot.invokes- Invoked method.@utbot.returnsFrom- Statement we return from.@utbot.throwsException- Thrown exception.The list of tags could be expanded
We show only tags that have some non-null value. After plugin's removal, IDE doesn't recognize our custom tags. It doesn't lead to errors, but highlights tags with yellow color.
TODO: Add a test in the intellij module in separate PR
TODO: @amandelpie suggested to add a tag for display name in (PR-624) in case of JUnit4 in separate PR.
TODO: After upgrading to 2022.1 fix comment rendering in separate PR by using default JavaDocInfoGenerator.
Fixes #565
Type of Change
How Has This Been Tested?
Automated Testing
Run tests
SummaryConditionsTest,SummaryMinStackTest,SummaryExceptionClusteringExamplesTest.Manual Scenario
Set
useFuzzing = falseanduseCustomJavaDocTags=trueinUtSettings.Case 1: check that tags are supported and shown in IDE.
@utbot-> you will notice that completion works and our custom tags are shown.Case 2: check that the plugin generates comments using custom tags.
Create tests with UTBotactionTested using runIde command.
Checklist (remove irrelevant options):