Skip to content

d.bs comments are in wrong spot #57

@TwitchBronBron

Description

@TwitchBronBron

The namespace-wrapping logic for d.bs files needs to wrap around the leading documentation blocks. Consider this raw d.bs file from node_modules

' /**
' * Adds two numbers.
' * @category Math
' * @param {Dynamic} augend - The first number in an addition
' * @param {Dynamic} addend - The second number in an addition
' * @returns {Dynamic} value - Returns the total
' */
function add(augend, addend)
end function

ropm incorrectly transforms it to this:

' /**
' * Adds two numbers.
' * @category Math
' * @param {Dynamic} augend - The first number in an addition
' * @param {Dynamic} addend - The second number in an addition
' * @returns {Dynamic} value - Returns the total
' */
namespace rodash
    function add(augend, addend)
    end function
end namespace

when it should have been this:

namespace rodash
    ' /**
    ' * Adds two numbers.
    ' * @category Math
    ' * @param {Dynamic} augend - The first number in an addition
    ' * @param {Dynamic} addend - The second number in an addition
    ' * @returns {Dynamic} value - Returns the total
    ' */
    function add(augend, addend)
    end function
end namespace

I think this is the spot that needs updated. We need to walk upwards to set the starting line above any leading comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions