{"action":"created","issue":{"url":"https://api.github.com/repos/marijnh/tern/issues/637","labels_url":"https://api.github.com/repos/marijnh/tern/issues/637/labels{/name}","comments_url":"https://api.github.com/repos/marijnh/tern/issues/637/comments","events_url":"https://api.github.com/repos/marijnh/tern/issues/637/events","html_url":"https://github.com/marijnh/tern/issues/637","id":106311620,"number":637,"title":"condense ignores @type-annotated properties with value null or undefined","user":{"login":"demonfiddler","id":14012347,"avatar_url":"https://avatars.githubusercontent.com/u/14012347?v=3","gravatar_id":"","url":"https://api.github.com/users/demonfiddler","html_url":"https://github.com/demonfiddler","followers_url":"https://api.github.com/users/demonfiddler/followers","following_url":"https://api.github.com/users/demonfiddler/following{/other_user}","gists_url":"https://api.github.com/users/demonfiddler/gists{/gist_id}","starred_url":"https://api.github.com/users/demonfiddler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demonfiddler/subscriptions","organizations_url":"https://api.github.com/users/demonfiddler/orgs","repos_url":"https://api.github.com/users/demonfiddler/repos","events_url":"https://api.github.com/users/demonfiddler/events{/privacy}","received_events_url":"https://api.github.com/users/demonfiddler/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-14T10:12:51Z","updated_at":"2015-09-22T08:43:20Z","closed_at":"2015-09-22T08:39:02Z","body":"Firstly, congratulations on an impressive product.\r\n\r\nI have a large (2.5MB) JavaScript library, generated from XSDs, for which I wish to provide tern support (in Tern Eclipse IDE, not that it's relevant). The JavaScript is JSDoc3-annotated with (@)constructor, extends, memberOf, type, name as appropriate.\r\n\r\nThe condense tool emits JSON descriptors for all the _types_ in my library but although these descriptors have metadata for _methods_ defined by the prototype, they lack metadata for _properties_ defined by the prototype; the constructors do not define any properties. So the resulting content assist, doc hovers, validation etc. is incomplete and inaccurate. By contrast, Tern's built-in descriptors (defs/browser.json, for example) have \"prototype\" properties that describe the members but, from what I can see, appear to be properties that were actually defined in the constructor rather than the prototype.\r\n\r\nUPDATE(1): I have subsequently discovered the reason why these properties are being ignored. If the property is unassigned, or is assigned the value null or undefined, the property does not get included in the condense output. From what I can tell, initializing the property to any value other than null or undefined is sufficient to ensure its inclusion in the output.\r\n\r\nUPDATE(2): Having spent an entire day stepping through the tern code in the debugger, I finally determined that the parseTypeOuter() function in doc_comment.js expects the type name to be enclosed in {} characters. Do this and everything works as expected. Unfortunately my generated JavaScript was not doing not do this because Eclipse JSDT content assist expects @type name without the {} characters! So much for standards..."},"comment":{"url":"https://api.github.com/repos/marijnh/tern/issues/comments/142215234","html_url":"https://github.com/marijnh/tern/issues/637#issuecomment-142215234","issue_url":"https://api.github.com/repos/marijnh/tern/issues/637","id":142215234,"user":{"login":"marijnh","id":144427,"avatar_url":"https://avatars.githubusercontent.com/u/144427?v=3","gravatar_id":"","url":"https://api.github.com/users/marijnh","html_url":"https://github.com/marijnh","followers_url":"https://api.github.com/users/marijnh/followers","following_url":"https://api.github.com/users/marijnh/following{/other_user}","gists_url":"https://api.github.com/users/marijnh/gists{/gist_id}","starred_url":"https://api.github.com/users/marijnh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marijnh/subscriptions","organizations_url":"https://api.github.com/users/marijnh/orgs","repos_url":"https://api.github.com/users/marijnh/repos","events_url":"https://api.github.com/users/marijnh/events{/privacy}","received_events_url":"https://api.github.com/users/marijnh/received_events","type":"User","site_admin":false},"created_at":"2015-09-22T08:43:20Z","updated_at":"2015-09-22T08:43:20Z","body":"So the rationale for this behavior is that things without value are probably not interesting. If it would be useful to you, I could add an option to disable it (I think we just have to add a few lines of code to the `if (!actual)` clause in the `reach` function) and expose that through the `condense` binary."}}