documentalist
documentalist copied to clipboard
Duplicate documentation found when forward-referencing a class
This header excerpt:
@class RACStream;
/// A block which accepts a value from a RACStream and returns a new instance
/// of the same stream class.
///
/// Setting `stop` to `YES` will cause the bind to terminate after the returned
/// value. Returning `nil` will result in immediate termination.
typedef RACStream * (^RACStreamBindBlock)(id value, BOOL *stop);
/// An abstract class representing any stream of values.
///
/// This class represents a monad, upon which many stream-based operations can
/// be built.
///
/// When subclassing RACStream, only the methods in the main @interface body need
/// to be overridden.
@interface RACStream : NSObject
results in two documented entries for RACStream
:
DecNode (Just
# Summary: An abstract class representing any stream of values.
# Description:
This class represents a monad, upon which many stream-based operations can
be built.
When subclassing RACStream, only the methods in the main @interface body need
to be overridden.
) `RACStream` (Class []) [],
DecLeaf (Just
# Summary: A block which accepts a value from a RACStream and returns a new instance
of the same stream class.
# Description:
Setting `stop` to `YES` will cause the bind to terminate after the returned
value. Returning `nil` will result in immediate termination.
) `RACStreamBindBlock` (TypeAlias `foobar`),
DecNode (Just
# Summary: An abstract class representing any stream of values.
# Description:
This class represents a monad, upon which many stream-based operations can
be built.
When subclassing RACStream, only the methods in the main @interface body need
to be overridden.
) `RACStream` (Class []) […]
The second one is the only one with inner declarations, so that's what we should keep.
Do you want to return Nothing
if it is a Class
or Protocol
with no inside? In parseDecl
.
I think this is fair enough for now, because
@class MXObject : NSObject
// Nothing!
@end
is a really edge case. Does this occur in RAC even?
An empty class is completely valid. One does occur in RAC (though only after stripping a deprecated declaration):
// Represents one end of a RACChannel.
//
// An terminal is similar to a socket or pipe -- it represents one end of
// a connection (the RACChannel, in this case). Values sent to this terminal
// will _not_ be received by its subscribers. Instead, the values will be sent
// to the subscribers of the RACChannel's _other_ terminal.
//
// For example, when using the `followingTerminal`, _sent_ values can only be
// _received_ from the `leadingTerminal`, and vice versa.
//
// To make it easy to terminate a RACChannel, `error` and `completed` events
// sent to either terminal will be received by the subscribers of _both_
// terminals.
//
// Do not instantiate this class directly. Create a RACChannel instead.
@interface RACChannelTerminal : RACSignal <RACSubscriber>
@end
Ah ok then. Does clang have something to see if it is a forward declaration?
Probably. I've just been reading clang-c/Index.h
to find stuff like that.
clang_getCanonicalCursor
?
Yeah, I might throw that in.
I'm stuck. :/ I can't figure out how to compare them to see if this cursor is pointing to the canonical cursor.
There's a clang_equalCursors()
function.
This doesn't work. Everything is a canonicalCursor (or not).
https://github.com/jspahrsummers/documentalist/commit/f781bb2d4a8b0da32082211b682ccc4c372b562c
:stuck_out_tongue_closed_eyes:
(with FFI.isCanonical cxCursor == 0
or FFI.isCanonical cxCursor /= 0
).
Should we fold them and take the one with the most decls?…
Should we fold them and take the one with the most decls?
Yeah, I think that should work.
'clang_getCursorDefinition' looks like it will do it! I'm going to try it tomorrow.
I can't get super classes out in Class $ super objcClassRef ++ super objcProtocolRef ++ super firstRef
.
They are all (Class [])
.
Did you have any luck?
I meant to file that and forgot. See #34.