use of com.jetbrains.python.buildout.config.ref.BuildoutPartReference in project intellij-community by JetBrains.
the class BuildoutUnresolvedPartInspection method checkFile.
@Override
public ProblemDescriptor[] checkFile(@NotNull PsiFile file, @NotNull InspectionManager manager, boolean isOnTheFly) {
List<ProblemDescriptor> problems = Lists.newArrayList();
if (file.getFileType().equals(BuildoutCfgFileType.INSTANCE)) {
Visitor visitor = new Visitor();
file.accept(visitor);
for (BuildoutPartReference ref : visitor.getUnresolvedParts()) {
ProblemDescriptor d = manager.createProblemDescriptor(ref.getElement(), ref.getRangeInElement(), PyBundle.message("buildout.unresolved.part.inspection.msg"), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false);
problems.add(d);
}
}
return problems.toArray(new ProblemDescriptor[problems.size()]);
}
use of com.jetbrains.python.buildout.config.ref.BuildoutPartReference in project intellij-community by JetBrains.
the class BuildoutCfgValueLine method getReferences.
@NotNull
@Override
public PsiReference[] getReferences() {
if (BuildoutPsiUtil.isInBuildoutSection(this) && BuildoutPsiUtil.isAssignedTo(this, "parts")) {
List<BuildoutPartReference> refs = Lists.newArrayList();
List<Pair<String, Integer>> names = StringUtil.getWordsWithOffset(getText());
for (Pair<String, Integer> name : names) {
refs.add(new BuildoutPartReference(this, name.getFirst(), name.getSecond()));
}
return refs.toArray(new BuildoutPartReference[refs.size()]);
}
return PsiReference.EMPTY_ARRAY;
}
Aggregations