Skip to content

Commit

Permalink
Version 1.5.2. Fixed issue #18
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaikopernik committed Jul 2, 2024
1 parent 8059621 commit 35a5421
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

# Code Complexity Changelog

## [1.5.2]
- Fixed issue #18. Now complexity hints are visible only in the MAIN editor.

## [1.5.1]
- Support for IDEA 2024.2.EAP

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pluginGroup = com.github.nikolaikopernik.codecomplexity
pluginName = code-complexity-plugin
pluginRepositoryUrl = https://github.com/nikolaikopernik/code-complexity-plugin
# SemVer format -> https://semver.org
pluginVersion = 1.5.1
pluginVersion = 1.5.2

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 233
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,25 @@ import com.intellij.codeInsight.hints.InlayHintsSink
import com.intellij.codeInsight.hints.NoSettings
import com.intellij.codeInsight.hints.SettingsKey
import com.intellij.lang.Language
import com.intellij.openapi.diagnostic.LoggerRt
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.editor.EditorKind
import com.intellij.psi.PsiFile
import javax.swing.JPanel

@Suppress("UnstableApiUsage")
class ComplexityInlayHintsProvider(private val complexityInfoProvider: ComplexityInfoProvider) : InlayHintsProvider<NoSettings> {

private val logger = LoggerRt.getInstance(ComplexityInlayHintsProvider::class.java)

override fun getCollectorFor(file: PsiFile,
editor: Editor,
settings: NoSettings,
sink: InlayHintsSink): InlayHintsCollector {
sink: InlayHintsSink): InlayHintsCollector? {
if (editor.editorKind != EditorKind.MAIN_EDITOR) {
// we don't want to show hint in all the possible editors, only in MAIN
return null
}
return ComplexityFactoryInlayHintsCollector(complexityInfoProvider, editor)
}

Expand Down

0 comments on commit 35a5421

Please sign in to comment.