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

Render member extensions correctly #3374

Merged
merged 4 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,30 @@ public class SimpleAttr(
}

public enum class BasicTabbedContentType : TabbedContentType {
TYPE, CONSTRUCTOR, FUNCTION, PROPERTY, ENTRY, EXTENSION_PROPERTY, EXTENSION_FUNCTION
TYPE, CONSTRUCTOR,

// property/function here means a different things depending on parent:
// - if parent=package - describes just `top-level` property/function without receiver
// - if parent=classlike - describes `member` property/function,
// it could have receiver (becoming member extension property/function) or not (ordinary member property/function)
// for examples look at docs for `EXTENSION_PROPERTY`, `EXTENSION_FUNCTION`
FUNCTION, PROPERTY,

ENTRY,

// property/function here means a different things depending on parent,
// and not just `an extension property/function`:
// example 1: `fun Foo.bar()` - top-level extension function
// - on a page describing `Foo` class `bar` will have type=`EXTENSION_FUNCTION`
// - on a page describing package declarations `bar` will have type=`EXTENSION_FUNCTION`
// example 2: `object Namespace { fun Foo.bar() }` - member extension function
// - on a page describing `Foo` class `bar` will have type=`EXTENSION_FUNCTION`
// - on a page describing `Namespace` object `bar` will have type=`FUNCTION`
//
// These types are needed to separate member functions and extension function on classlike pages.
// The same split rules are also used
// when grouping functions/properties with the same name on pages for classlike and package
EXTENSION_PROPERTY, EXTENSION_FUNCTION
}

/**
Expand Down
2 changes: 0 additions & 2 deletions dokka-subprojects/plugin-base/api/plugin-base.api
Original file line number Diff line number Diff line change
Expand Up @@ -1375,8 +1375,6 @@ public class org/jetbrains/dokka/base/translators/documentables/DefaultPageCreat
public static synthetic fun contentForScope$default (Lorg/jetbrains/dokka/base/translators/documentables/DefaultPageCreator;Lorg/jetbrains/dokka/model/WithScope;Lorg/jetbrains/dokka/links/DRI;Ljava/util/Set;Ljava/util/List;ILjava/lang/Object;)Lorg/jetbrains/dokka/pages/ContentGroup;
protected fun contentForScopes (Ljava/util/List;Ljava/util/Set;Ljava/util/List;)Lorg/jetbrains/dokka/pages/ContentGroup;
public static synthetic fun contentForScopes$default (Lorg/jetbrains/dokka/base/translators/documentables/DefaultPageCreator;Ljava/util/List;Ljava/util/Set;Ljava/util/List;ILjava/lang/Object;)Lorg/jetbrains/dokka/pages/ContentGroup;
protected fun divergentBlock (Lorg/jetbrains/dokka/base/translators/documentables/PageContentBuilder$DocumentableContentBuilder;Ljava/lang/String;Ljava/util/Collection;Lorg/jetbrains/dokka/pages/ContentKind;Lorg/jetbrains/dokka/model/properties/PropertyContainer;)V
public static synthetic fun divergentBlock$default (Lorg/jetbrains/dokka/base/translators/documentables/DefaultPageCreator;Lorg/jetbrains/dokka/base/translators/documentables/PageContentBuilder$DocumentableContentBuilder;Ljava/lang/String;Ljava/util/Collection;Lorg/jetbrains/dokka/pages/ContentKind;Lorg/jetbrains/dokka/model/properties/PropertyContainer;ILjava/lang/Object;)V
protected fun getContentBuilder ()Lorg/jetbrains/dokka/base/translators/documentables/PageContentBuilder;
public final fun getCustomTagContentProviders ()Ljava/util/List;
public final fun getDocumentableAnalyzer ()Lorg/jetbrains/dokka/analysis/kotlin/internal/DocumentableSourceLanguageParser;
Expand Down
Loading
Loading