IDEA-50450 Gradle code insight

Basic gradle code insight infrastructure
This commit is contained in:
Denis.Zhdanov
2013-07-23 19:38:46 +04:00
parent b415df82f1
commit 0f7cfff77e

View File

@@ -0,0 +1,55 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.plugins.gradle.service.resolve;
import com.intellij.psi.PsiElement;
import com.intellij.psi.ResolveState;
import com.intellij.psi.scope.PsiScopeProcessor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.groovy.lang.resolve.NonCodeMembersContributor;
/**
* This interface narrows {@link NonCodeMembersContributor} to a closure executed inside particular method call at a gradle script.
* <p/>
* Example:
* <b>build.gradle</b>
* <pre>
* subprojects {
* repositories {
* mavenCentral()
* }
* }
* </pre>
* Here <code>'subprojects'</code> should be resolved at context of a global script; <code>'repositories'</code> in a context of
* <code>'subprojects'</code> and <code>'mavenCentral'</code> in a context of <code>'repositories'</code>. Every such context
* is expected to be backed by corresponding implementation of the current interface.
*
* @author Denis Zhdanov
* @since 7/23/13 7:32 PM
*/
public interface GradleMethodContextContributor {
/**
* Tries to resolve target element.
*
* @param processor the processor receiving the declarations.
* @param state current resolve state
* @param place the original element from which the tree up walk was initiated.
*/
void process(@NotNull PsiScopeProcessor processor,
@NotNull ResolveState state,
@NotNull PsiElement place);
}