jsdoc
jsdoc copied to clipboard
Using a dot in an event name doesn't work anymore.
When using a dot . character in an event name, only the last part is shown.
Input code
/**
*/
class Foo {
}
/**
* Test Event
*
* @memberof Foo
* @event one.two
*/
JSDoc configuration
jsdoc .
JSDoc debug output
DEBUG: JSDoc 3.6.7 (Sat, 15 May 2021 01:24:54 GMT)
DEBUG: Environment info: {"env":{"conf":{"plugins":[],"recurseDepth":10,"source":{"includePattern":".+\\.js(doc|x)?$","excludePattern":"(^|\\/|\\\\)_"},"sourceType":"module","tags":{"allowUnknownTags":true,"dictionaries":["jsdoc","closure"]},"templates":{"monospaceLinks":false,"cleverLinks":false,"default":{"outputSourceFiles":true}}},"opts":{"_":["."],"debug":true,"destination":"./out/","encoding":"utf8"}}}
DEBUG: Parsing source files: ["/Users/emile/Desktop/test/test.js"]
Parsing /Users/emile/Desktop/test/test.js ...
DEBUG: Finished parsing source files.
DEBUG: Adding inherited symbols, mixins, and interface implementations...
DEBUG: Adding borrowed doclets...
DEBUG: Post-processing complete.
Generating output files...
Finished running in 0.10 seconds.
Expected behavior
I expected to have an event created one.two.
Current behavior
An event two was created.
Your environment
| Software | Version |
|---|---|
| JSDoc | 3.6.7 |
| Node.js | 16.0.0 |
| npm | 6.14.13 |
| Operating system | macOS 11 |
Hey @WeeJeWel how do you create an event, I am struggling with creating an event can you put some sample code that I can check, would love to test this bug too.
Hi have the same issue. I could find some StackOverflow posts related to this: https://stackoverflow.com/questions/27962224/how-to-handle-dots-in-event-names-with-fires-in-jsdoc & https://stackoverflow.com/questions/26482496/how-do-you-include-a-dot-in-names-events-callbacks-with-jsdoc.
Here is a repro case using the example from https://jsdoc.app/tags-event.html:
/**
* Throw a snowball.
*
* @fires Hurl#snowball.done
*/
Hurl.prototype.snowball = function() {
this.emit('snowball', {
isPacked: this._snowball.isPacked
});
};
/**
* Snowball event.
*
* @event Hurl#snowball.done
* @type {object}
* @property {boolean} isPacked - Indicates whether the snowball is tightly packed.
*/