Skip to content

Add ColumnSelectionDsl.cols(vararg resolvers: ColumnsResolver) overload to help avoid code duplication #1788

@koperagen

Description

@koperagen

I'd like to be able to refactor code with multiple remove:

.remove { nameStartsWith("local") }
.remove { colsOf<Boolean>().nameStartsWith("has") }
.remove { colsOf<Int>().nameStartsWith("num") }
.remove { modifiers }
.remove { isInitialized and fullyQualifiedName }
.remove { moduleName and path and text }

to singular remove + cols with multiple arbitrary grouped selectors

remove {
  cols(
    nameStartsWith("local"),
    colsOf<Boolean>().nameStartsWith("has"),
    colsOf<Int>().nameStartsWith("num"),
    modifiers,
    isInitialized and fullyQualifiedName,
    moduleName and path and text,
  )
}

What's possible now:

.remove {
    nameStartsWith("local") and
        colsOf<Boolean>().nameStartsWith("has") and
        colsOf<Int>().nameStartsWith("num") and
        modifiers and
        isInitialized and fullyQualifiedName and
        moduleName and path and text
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIIf it touches our API

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions