rokucommunity / brighterscript

A superset of Roku's BrightScript language
MIT License
160 stars 46 forks source link

Missing comments above functions having annotations #1274

Closed TwitchBronBron closed 1 month ago

TwitchBronBron commented 2 months ago

It seems that annotations block their comments from being included in the transpiled output. Here's a unit test showing the issue:


it.only('includes annotation comments with their statements', async () => {
    await testTranspile(`
        'comment1
        @annotation()
        'comment2
        function alpha()
        end function
        'comment3
        @annotation
        'comment4
        class Beta
        end class
        'comment5
        @annotation
        'comment6
        interface Charlie
        end interface
    `, `
        'comment1
        'comment2
        function alpha()
        end function
        function __Beta_builder()
            instance = {}
            instance.new = sub()
            end sub
            return instance
        end function
        'comment3
        'comment4
        function Beta()
            instance = __Beta_builder()
            instance.new()
            return instance
        end function
        'comment5
        'comment6
    `, undefined, 'source/main.bs');
});