Custom SearchScope is shown under a wrong SearchScopeProvider

Answered

Hi there,

I want to implement a ChooseByNameContributorEx, so that it could contribute custom Symbols to the Search Everywhere. These custom Symbols should be shown only if All SPARQL Endpoints search scope is selected.

The problem as you can see from the screenshot below is that All SPARQL Endpoints search scope is shown under Data Sources, not RDF and SPARQL

Why does it happen?

I cannot inspect the code of the Data Sources provider, because it's closed source.

The code of the search scope provider and search scope are below.

package com.sharedvocabs.plugins.rdfandsparql.sparql

import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.project.Project
import com.intellij.psi.search.SearchScope
import com.intellij.psi.search.SearchScopeProvider

class RDFAndSPARQLSearchScopeProvider : SearchScopeProvider {

    override fun getDisplayName(): String = "RDF and SPARQL"

    override fun getSearchScopes(project: Project, dataContext: DataContext): List<SearchScope> {
        return listOf(SPARQLEndpointSearchScope(project))
    }
}
package com.sharedvocabs.plugins.rdfandsparql.sparql

import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.psi.search.GlobalSearchScope
import com.sharedvocabs.plugins.rdfandsparql.icons.RDFAndSPARQLIcons
import javax.swing.Icon

class SPARQLEndpointSearchScope(project: Project) : GlobalSearchScope(project) {

    override fun getDisplayName(): String = "All SPARQL Endpoints"
    override fun getIcon(): Icon = RDFAndSPARQLIcons.ToolWindowSPARQLEndpoint

    override fun contains(file: VirtualFile): Boolean = false
    override fun isSearchInModuleContent(aModule: Module): Boolean = false
    override fun isSearchInLibraries(): Boolean = false
}

Regards,
Maksim

0
3 comments

 1. In what IDEs does that happen?

2. What is the registration in plugin.xml?

0

Yann Cebron Currently, I'm developing against IU 243.21565.193. In plugin.xml, I have the following line:

<searchScopesProvider implementation="com.sharedvocabs.plugins.rdfandsparql.sparql.RDFAndSPARQLSearchScopeProvider"/>
0

Sorry for delay, could you try adding order="last" to registration in plugin.xml? If it doesn't help, please file issue here: https://youtrack.jetbrains.com/issues/IJPL Thanks.

0

Please sign in to leave a comment.