Skip to content

Add Language annotations for better IDE experience #861

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

Merged
merged 2 commits into from
Sep 16, 2024
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
@@ -1,5 +1,6 @@
package org.jetbrains.kotlinx.dataframe.api

import org.intellij.lang.annotations.Language
import org.jetbrains.kotlinx.dataframe.AnyFrame
import org.jetbrains.kotlinx.dataframe.ColumnsSelector
import org.jetbrains.kotlinx.dataframe.DataColumn
Expand Down Expand Up @@ -111,7 +112,9 @@ internal fun <T, C, R> Split<T, C>.by(

// region match

public fun <T, C : String?> Split<T, C>.match(regex: String): SplitWithTransform<T, C, String?> = match(regex.toRegex())
public fun <T, C : String?> Split<T, C>.match(
@Language("RegExp") regex: String,
): SplitWithTransform<T, C, String?> = match(regex.toRegex())

public fun <T, C : String?> Split<T, C>.match(regex: Regex): SplitWithTransform<T, C, String?> =
by {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.decodeFromStream
import org.intellij.lang.annotations.Language
import org.jetbrains.kotlinx.dataframe.AnyFrame
import org.jetbrains.kotlinx.dataframe.AnyRow
import org.jetbrains.kotlinx.dataframe.DataFrame
Expand Down Expand Up @@ -254,7 +255,7 @@ public fun DataRow.Companion.readJson(
@Refine
@Interpretable("ReadJsonStr")
public fun DataFrame.Companion.readJsonStr(
text: String,
@Language("json") text: String,
header: List<String> = emptyList(),
keyValuePaths: List<JsonPath> = emptyList(),
typeClashTactic: TypeClashTactic = ARRAY_AND_VALUE_COLUMNS,
Expand All @@ -269,7 +270,7 @@ public fun DataFrame.Companion.readJsonStr(
* @return [DataRow] from the given [text].
*/
public fun DataRow.Companion.readJsonStr(
text: String,
@Language("json") text: String,
header: List<String> = emptyList(),
keyValuePaths: List<JsonPath> = emptyList(),
typeClashTactic: TypeClashTactic = ARRAY_AND_VALUE_COLUMNS,
Expand Down
Loading