Skip to content
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

fix: update IntelliJ platform to 2024.1 #61

Merged
merged 1 commit into from
Sep 20, 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
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ kotlin {
}

intellijPlatform {
buildSearchableOptions = true
pluginConfiguration {
name = "Git extended update-index"
ideaVersion {
Expand All @@ -37,7 +38,7 @@ intellijPlatform {

dependencies {
intellijPlatform {
create("IC", "2022.3")
create(type = "IC", version = "2024.1", useInstaller = false)
bundledPlugin("Git4Idea")

pluginVerifier()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.github.monosoul.git.updateindex.extended.ExtendedUpdateIndexCommand.SKIP_WORKTREE
import com.github.monosoul.git.updateindex.extended.support.CommandInvoker
import com.github.monosoul.git.updateindex.extended.support.PresentationUpdater
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.Presentation
import com.intellij.openapi.diagnostic.debug
Expand All @@ -19,6 +20,8 @@

private val logger = thisLogger()

override fun getActionUpdateThread() = ActionUpdateThread.BGT

Check warning on line 23 in src/main/kotlin/com/github/monosoul/git/updateindex/extended/ExtendedUpdateIndexAction.kt

View check run for this annotation

Codecov / codecov/patch

src/main/kotlin/com/github/monosoul/git/updateindex/extended/ExtendedUpdateIndexAction.kt#L23

Added line #L23 was not covered by tests

override fun update(event: AnActionEvent) {
event.run {
project?.updatePresentation(presentation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.github.monosoul.git.updateindex.extended.changes.view.Constants.PROPERTY
import com.github.monosoul.git.updateindex.extended.support.PresentationUpdater
import com.intellij.ide.util.PropertiesComponent
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.Presentation
import com.intellij.openapi.actionSystem.ToggleAction
Expand All @@ -15,6 +16,8 @@

private val logger = logger<ToggleSkippedWorktreeAction>()

override fun getActionUpdateThread() = ActionUpdateThread.BGT

Check warning on line 19 in src/main/kotlin/com/github/monosoul/git/updateindex/extended/changes/view/ToggleSkippedWorktreeAction.kt

View check run for this annotation

Codecov / codecov/patch

src/main/kotlin/com/github/monosoul/git/updateindex/extended/changes/view/ToggleSkippedWorktreeAction.kt#L19

Added line #L19 was not covered by tests

override fun update(event: AnActionEvent) {
super.update(event)
event.run {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ internal class UpdateIndexLineHandlerFactoryTest {
every { gitExecutableManager.tryGetVersion(any()) } returns CAN_NOT_OVERRIDE_GIT_CONFIG_FOR_COMMAND
every { gitExecutableManager.getExecutable(project) } returns gitExecutable
every { gitExecutable.exePath } returns exePath
every { gitExecutable.isLocal } returns true
}

@AfterEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ internal class GetSkippedWorktreeFilesTaskTest {
}

expectThat(captor.captured) {
get { printableCommandLine() } isEqualTo "git ls-files -v"
get { printableCommandLine() } isEqualTo "\"\" ls-files -v"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@ import com.intellij.mock.MockApplication
import com.intellij.mock.MockLocalFileSystem
import com.intellij.mock.MockProject
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.AsyncExecutionService
import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapi.util.Disposer.dispose
import com.intellij.openapi.vcs.FilePath
import com.intellij.openapi.vcs.LocalFilePath
import com.intellij.openapi.vcs.actions.VcsContextFactory
import com.intellij.openapi.vcs.changes.ui.ChangesBrowserNode
import com.intellij.openapi.vcs.changes.ui.ChangesViewModelBuilder
import com.intellij.openapi.vcs.changes.ui.NoneChangesGroupingFactory
import com.intellij.openapi.vcs.changes.ui.TreeModelBuilder
import com.intellij.openapi.vfs.LocalFileSystem
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.vfs.VirtualFileManager
import com.intellij.peer.impl.VcsContextFactoryImpl
import io.mockk.Called
import io.mockk.every
import io.mockk.impl.annotations.MockK
Expand Down Expand Up @@ -53,6 +56,10 @@ internal class SkippedWorktreeChangesViewModifierTest {
private lateinit var project: MockProject
private lateinit var propertiesComponent: AppPropertyService
private lateinit var localFileSystem: MockLocalFileSystem
private lateinit var vcsContextFactory: VcsContextFactory

@MockK(relaxed = true)
private lateinit var asyncExecutionService: AsyncExecutionService

@MockK(relaxUnitFun = true)
private lateinit var progressManager: ProgressManager
Expand Down Expand Up @@ -82,6 +89,11 @@ internal class SkippedWorktreeChangesViewModifierTest {
application.registerService(virtualFileManager, parent)
every { virtualFileManager.getFileSystem(any()) } returns localFileSystem

vcsContextFactory = VcsContextFactoryImpl()
application.registerService(vcsContextFactory, parent)

application.registerService(asyncExecutionService, parent)

modifier = SkippedWorktreeChangesViewModifier(project)
}

Expand Down