code: document public API for detekt
- Commit
d9caa0fc765a0f463d3b32aebb59b20d83f6d97d- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-17 14:42 UTC (18 days ago)
- Parents
0878220
Add concise KDoc to every public class, object, interface and enum (including nested types) that detekt's UndocumentedPublicClass rule flagged in this module. Docs only: no behaviour, visibility or config changes. Verified: ./gradlew :code:detekt reports 0 UndocumentedPublicClass findings (pre-existing error-severity findings in other rules, where present, are untouched), and the module unit tests pass.
Diff
code/src/main/java/com/vayunmathur/code/MainActivity.kt
diff --git a/code/src/main/java/com/vayunmathur/code/MainActivity.kt b/code/src/main/java/com/vayunmathur/code/MainActivity.ktindex 5255820e64..ea52f59b88 100644--- a/code/src/main/java/com/vayunmathur/code/MainActivity.kt+++ b/code/src/main/java/com/vayunmathur/code/MainActivity.kt@@ -15,6 +15,7 @@ import com.vayunmathur.library.ui.IconFolderOpen import com.vayunmathur.library.ui.MaActivity import com.vayunmathur.library.ui.PermissionRequirement +/** Code editor host activity; handles VIEW/EDIT intents and applies the editor theme. */ class MainActivity : MaActivity() { private val viewModel: EditorViewModel by viewModels()
code/src/main/java/com/vayunmathur/code/Route.kt
diff --git a/code/src/main/java/com/vayunmathur/code/Route.kt b/code/src/main/java/com/vayunmathur/code/Route.ktindex b98fcec480..f0427d3f0f 100644--- a/code/src/main/java/com/vayunmathur/code/Route.kt+++ b/code/src/main/java/com/vayunmathur/code/Route.kt@@ -3,14 +3,18 @@ package com.vayunmathur.code import com.vayunmathur.library.util.NavKey import kotlinx.serialization.Serializable +/** Navigation destinations for the Code editor workspace. */ @Serializable sealed interface Route : NavKey {+ /** Main code-editor destination. */ @Serializable data object Editor : Route + /** Editor settings destination. */ @Serializable data object Settings : Route + /** Project-wide search destination. */ @Serializable data object Search : Route @@ -18,15 +22,19 @@ sealed interface Route : NavKey { @Serializable data class FolderBrowser(val path: String) : Route + /** Git panel destination. */ @Serializable data object Git : Route + /** Terminal destination. */ @Serializable data object Terminal : Route + /** File preview destination. */ @Serializable data object Preview : Route + /** Snippets destination. */ @Serializable data object Snippets : Route }
code/src/main/java/com/vayunmathur/code/data/EditorPrefs.kt
diff --git a/code/src/main/java/com/vayunmathur/code/data/EditorPrefs.kt b/code/src/main/java/com/vayunmathur/code/data/EditorPrefs.ktindex 26fea183ea..d886dc8b0e 100644--- a/code/src/main/java/com/vayunmathur/code/data/EditorPrefs.kt+++ b/code/src/main/java/com/vayunmathur/code/data/EditorPrefs.kt@@ -194,6 +194,7 @@ class EditorPrefs(context: Context) { appContext.editorDataStore.edit { it[GIT_AUTHOR_EMAIL_KEY] = value } } + /** Editor preference defaults and DataStore keys. */ companion object { const val DEFAULT_FONT_SIZE = 14 const val DEFAULT_TAB_WIDTH = 4
code/src/main/java/com/vayunmathur/code/domain/GitIgnore.kt
diff --git a/code/src/main/java/com/vayunmathur/code/domain/GitIgnore.kt b/code/src/main/java/com/vayunmathur/code/domain/GitIgnore.ktindex b06fc80dac..cf6c944ae1 100644--- a/code/src/main/java/com/vayunmathur/code/domain/GitIgnore.kt+++ b/code/src/main/java/com/vayunmathur/code/domain/GitIgnore.kt@@ -46,6 +46,7 @@ class GitIgnore internal constructor(private val rules: List<Rule>) { return ignored } + /** Shared empty [GitIgnore] matcher with no rules. */ companion object { val EMPTY = GitIgnore(emptyList()) }
code/src/main/java/com/vayunmathur/code/domain/syntax/SyntaxHighlighting.kt
diff --git a/code/src/main/java/com/vayunmathur/code/domain/syntax/SyntaxHighlighting.kt b/code/src/main/java/com/vayunmathur/code/domain/syntax/SyntaxHighlighting.ktindex f9e6f1a475..065ec4292c 100644--- a/code/src/main/java/com/vayunmathur/code/domain/syntax/SyntaxHighlighting.kt+++ b/code/src/main/java/com/vayunmathur/code/domain/syntax/SyntaxHighlighting.kt@@ -50,6 +50,7 @@ class LanguageSpec(private val parts: List<Pair<TokenKind, String>>) { } } +/** Languages the editor can highlight, with display label and line-comment prefix. */ enum class Language(val label: String, val lineCommentPrefix: String? = null) { KOTLIN("Kotlin", "//"), JAVA("Java", "//"),@@ -78,6 +79,7 @@ enum class Language(val label: String, val lineCommentPrefix: String? = null) { /** The tokenizer for this language, or null for languages we render without colors. */ val spec: LanguageSpec? by lazy { specFor(this) } + /** File-name to [Language] lookup, defaulting to plain text. */ companion object { /** Picks a language from a file name's extension, defaulting to plain text. */ fun fromFileName(name: String): Language {@@ -629,6 +631,7 @@ private fun matchingBracketIndex(text: String, index: Int): Int { /** A resolved colour span `[start, end)` from the native tree-sitter highlighter. */ data class TsColorSpan(val start: Int, val end: Int, val color: Color) +/** Compose transformation applying syntax, bracket and search-match spans to text. */ class SyntaxTransformation( private val spec: LanguageSpec?, private val colors: SyntaxColors,
code/src/main/java/com/vayunmathur/code/platform/CodeUiContract.kt
diff --git a/code/src/main/java/com/vayunmathur/code/platform/CodeUiContract.kt b/code/src/main/java/com/vayunmathur/code/platform/CodeUiContract.ktindex abcc730d7e..e4893d465f 100644--- a/code/src/main/java/com/vayunmathur/code/platform/CodeUiContract.kt+++ b/code/src/main/java/com/vayunmathur/code/platform/CodeUiContract.kt@@ -245,12 +245,14 @@ interface CodeSettingsActions { fun setAutoCloseBrackets(enabled: Boolean) {} } +/** Full editor action surface combining tab, tree, edit, search and settings actions. */ interface CodeActions : CodeTabActions, CodeTreeActions, CodeEditActions, CodeSearchActions, CodeSettingsActions {+ /** Shared no-op [CodeActions] implementation for previews and empty states. */ companion object { val Noop: CodeActions = object : CodeActions {} }