use of com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection in project intellij-community by JetBrains.
the class PyUnresolvedReferencesInspectionTest method testInspectionSettingsSerializable.
// PY-14359, PY-14158
public void testInspectionSettingsSerializable() throws Exception {
final PyUnresolvedReferencesInspection inspection = new PyUnresolvedReferencesInspection();
inspection.ignoredIdentifiers.add("foo.Bar.*");
final Element serialized = new Element("tmp");
inspection.writeSettings(serialized);
assertTrue(JDOMUtil.writeElement(serialized).contains("foo.Bar.*"));
}
use of com.jetbrains.python.inspections.unresolvedReference.PyUnresolvedReferencesInspection in project intellij-community by JetBrains.
the class AddIgnoredIdentifierQuickFix method applyFix.
@Override
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
final PsiElement context = descriptor.getPsiElement();
InspectionProfileModifiableModelKt.modifyAndCommitProjectProfile(project, model -> {
PyUnresolvedReferencesInspection inspection = (PyUnresolvedReferencesInspection) model.getUnwrappedTool(PyUnresolvedReferencesInspection.class.getSimpleName(), context);
String name = myIdentifier.toString();
if (myIgnoreAllAttributes) {
name += END_WILDCARD;
}
assert inspection != null;
if (!inspection.ignoredIdentifiers.contains(name)) {
inspection.ignoredIdentifiers.add(name);
}
});
}
Aggregations