File tree Expand file tree Collapse file tree
src/main/kotlin/com/github/lppedd/cc Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,4 +18,10 @@ internal object CCRegistry {
1818 else -> Locale .getDefault()
1919 }
2020 }
21+
22+ /* *
23+ * Returns whether support for inspecting the VCS log is enabled.
24+ */
25+ fun isVcsSupportEnabled (): Boolean =
26+ Registry .`is `(CC .Registry .VcsEnabled , false )
2127}
Original file line number Diff line number Diff line change 11package com.github.lppedd.cc.vcs
22
3- import com.github.lppedd.cc.CC
3+ import com.github.lppedd.cc.CCRegistry
44import com.github.lppedd.cc.filterNotBlank
55import com.github.lppedd.cc.parser.CCParser
66import com.github.lppedd.cc.parser.FooterTokens
77import com.github.lppedd.cc.parser.ValidToken
88import com.github.lppedd.cc.trim
99import com.intellij.openapi.components.service
1010import com.intellij.openapi.project.Project
11- import com.intellij.openapi.util.registry.Registry
1211import com.intellij.openapi.vcs.VcsConfiguration
1312import com.intellij.vcs.log.VcsCommitMetadata
1413import kotlin.math.max
@@ -74,7 +73,7 @@ internal class InternalRecentCommitsService(private val project: Project) : Rece
7473 }
7574
7675 private fun getOrderedVcsCommitMessages (): Collection <String > {
77- if (! Registry .` is `( CC . Registry . VcsEnabled , false )) {
76+ if (! CCRegistry .isVcsSupportEnabled( )) {
7877 return emptyList()
7978 }
8079
Original file line number Diff line number Diff line change 11package com.github.lppedd.cc.vcs
22
3- import com.github.lppedd.cc.CC
3+ import com.github.lppedd.cc.*
44import com.github.lppedd.cc.api.*
5- import com.github.lppedd.cc.filterNotBlank
6- import com.github.lppedd.cc.filterNotEmpty
75import com.github.lppedd.cc.parser.CCParser
86import com.github.lppedd.cc.parser.CommitTokens
97import com.github.lppedd.cc.parser.FooterTokens
108import com.github.lppedd.cc.parser.ValidToken
11- import com.github.lppedd.cc.trim
129import com.intellij.openapi.components.service
1310import com.intellij.openapi.project.Project
14- import com.intellij.openapi.util.registry.Registry
1511import javax.swing.Icon
1612import kotlin.text.RegexOption.MULTILINE
1713
@@ -129,7 +125,7 @@ internal class VcsCommitTokenProvider(project: Project)
129125 .filterNotEmpty()
130126
131127 private fun getOrderedVcsCommitMessages (): Sequence <String > {
132- if (! Registry .` is `( CC . Registry . VcsEnabled , false )) {
128+ if (! CCRegistry .isVcsSupportEnabled( )) {
133129 return emptySequence()
134130 }
135131
Original file line number Diff line number Diff line change 11package com.github.lppedd.cc.vcs
22
3- import com.github.lppedd.cc.CC
3+ import com.github.lppedd.cc.CCRegistry
44import com.intellij.openapi.application.ApplicationManager
55import com.intellij.openapi.components.service
66import com.intellij.openapi.project.DumbAware
77import com.intellij.openapi.project.Project
88import com.intellij.openapi.startup.ProjectActivity
9- import com.intellij.openapi.util.registry.Registry
109import com.intellij.openapi.vcs.ProjectLevelVcsManager
1110import com.intellij.openapi.vcs.VcsListener
1211
@@ -16,7 +15,7 @@ import com.intellij.openapi.vcs.VcsListener
1615internal class VcsStartupActivity : ProjectActivity , DumbAware {
1716 override suspend fun execute (project : Project ) {
1817 val vcsConfigListener = VcsListener {
19- if (Registry .` is `( CC . Registry . VcsEnabled , false )) {
18+ if (CCRegistry .isVcsSupportEnabled( )) {
2019 ApplicationManager .getApplication().executeOnPooledThread {
2120 val vcsHandler = project.service<VcsService >()
2221 vcsHandler.refresh()
You can’t perform that action at this time.
0 commit comments