Package ro.redeul.google.go.inspection.fix

Examples of ro.redeul.google.go.inspection.fix.RemoveVariableFix


        return initializer;
    }

    private void applyRemoveVariableFix(InlineContext ctx) {
        new RemoveVariableFix().applyFix(ctx.identifierToInline);
    }
View Full Code Here


                        result.addProblem(declaration,
                                          GoBundle.message(
                                              "error.constant.not.used",
                                              declaration.getText()),
                                          ProblemHighlightType.LIKE_UNUSED_SYMBOL,
                                          new RemoveVariableFix());
                    } else {
                        result.addProblem(declaration,
                                          GoBundle.message(
                                              "error.variable.not.used",
                                              declaration.getText()),
                                          ProblemHighlightType.LIKE_UNUSED_SYMBOL,
                                          new RemoveVariableFix());
                    }
                    continue;
                }
            }

            if (declaration.getParent().getParent().getParent() instanceof GoPsiTypeFunctionImpl) {
                continue;
            }

            if (PARAMETER_DECLARATION.accepts(declaration)) {
                result.addProblem(declaration,
                                  GoBundle.message("error.parameter.not.used",
                                                   declaration.getText()),
                                  ProblemHighlightType.WEAK_WARNING);
            } else if (CONST_DECLARATION.accepts(declaration)) {
                result.addProblem(declaration,
                                  GoBundle.message("error.constant.not.used",
                                                   declaration.getText()),
                                  ProblemHighlightType.ERROR,
                                  new RemoveVariableFix());
            } else {
                result.addProblem(declaration,
                                  GoBundle.message("error.variable.not.used",
                                                   declaration.getText()),
                                  ProblemHighlightType.ERROR,
                                  new RemoveVariableFix());
            }
        }
    }
View Full Code Here

            if (variableUsage.isBlank()) {
                return;
            }

            addProblem(variableUsage, "Unused variable",
                       ProblemHighlightType.LIKE_UNUSED_SYMBOL, new RemoveVariableFix());
        }
View Full Code Here

                return;
            }

            addProblem(variableUsage, "Unused global",
                       ProblemHighlightType.LIKE_UNUSED_SYMBOL,
                       new RemoveVariableFix());
        }
View Full Code Here

TOP

Related Classes of ro.redeul.google.go.inspection.fix.RemoveVariableFix

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.