Skip to content

Commit cd4e640

Browse files
committed
Workaround to deal with changed API in Eclipse platform on Neon
1 parent 72e3de8 commit cd4e640

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

kotlin-eclipse-ui/src/org/jetbrains/kotlin/ui/search/KotlinQueryParticipant.kt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ import org.jetbrains.kotlin.ui.commands.findReferences.KotlinAndJavaSearchable
7676
import org.jetbrains.kotlin.ui.commands.findReferences.KotlinScoped
7777
import org.jetbrains.kotlin.psi.KtConstructor
7878
import org.jetbrains.kotlin.utils.addToStdlib.singletonOrEmptyList
79+
import org.eclipse.search2.internal.ui.text2.DefaultTextSearchQueryProvider
80+
import org.eclipse.search.ui.text.TextSearchQueryProvider.TextSearchInput
7981

8082
public class KotlinQueryParticipant : IQueryParticipant {
8183
override public fun search(requestor: ISearchRequestor, querySpecification: QuerySpecification, monitor: IProgressMonitor?) {
@@ -182,11 +184,22 @@ public class KotlinQueryParticipant : IQueryParticipant {
182184
}
183185

184186
private fun searchTextOccurrences(searchElement: SearchElement, filesScope: List<IFile>): ISearchResult? {
185-
val scope = FileTextSearchScope.newSearchScope(filesScope.toTypedArray(), null as Array<String?>?, false)
186187
val searchText = searchElement.getSearchText()
187188
if (searchText == null) return null
188189

189-
val query = FileSearchQuery(searchText, false, true, true, scope)
190+
val scope = FileTextSearchScope.newSearchScope(filesScope.toTypedArray(), null as Array<String?>?, false)
191+
192+
val query = DefaultTextSearchQueryProvider().createQuery(object : TextSearchInput() {
193+
override fun isWholeWordSearch(): Boolean = true
194+
195+
override fun getSearchText(): String = searchText
196+
197+
override fun isCaseSensitiveSearch(): Boolean = true
198+
199+
override fun isRegExSearch(): Boolean = false
200+
201+
override fun getScope(): FileTextSearchScope = scope
202+
})
190203

191204
query.run(null)
192205

0 commit comments

Comments
 (0)