Search in sources :

Example 1 with CamelIdeaUtils

use of com.github.cameltooling.idea.util.CamelIdeaUtils in project camel-idea-plugin by camel-tooling.

the class CamelEndpointNameCompletionExtension method isValid.

@Override
public boolean isValid(@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull String query) {
    if (query.contains("?")) {
        // do not add completions when inside endpoint query params
        return false;
    }
    PsiElement element = parameters.getPosition();
    CamelIdeaUtils service = CamelIdeaUtils.getService();
    return service.isPlaceForEndpointUri(element) && service.isProducerEndpoint(element);
}
Also used : CamelIdeaUtils(com.github.cameltooling.idea.util.CamelIdeaUtils) PsiElement(com.intellij.psi.PsiElement)

Aggregations

CamelIdeaUtils (com.github.cameltooling.idea.util.CamelIdeaUtils)1 PsiElement (com.intellij.psi.PsiElement)1