Skip to content
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

GDScript: Fix and improve doc comment parsing #81699

Merged

Conversation

dalexeev
Copy link
Member

1. Handle annotations correctly.

2. Handle inline doc comments on multiline declarations. Now this works:

func my_func(): ## Doc.
    pass

class MyClass: ## Doc.
    pass

3. Handle the case of multiple declarations on the same line.

4. Add @tag support for inline doc comments.

Test script
## desc 1
var a1; var a2; var a3 ## desc 2

var b1; var b2; var b3 ## desc 3

## desc 4
var c1; var c2; var c3

enum E1 { A, B, C } ## desc 5

## desc 6
enum E2 { A, B, C }

enum E3 { ## desc 7
    A, B, C
}

enum E4 {
    ## desc 8
    A, B, C
}

enum E5 {
    A, B, C ## desc 9
}

enum E6 {
    A,
    B, ## desc 10
    C,
}

enum E7 { ## desc 11
    A, ## desc 12
    B, ## desc 13
    C, ## desc 14
}

@dalexeev dalexeev force-pushed the gds-fix-and-improve-doc-comment-parsing branch from f50c264 to 072e9c5 Compare September 16, 2023 14:32
Copy link
Member

@adamscott adamscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by the GDScript team. It even reduces the number of lines! That's awesome, thanks @dalexeev

@akien-mga akien-mga merged commit 281439c into godotengine:master Sep 20, 2023
16 checks passed
@dalexeev dalexeev deleted the gds-fix-and-improve-doc-comment-parsing branch September 20, 2023 11:13
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment