Skip to content

Add TypeScript comments in typescript declarations#37

Merged
ivanbuhov merged 3 commits intomasterfrom
buhov/jsdoc-in-typescript
Feb 4, 2016
Merged

Add TypeScript comments in typescript declarations#37
ivanbuhov merged 3 commits intomasterfrom
buhov/jsdoc-in-typescript

Conversation

@ivanbuhov
Copy link
Copy Markdown
Contributor

@ivanbuhov
Copy link
Copy Markdown
Contributor Author

In order to parse doc information from XML files, a dependecy to LibXML2 was introduced. Prefer avoiding additional dependecies but didn't find XML parsing library in LLVM and there is no such in STL.

@ivanbuhov ivanbuhov self-assigned this Nov 26, 2015
@ivanbuhov ivanbuhov force-pushed the buhov/jsdoc-in-typescript branch 2 times, most recently from 8f9f07a to 74da208 Compare November 27, 2015 17:51
@ivanbuhov ivanbuhov force-pushed the buhov/jsdoc-in-typescript branch 3 times, most recently from 6b128e2 to 7ddafe5 Compare February 1, 2016 14:28
@ivanbuhov ivanbuhov changed the title Add JSDoc comments in typescript declarations Add TypeScript comments in typescript declarations Feb 1, 2016
@ivanbuhov ivanbuhov force-pushed the buhov/jsdoc-in-typescript branch from 7ddafe5 to f1a40a9 Compare February 1, 2016 15:58
Comment thread src/main.cpp Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be best to not try to compute the docset path inside the metadata generator. I think it would be better to do it in the python script that drives the metadata generator, because it can access the EFFECTIVE_PLATFORM_NAME build setting in Xcode in order to find the docset for the right platform.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense ;)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fealebenpae This makes sense but I didn't manage to find a platform specific docset package. Also, Xcode doesn't give you the option to choose between iOS doc for device and iOS doc for emulator. Also, the name of the docset package doesn't hint a specific platform, so I came to conclusion that the docset package is the same for device and simulator. Am I missing something?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rather meant that we should not hardcode to the iOS docset so as to be able to support tvOS, watchOS and macosx down the line. Maybe EFFECTIVE_PLATFORM_NAME is not the correct build setting because of the simulator thing and in that case we should find a way to correctly infer the docset we need.

@fealebenpae
Copy link
Copy Markdown
Contributor

Looks good to me.

ping @jasssonpet @KristinaKoeva

@jasssonpet
Copy link
Copy Markdown
Contributor

We should note in the docs, that in order for this to work, the user should download the iOS documentation from Xcode first.

Comment thread src/TypeScript/DocSetManager.cpp Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can wrap all these helper functions in an anonymous namespace, if you'd like.

@ivanbuhov ivanbuhov force-pushed the buhov/jsdoc-in-typescript branch 2 times, most recently from 37a6384 to 79ecb41 Compare February 2, 2016 11:36
Comment thread src/TypeScript/DocSetManager.cpp Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should free the context, too?

@ivanbuhov
Copy link
Copy Markdown
Contributor Author

I agree with the comments ... will fix the issues ;)

@ivanbuhov ivanbuhov force-pushed the buhov/jsdoc-in-typescript branch from 79ecb41 to 1f68db9 Compare February 2, 2016 11:52
@ivanbuhov
Copy link
Copy Markdown
Contributor Author

@ivanbuhov ivanbuhov force-pushed the buhov/jsdoc-in-typescript branch from ad0dc0a to 145421a Compare February 3, 2016 09:39
@KristinaKoeva
Copy link
Copy Markdown
Contributor

Looks good to me too

@ivanbuhov ivanbuhov force-pushed the buhov/jsdoc-in-typescript branch from 145421a to e0f2d12 Compare February 4, 2016 13:22
ivanbuhov added a commit that referenced this pull request Feb 4, 2016
Add TypeScript comments in typescript declarations
@ivanbuhov ivanbuhov merged commit e1049b1 into master Feb 4, 2016
@ivanbuhov ivanbuhov deleted the buhov/jsdoc-in-typescript branch February 4, 2016 13:26

_buffer << std::endl << "\tdeclare class " << meta->jsName << getTypeParametersStringOrEmpty(clang::cast<clang::ObjCInterfaceDecl>(meta->declaration));
_buffer << std::endl
<< _docSet.getCommentFor(meta).toString("\t") << "\tdeclare class " << getTypeParametersStringOrEmpty(clang::cast<clang::ObjCInterfaceDecl>(meta->declaration));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the class name is missing here 😄

Here is the declaration for NSObject:

declare class  implements NSObjectProtocol {
    // ...
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, it's missing 😄 ... i have missed that one when merging ;)

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

Successfully merging this pull request may close these issues.

4 participants