Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
acharneski committed Nov 13, 2023
1 parent 00baa78 commit 2078120
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import kotlin.Pair
import org.jetbrains.annotations.NotNull
import org.jetbrains.annotations.Nullable

import static com.intellij.openapi.application.ActionsKt.runReadAction

class InsertImplementationAction extends SelectionAction<String> {

interface VirtualAPI {
Expand Down Expand Up @@ -88,12 +90,14 @@ class InsertImplementationAction extends SelectionAction<String> {
.reduce { a, b -> "$a $b" }.get()
if(null != state.psiFile) {
def code = UITools.run(state.project, "Insert Implementation", true, true, {
def psiClassContext = PsiClassContext.getContext(
def psiClassContext = runReadAction {
PsiClassContext.getContext(
state.psiFile,
psiClassContextActionParams.selectionStart,
psiClassContextActionParams.selectionEnd,
computerLanguage
).toString()
}
proxy.implementCode(
specification,
psiClassContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import java.util.stream.Collectors
class ActionSettingsRegistry {

val actionSettings: MutableMap<String, ActionSettings> = HashMap()
private val version = 1.91
private val version = 2.0001

fun edit(superChildren: Array<out AnAction>): Array<AnAction> {
val children = superChildren.toList().toMutableList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import kotlin.Pair
import org.jetbrains.annotations.NotNull
import org.jetbrains.annotations.Nullable

import static com.intellij.openapi.application.ActionsKt.runReadAction

class InsertImplementationAction extends SelectionAction<String> {

interface VirtualAPI {
Expand Down Expand Up @@ -88,12 +90,14 @@ class InsertImplementationAction extends SelectionAction<String> {
.reduce { a, b -> "$a $b" }.get()
if(null != state.psiFile) {
def code = UITools.run(state.project, "Insert Implementation", true, true, {
def psiClassContext = PsiClassContext.getContext(
def psiClassContext = runReadAction {
PsiClassContext.getContext(
state.psiFile,
psiClassContextActionParams.selectionStart,
psiClassContextActionParams.selectionEnd,
computerLanguage
).toString()
}
proxy.implementCode(
specification,
psiClassContext,
Expand Down

0 comments on commit 2078120

Please sign in to comment.