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

Function shorthand syntax support? #678

Closed
bpatram opened this issue Feb 24, 2017 · 6 comments · Fixed by #679 or #681
Closed

Function shorthand syntax support? #678

bpatram opened this issue Feb 24, 2017 · 6 comments · Fixed by #679 or #681

Comments

@bpatram
Copy link

bpatram commented Feb 24, 2017

I'm running the latest version to date (4.0.0-beta.15).

It seems that when writing functions within an object using the shorthand notation that function does not get placed within its parent class when outputting documentation. See example below:

// myfile.js
import { LayoutView } from 'backbone.marionette';

/**
 * A neat layout view
 * @class BaseLayoutView
 * @augments Marionette.LayoutView
 */
export default LayoutView.extend(
	/** @lends BaseLayoutView.prototype */
	{
		/**
		 * My neat function
		 * @param {string} word your word
		 * @returns {string} your word but one better
		 */
		foo: function(word) {
			return word + 1;
		},
		/**
		 * My neat function
		 * @param {string} word your word
		 * @returns {string} your word but one better
		 */
		bar(word) {
			return word + 1;
		}
	}
)

Output after running: documentation build myfile.js -f html -o docs

baddoc

Notice how the bar function is not nested under the BaseLayoutView class. This only occurs when using the function shorthand notation.

@bpatram
Copy link
Author

bpatram commented Feb 24, 2017

It seems like this is still under development or consideration? #649

@tmcw
Copy link
Member

tmcw commented Feb 24, 2017

Yep, that's the tracking ticket. I'm working on a fix today.

tmcw added a commit that referenced this issue Feb 24, 2017
This extends findTarget and the membership interference steps, treating ObjectProperty within

var-assigned objects the same as we did for ObjectMethods. It also adds tests that specifically test

findTarget directly."

Fixes #649 and fixes

#678
@tmcw tmcw closed this as completed in #679 Feb 24, 2017
tmcw added a commit that referenced this issue Feb 24, 2017
This extends findTarget and the membership interference steps, treating ObjectProperty within var-assigned objects the same as we did for ObjectMethods. It also adds tests that specifically test findTarget directly.

Fixes #649 and fixes #678
@bpatram
Copy link
Author

bpatram commented Feb 24, 2017

@tmcw Running off the latest commit 802dc4c seems to have a slightly different, but still incorrect, output. See below (it uses the same code as before):

-users-bpatram-projects-satin-ui-doc-index html 1

Notice how bar is now defined twice but yet still not nested under the parent class.

@tmcw
Copy link
Member

tmcw commented Feb 24, 2017

Ugh, yeah, that's the lends support in action. @jfirebaugh any ideas? I'll dig into this but the lends support and its intention is new to me.

@tmcw tmcw reopened this Feb 24, 2017
@tmcw
Copy link
Member

tmcw commented Feb 24, 2017

Scratch that, I think I have a reasonable refactor in place locally.

@bpatram
Copy link
Author

bpatram commented Feb 24, 2017

@tmcw Seems to be working correctly with your last commit! Thanks so much for the fast turn around! Cheers!

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