Package com.intellij.codeInspection

Examples of com.intellij.codeInspection.LocalQuickFix


                                                                           @NotNull InspectionManager manager )
    {
        ServiceAnnotationDeclarationValidationResult annotationCheck =
            isValidServiceAnnotationDeclaration( psiVariable );
        String message = null;
        LocalQuickFix fix = null;
        switch( annotationCheck )
        {
        case invalidTypeIsInjectedViaStructureAnnotation:
            if( getStructureAnnotation( psiVariable ) == null )
            {
View Full Code Here


    @Nullable
    protected final ProblemDescriptor[] verifyAnnotationDeclaredCorrectly( @NotNull PsiVariable psiVariable,
                                                                           @NotNull PsiAnnotation invocationAnnotation,
                                                                           @NotNull InspectionManager manager )
    {
        LocalQuickFix fix = null;
        String message = null;

        String variableTypeQualifiedName = psiVariable.getType().getCanonicalText();

        InvocationAnnotationDeclarationValidationResult validationResult =
View Full Code Here

            Project project = psiClass.getProject();
            PsiClass activator = JavaPsiFacade.getInstance(project).findClass(ACTIVATOR_CLASS, ProjectScope.getLibrariesScope(project));
            if (activator != null && psiClass.isInheritor(activator, true)) {
              String className = psiClass.getQualifiedName();
              if (className != null) {
                LocalQuickFix fix = null;

                OsmorcFacetConfiguration configuration = facet.getConfiguration();
                if (configuration.isManifestManuallyEdited()) {
                  BundleManifest manifest = BundleManager.getInstance(project).getManifestByObject(facet.getModule());
                  if (manifest == null || !className.equals(manifest.getBundleActivator())) {
View Full Code Here

            String toImport = checkAccessibility(target, facet);
            if (toImport == NOT_EXPORTED) {
              holder.registerProblem(ref, OsmorcBundle.message("WrongImportPackageInspection.message"));
            }
            else if (toImport != null) {
              LocalQuickFix fix = new ImportPackageFix(toImport);
              holder.registerProblem(ref, OsmorcBundle.message("PackageAccessibilityInspection.message"), fix);
            }
          }
        }
      }
View Full Code Here

    protected void invoke(Project project, Editor editor, GoFile file) {
        PsiElement element = file.findElementAt(editor.getSelectionModel().getSelectionStart());
        GoLiteralIdentifier identifier = findParentOfType(element, GoLiteralIdentifier.class);
        assertNotNull(identifier);
        InspectionManager im = InspectionManager.getInstance(project);
        LocalQuickFix fix = null;
        ProblemDescriptor pd = im.createProblemDescriptor(identifier, "", fix, ProblemHighlightType.ERROR, true);
        new ConvertToAssignmentFix().applyFix(project, pd);
    }
View Full Code Here

        }
        assertTrue(element instanceof GoLiteralIdentifier);

//        System.out.println(DebugUtil.psiToString(file, false, true));
        InspectionManager im = InspectionManager.getInstance(project);
        LocalQuickFix fix = null;
        ProblemDescriptor pd = im.createProblemDescriptor(element, "", fix,
                                                          ProblemHighlightType.ERROR,
                                                          true);
        new RemoveVariableFix().applyFix(project, pd);
    }
View Full Code Here

        }

        assertNotNull(element);
        //System.out.println(DebugUtil.psiToString(file, false, true));
        InspectionManager im = InspectionManager.getInstance(project);
        LocalQuickFix fix = null;
        ProblemDescriptor pd = im.createProblemDescriptor(element, "", fix, ProblemHighlightType.ERROR, true);
        new RemoveImportFix(element).applyFix(project, pd);
    }
View Full Code Here

        hasResultButNoReturnAtTheEnd(result, function);
    }

    private static void hasResultButNoReturnAtTheEnd(InspectionResult result, GoFunctionDeclaration function) {
        if (hasResult(function) && hasBody(function) && !hasReturnAtTheEnd(function)) {
            LocalQuickFix fix1 = new AddReturnStmtFix(function);
            LocalQuickFix fix2 = new RemoveFunctionResultFix(function);
            PsiElement element = function.getBlock().getLastChild();
            result.addProblem(element, GoBundle.message("error.no.return.found"), fix1, fix2);
        }
    }
View Full Code Here

    }
    return null;
  }

  public static LocalQuickFix[] createFixes(final String newName, Class<? extends DomElement> clazz, final DomElement scope) {
    final LocalQuickFix fix = createFix(newName, clazz, scope);
    return fix != null ? new LocalQuickFix[] { fix } : EMPTY_ARRAY;
  }
View Full Code Here

TOP

Related Classes of com.intellij.codeInspection.LocalQuickFix

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.