Skip to content

Commit f49186f

Browse files
ammodevCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 5246fcb commit f49186f

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

  • surf-api-bukkit/surf-api-bukkit-api/src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/inventory/framework/view

surf-api-bukkit/surf-api-bukkit-api/src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/inventory/framework/view/SurfViewBuilder.kt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ import dev.slne.surf.surfapi.bukkit.api.inventory.framework.view.pagination.Abst
55
/**
66
* Creates a simple (non-paginated) [AbstractSurfView] using a DSL builder.
77
*
8-
* The [block] is called with both a [SurfViewContext] (for lifecycle hooks and settings)
9-
* and a [SurfViewRef] (for accessing the view inside callbacks) as context receivers.
10-
* After the block executes, the concrete view implementation is instantiated and the
11-
* reference is resolved.
8+
* The [block] is called with a [SurfViewContext] as its context receiver, which exposes
9+
* lifecycle hooks and view settings for configuration. After the block executes, the
10+
* concrete view implementation is instantiated and its internal reference is resolved.
1211
*
1312
* ```kotlin
1413
* val myView = surfView("Inventory Title") {
@@ -25,7 +24,7 @@ import dev.slne.surf.surfapi.bukkit.api.inventory.framework.view.pagination.Abst
2524
* ```
2625
*
2726
* @param header the plain-text title rendered in the inventory header
28-
* @param block DSL configuration block accepting both [SurfViewContext] and [SurfViewRef]
27+
* @param block DSL configuration block with [SurfViewContext] as its context receiver
2928
* @return the fully configured [AbstractSurfView]
3029
* @see paginatedSurfView
3130
* @see AbstractSurfView
@@ -47,9 +46,9 @@ inline fun surfView(header: String, block: context (SurfViewContext) () -> Unit)
4746
/**
4847
* Creates a paginated [AbstractPaginatedSurfView] using a DSL builder.
4948
*
50-
* Works the same as [surfView] but accepts a [PaginatedSurfViewContext] and
51-
* [PaginatedSurfViewRef]. The [block] must configure at least a `layoutTarget` character
52-
* and a `pagination { }` block, otherwise [IllegalStateException] is thrown at view creation.
49+
* Works similarly to [surfView] but uses a [PaginatedSurfViewContext] as the context
50+
* receiver. The [block] must configure at least a `layoutTarget` character and a
51+
* `pagination { }` block, otherwise [IllegalStateException] is thrown at view creation.
5352
*
5453
* ```kotlin
5554
* val listView = paginatedSurfView("Item List") {
@@ -68,7 +67,7 @@ inline fun surfView(header: String, block: context (SurfViewContext) () -> Unit)
6867
* ```
6968
*
7069
* @param header the plain-text title rendered in the inventory header
71-
* @param block DSL configuration block accepting both [PaginatedSurfViewContext] and [PaginatedSurfViewRef]
70+
* @param block DSL configuration block with [PaginatedSurfViewContext] as its context receiver
7271
* @return the fully configured [AbstractPaginatedSurfView]
7372
* @see surfView
7473
* @see dev.slne.surf.surfapi.bukkit.api.inventory.framework.view.pagination.AbstractPaginatedSurfView

0 commit comments

Comments
 (0)