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

d.bs comments are in wrong spot #57

Open
TwitchBronBron opened this issue Sep 2, 2022 · 0 comments
Open

d.bs comments are in wrong spot #57

TwitchBronBron opened this issue Sep 2, 2022 · 0 comments

Comments

@TwitchBronBron
Copy link
Member

TwitchBronBron commented Sep 2, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant