Skip to content

Commit

Permalink
Fix compatibility in tests with 2024.2
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPl292 committed Sep 5, 2024
1 parent 4c09ab4 commit 785688b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@

package org.jetbrains.plugins.ideavim.option

import com.intellij.openapi.components.ComponentManagerEx
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.fileEditor.FileEditorManager
import com.intellij.openapi.fileEditor.TextEditor
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx
import com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl
import com.intellij.platform.util.coroutines.childScope
import com.intellij.testFramework.fixtures.CodeInsightTestFixture
import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory
import com.intellij.testFramework.replaceService
Expand Down Expand Up @@ -61,8 +63,7 @@ class EffectiveOptionChangeListenerTest : VimTestCase() {
super.setUp(testInfo)

// Copied from FileEditorManagerTestCase to allow us to split windows
@Suppress("DEPRECATION")
manager = FileEditorManagerImpl(fixture.project, fixture.project.coroutineScope)
manager = FileEditorManagerImpl(fixture.project, (fixture.project as ComponentManagerEx).getCoroutineScope().childScope())
fixture.project.replaceService(FileEditorManager::class.java, manager, fixture.testRootDisposable)

// Create a new editor that will represent a new buffer in a separate window. It will have default values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@

package org.jetbrains.plugins.ideavim.option

import com.intellij.openapi.components.ComponentManagerEx
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.fileEditor.FileEditorManager
import com.intellij.openapi.fileEditor.TextEditor
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx
import com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl
import com.intellij.platform.util.coroutines.childScope
import com.intellij.testFramework.fixtures.CodeInsightTestFixture
import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory
import com.intellij.testFramework.replaceService
Expand Down Expand Up @@ -51,8 +53,7 @@ class OptionDeclaredScopeTest : VimTestCase() {
super.setUp(testInfo)

// Copied from FileEditorManagerTestCase to allow us to split windows
@Suppress("DEPRECATION")
manager = FileEditorManagerImpl(fixture.project, fixture.project.coroutineScope)
manager = FileEditorManagerImpl(fixture.project, (fixture.project as ComponentManagerEx).getCoroutineScope().childScope())
fixture.project.replaceService(FileEditorManager::class.java, manager, fixture.testRootDisposable)

// Create a new editor that will represent a new buffer in a separate window. It will have default values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package org.jetbrains.plugins.ideavim.option.overrides

import com.intellij.application.options.CodeStyle
import com.intellij.lang.Language
import com.intellij.openapi.components.ComponentManagerEx
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.editor.impl.SettingsImpl
import com.intellij.openapi.fileEditor.FileEditorManager
Expand Down Expand Up @@ -45,8 +46,7 @@ class TextWidthOptionMapperTest : VimTestCase() {
super.setUp(testInfo)

// Copied from FileEditorManagerTestCase to allow us to split windows
@Suppress("DEPRECATION")
val manager = FileEditorManagerImpl(fixture.project, fixture.project.coroutineScope.childScope())
val manager = FileEditorManagerImpl(fixture.project, (fixture.project as ComponentManagerEx).getCoroutineScope().childScope())
fixture.project.replaceService(FileEditorManager::class.java, manager, fixture.testRootDisposable)

configureByText("\n")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.jetbrains.plugins.ideavim.option.overrides

import com.intellij.openapi.components.ComponentManagerEx
import com.intellij.openapi.editor.ex.EditorSettingsExternalizable
import com.intellij.openapi.fileEditor.FileEditorManager
import com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl
Expand All @@ -34,8 +35,7 @@ class WrapOptionMapperTest : VimTestCase() {
super.setUp(testInfo)

// Copied from FileEditorManagerTestCase to allow us to split windows
@Suppress("DEPRECATION")
manager = FileEditorManagerImpl(fixture.project, fixture.project.coroutineScope.childScope())
manager = FileEditorManagerImpl(fixture.project, (fixture.project as ComponentManagerEx).getCoroutineScope().childScope())
fixture.project.replaceService(FileEditorManager::class.java, manager, fixture.testRootDisposable)

configureByText("\n")
Expand Down

0 comments on commit 785688b

Please sign in to comment.