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

Mixin documentation doesn't work #146

Closed
TrapII opened this issue Dec 22, 2017 · 5 comments
Closed

Mixin documentation doesn't work #146

TrapII opened this issue Dec 22, 2017 · 5 comments
Labels

Comments

@TrapII
Copy link

TrapII commented Dec 22, 2017

If I generate doc from this simple mixin 🔢

/**
 * Create an serialalizable class.
 * @mixin SerializeMixin
 * @param {*} superclass - The class to mix onto.
 * @return The mixin class.
 * @mixin SerialMixin
 */
const SerialMixin = (superclass) => class extends superclass {
  
  /**
   * Adds a string to the stream
   * @param {string} str - The string to append to the stream
   * @memberof SerialMixin#
   */
  addString(str) {
  }
}

This produce a result where the method names are prefixed with undefined : serialMixin.undefinedaddString(str).
I tried various combination (with lendof, ...) but the bug seems to be there whatever I tried.
The version of the jsdoc-to-markdown is 3.0.2. I also uses the dmd-bitbucket plugin in version 0.1.10.

There is a corresponding issue to this one in the jsdoc repository : here. But seems corrected.

@75lb
Copy link
Member

75lb commented Dec 22, 2017

Could you confirm the code you pasted documents as expected using jsdoc directly, please?

@lemnis
Copy link

lemnis commented Dec 24, 2017

Bumped into the same issue, the JSON of jsdoc reports as longname SerialMixin#addString and jsdoc2md reports SerialMixin#undefinedaddString.

Tested with jsdoc@3.5.5 and jsdoc-to-markdown@3.0.3

@75lb
Copy link
Member

75lb commented Dec 29, 2017

This is a jsdoc issue.. if you save the original post sample code into a file called issue-146.js and run this:

$ jsdoc -X issue-146.js

The output (below) contains undefinedaddString, which in turn appears in jsdoc2md output.

[
    {
        "comment": "/**\n * Create an serialalizable class.\n * @mixin SerializeMixin\n * @param {*} superclass - The class to mix onto.\n * @return The mixin class.\n * @mixin SerialMixin\n */",
        "meta": {
            "range": [
                0,
                167
            ],
            "filename": "issue-146.js",
            "lineno": 1,
            "path": "/Users/lloyd/Documents/jsdoc2md/testbed/tmp",
            "code": {}
        },
        "description": "Create an serialalizable class.",
        "kind": "mixin",
        "name": "SerialMixin",
        "params": [
            {
                "type": {
                    "names": [
                        "*"
                    ]
                },
                "description": "The class to mix onto.",
                "name": "superclass"
            }
        ],
        "returns": [
            {
                "description": "The mixin class."
            }
        ],
        "longname": "SerialMixin",
        "scope": "global"
    },
    {
        "comment": "",
        "meta": {
            "range": [
                174,
                391
            ],
            "filename": "issue-146.js",
            "lineno": 8,
            "path": "/Users/lloyd/Documents/jsdoc2md/testbed/tmp",
            "code": {
                "id": "astnode100000002",
                "name": "SerialMixin",
                "type": "ArrowFunctionExpression"
            },
            "vars": {
                "undefined": null
            }
        },
        "undocumented": true,
        "name": "SerialMixin",
        "longname": "SerialMixin",
        "kind": "function",
        "scope": "global"
    },
    {
        "comment": "/**\n   * Adds a string to the stream\n   * @param {string} str - The string to append to the stream\n   * @memberof SerialMixin#\n   */",
        "meta": {
            "range": [
                369,
                389
            ],
            "filename": "issue-146.js",
            "lineno": 15,
            "path": "/Users/lloyd/Documents/jsdoc2md/testbed/tmp",
            "code": {
                "id": "astnode100000009",
                "name": "undefinedaddString",
                "type": "MethodDefinition",
                "paramnames": [
                    "str"
                ]
            },
            "vars": {
                "": null
            }
        },
        "description": "Adds a string to the stream",
        "params": [
            {
                "type": {
                    "names": [
                        "string"
                    ]
                },
                "description": "The string to append to the stream",
                "name": "str"
            }
        ],
        "memberof": "SerialMixin",
        "name": "undefinedaddString",
        "longname": "SerialMixin#undefinedaddString",
        "kind": "function",
        "scope": "instance"
    },
    {
        "kind": "package",
        "longname": "package:undefined",
        "files": [
            "/Users/lloyd/Documents/jsdoc2md/testbed/tmp/issue-146.js"
        ]
    }
]

Please post an issue with the jsdoc project and link back to this issue. 👍

@75lb 75lb added the upstream label Dec 29, 2017
@lemnis
Copy link

lemnis commented Dec 29, 2017

Which version are you at? Its an issue that is fixed in 3.5.4. It's an issue with the (out of date) fork...

@75lb
Copy link
Member

75lb commented Jan 18, 2018

Fixed and released in v4.0.0 👍

@75lb 75lb closed this as completed Jan 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants