Skip to content
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
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Mitja Leino
Copyright (c) 2026 Mitja Leino

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 8 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2025 Mitja Leino
* Copyright (c) 2026 Mitja Leino
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -27,7 +27,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

// Use the same version and group for the jar and the plugin
val currentVersion = "2.4.1"
val currentVersion = "2.4.2"
val myGroup = "com.mituuz"
version = currentVersion
group = myGroup
Expand All @@ -39,6 +39,12 @@ intellijPlatform {

changeNotes = """
<h2>Version $currentVersion</h2>
<ul>
<li>
Update dependencies
</li>
</ul>
<h2>Version 2.4.1</h2>
<ul>
<li>
Add list rollover support
Expand Down
8 changes: 6 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Version 2.4.2

- Update dependencies

## Version 2.4.1

- Add list rollover support
Expand Down Expand Up @@ -321,5 +325,5 @@ nmap <Leader>sB <action>(com.mituuz.fuzzier.grep.FuzzyGrepCurrentBuffer)
## Earlier Versions

- Prior to version 0.19.0, numerous features and improvements were made, laying the foundation for the current version.
This includes initial development, various enhancements, and bug fixes. For detailed history,
please refer to commit logs or release notes.
This includes initial development, various enhancements, and bug fixes. For detailed history, please refer to commit
logs or release notes.
12 changes: 6 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[versions]
junit5 = "6.0.3"
junit5 = "6.1.2"
junit4 = "4.13.2"
kotlin = "2.3.21"
intellijPlatform = "2.15.0"
kover = "0.9.8"
communityVersion = "2025.1"
mockk = "1.14.9"
mockk = "1.14.11"

kotlin = "2.4.10"
intellijPlatform = "2.18.1"
kover = "0.9.9"

[libraries]
junit5Api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit5" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2025 Mitja Leino
* Copyright (c) 2026 Mitja Leino
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -26,13 +26,14 @@ package com.mituuz.fuzzier.ui.popup
import com.intellij.openapi.ui.popup.LightweightWindow
import com.intellij.openapi.ui.popup.LightweightWindowEvent
import com.intellij.testFramework.TestApplicationManager
import com.intellij.testFramework.fixtures.CodeInsightTestFixture
import com.intellij.testFramework.fixtures.IdeaProjectTestFixture
import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory
import com.intellij.testFramework.runInEdtAndWait
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertNull
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertNotNull
import java.awt.Dimension
import javax.swing.JLabel
import javax.swing.JPanel
Expand All @@ -42,7 +43,6 @@ class AutoSizePopupProviderTest {
private var testApplicationManager: TestApplicationManager = TestApplicationManager.getInstance()

private lateinit var fixture: IdeaProjectTestFixture
private lateinit var codeFixture: CodeInsightTestFixture

private lateinit var provider: AutoSizePopupProvider

Expand All @@ -54,29 +54,32 @@ class AutoSizePopupProviderTest {

@Test
fun `show returns null and exits when no IDE frame is available`() {
val factory = IdeaTestFixtureFactory.getFixtureFactory()
fixture = factory.createLightFixtureBuilder(null, "Test").fixture
codeFixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(fixture)
codeFixture.setUp()
val project = fixture.project
val content = JPanel()
val focus = JLabel("focus")
var cleared = false
val cfg = PopupConfig(
title = "Test",
dimensionKey = "fuzzier.test",
preferredSizeProvider = Dimension(800, 600),
resetWindow = { true },
clearResetWindowFlag = { cleared = true }
)
runInEdtAndWait {
val factory = IdeaTestFixtureFactory.getFixtureFactory()
fixture = factory.createLightFixtureBuilder(null, "Test").fixture
fixture.setUp()

try {
val popup = provider.show(project, content, focus, cfg) { /* cleanup */ }
assertNull(popup)
// No side-effects should occur since we exit early before using DimensionService
assertEquals(false, cleared)
} finally {
codeFixture.tearDown()
val project = fixture.project
val content = JPanel()
val focus = JLabel("focus")
var cleared = false
val cfg = PopupConfig(
title = "Test",
dimensionKey = "fuzzier.test",
preferredSizeProvider = Dimension(800, 600),
resetWindow = { true },
clearResetWindowFlag = { cleared = true })

assertNotNull(project, "Project should not be null")

try {
val popup = provider.show(project, content, focus, cfg) { /* cleanup */ }
assertNull(popup)
// No side-effects should occur since we exit early before using DimensionService
assertEquals(false, cleared)
} finally {
fixture.tearDown()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2025 Mitja Leino
* Copyright (c) 2026 Mitja Leino
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -27,13 +27,14 @@ package com.mituuz.fuzzier.ui.popup
import com.intellij.openapi.ui.popup.LightweightWindow
import com.intellij.openapi.ui.popup.LightweightWindowEvent
import com.intellij.testFramework.TestApplicationManager
import com.intellij.testFramework.fixtures.CodeInsightTestFixture
import com.intellij.testFramework.fixtures.IdeaProjectTestFixture
import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory
import com.intellij.testFramework.runInEdtAndWait
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertNull
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertNotNull
import java.awt.Dimension
import javax.swing.JLabel
import javax.swing.JPanel
Expand All @@ -44,7 +45,6 @@ class DefaultPopupProviderTest {

private lateinit var provider: DefaultPopupProvider
private lateinit var fixture: IdeaProjectTestFixture
private lateinit var codeFixture: CodeInsightTestFixture

@BeforeEach
fun setUp() {
Expand All @@ -54,30 +54,33 @@ class DefaultPopupProviderTest {
@Test
fun `show returns null and exits when no IDE frame is available`() {
// Set up a lightweight project fixture to get a Project instance
val factory = IdeaTestFixtureFactory.getFixtureFactory()
fixture = factory.createLightFixtureBuilder(null, "Test").fixture
codeFixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(fixture)
codeFixture.setUp()
val project = fixture.project
val content = JPanel()
val focus = JLabel("focus")
var cleared = false
val cfg = PopupConfig(
title = "Test",
dimensionKey = "fuzzier.test",
preferredSizeProvider = Dimension(800, 600),
resetWindow = { true },
clearResetWindowFlag = { cleared = true }
)
runInEdtAndWait {
val factory = IdeaTestFixtureFactory.getFixtureFactory()
fixture = factory.createLightFixtureBuilder(null, "Test").fixture
fixture.setUp()

try {
val popup = provider.show(project, content, focus, cfg) { /* cleanup */ }
// Should return null and not throw
assertNull(popup)
// Since we exit early due to missing IDE frame, ensure no side-effects were triggered
assertEquals(false, cleared)
} finally {
codeFixture.tearDown()
val project = fixture.project
val content = JPanel()
val focus = JLabel("focus")
var cleared = false
val cfg = PopupConfig(
title = "Test",
dimensionKey = "fuzzier.test",
preferredSizeProvider = Dimension(800, 600),
resetWindow = { true },
clearResetWindowFlag = { cleared = true })

assertNotNull(project, "Project should not be null")

try {
val popup = provider.show(project, content, focus, cfg) { /* cleanup */ }
// Should return null and not throw
assertNull(popup)
// Since we exit early due to missing IDE frame, ensure no side-effects were triggered
assertEquals(false, cleared)
} finally {
fixture.tearDown()
}
}
}

Expand Down
Loading