You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/kotlin/org/domaframework/doma/intellij/contributor/sql/provider/SqlParameterCompletionProvider.kt
+51-19Lines changed: 51 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -119,7 +119,7 @@ class SqlParameterCompletionProvider : CompletionProvider<CompletionParameters>(
119
119
val blockElements = getAccessElementTextBlocks(originalPosition)
120
120
generateCompletionList(
121
121
blockElements,
122
-
pos.text,
122
+
pos,
123
123
originalFile,
124
124
result,
125
125
)
@@ -163,7 +163,11 @@ class SqlParameterCompletionProvider : CompletionProvider<CompletionParameters>(
163
163
var blocks:List<PsiElement> = emptyList()
164
164
// If the immediate parent is a for, if, elseif directive,
165
165
// get the field access element list from its own forward element.
166
-
val parent = targetElement.parent
166
+
val parent =
167
+
PsiTreeUtil.findFirstParent(targetElement) {
168
+
it.elementType !=SqlTypes.EL_ID_EXPR&&
169
+
it.elementType !=SqlTypes.EL_IDENTIFIER
170
+
}
167
171
if (parent isSqlElForDirective||
168
172
parent isSqlElIfDirective||
169
173
parent isSqlElElseifDirective
@@ -202,7 +206,15 @@ class SqlParameterCompletionProvider : CompletionProvider<CompletionParameters>(
0 commit comments