From 0570234d06ee09ae189d4242cf8f27937b4af00d Mon Sep 17 00:00:00 2001 From: Alexander Zolotov Date: Sat, 29 Oct 2016 12:42:52 +0300 Subject: [PATCH] EA-90807 --- src/com/goide/inspections/GoPlaceholderCountInspection.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/goide/inspections/GoPlaceholderCountInspection.java b/src/com/goide/inspections/GoPlaceholderCountInspection.java index d9269a6d05..c1fc3b948a 100644 --- a/src/com/goide/inspections/GoPlaceholderCountInspection.java +++ b/src/com/goide/inspections/GoPlaceholderCountInspection.java @@ -212,8 +212,9 @@ private static boolean checkPrintfArgument(@NotNull ProblemsHolder holder, char flag = flags.charAt(i); if (v.getFlags().indexOf(flag) == -1) { String message = String.format("Unrecognized #ref flag for verb %s: %s call #loc", v.getVerb(), flag); - TextRange range = TextRange.create(fmtPlaceholder.getStartPos() + 1, fmtPlaceholder.getPlaceholder().length() + 1); + TextRange range = TextRange.from(fmtPlaceholder.getStartPos() + 1, fmtPlaceholder.getPlaceholder().length()); // TODO florin: add quickfix to suggest correct printf verbs (maybe take type into account when type info available?) + // TODO florin: cover with tests holder.registerProblem(placeholder, message, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, range); return false; }