Skip to content

Commit

Permalink
fix: fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Aug 9, 2023
1 parent 4d65801 commit 24c3cd7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class CustomIntention(private val intentionConfig: CustomIntentionConfig) : Abst
SelectionVariableResolver(psiElement.language.displayName ?: "", selectedText),
) + SpecResolverService.getInstance().createResolvers()

val resolverMap = LinkedHashMap<String, VariableResolver>(10)
val resolverMap = LinkedHashMap<String, VariableResolver>(20)
for (resolver in variableResolvers) {
resolverMap[resolver.variableName()] = resolver
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ class SimilarChunkVariableResolver(val element: PsiElement) : VariableResolver {
override val type: CustomIntentionVariableType get() = CustomIntentionVariableType.SIMILAR_CHUNK

override fun resolve(): String {
return ReadAction.compute<String, Throwable> {
SimilarChunksWithPaths.createQuery(element, 256)
return try {
ReadAction.compute<String, Throwable> {
SimilarChunksWithPaths.createQuery(element, 256)
}
} catch (e: Throwable) {
""
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Invoke <b>AutoDev</b> Action in here.

0 comments on commit 24c3cd7

Please sign in to comment.