@Test public void testVisitMatchDoesNotAddProposalIfMatchIsNotFound() throws Exception { List<RobotCompletionProposal> proposals = new ArrayList<RobotCompletionProposal>(); VariableCompletionMatchVisitor visitor = getVisitor(proposals, "${for"); assertEquals(VisitorInterest.CONTINUE, visitor.visitMatch(PROPOSAL, DUMMY_LOCATION)); assertTrue(proposals.isEmpty()); }
@Override public VisitorInterest visitMatch(ParsedString match, FileWithType matchLocation) { if (match.getArgCharPos() > maxVariableCharPos) { return VisitorInterest.STOP; } if (userInput == null || match.getUnescapedValue().toLowerCase().contains(getUnescapedUserInputLowerCase())) { if (!addedProposals.contains(match.getValue().toLowerCase())) { addProposal(match.getValue(), matchLocation); } } return VisitorInterest.CONTINUE; }
VariableCompletionMatchVisitor extends CompletionMatchVisitor { @Override public VisitorInterest visitMatch(ParsedString match, FileWithType matchLocation) { if (match.getArgCharPos() > maxVariableCharPos) { return VisitorInterest.STOP; } if (userInput == null || match.getUnescapedValue().toLowerCase().contains(getUnescapedUserInputLowerCase())) { if (!addedProposals.contains(match.getValue().toLowerCase())) { addProposal(match.getValue(), matchLocation); } } return VisitorInterest.CONTINUE; } }
VariableCompletionMatchVisitor extends CompletionMatchVisitor { @Override public VisitorInterest visitMatch(ParsedString match, FileWithType matchLocation) { if (match.getArgCharPos() > maxVariableCharPos) { return VisitorInterest.STOP; } if (userInput == null || match.getUnescapedValue().toLowerCase().contains(getUnescapedUserInputLowerCase())) { if (!addedProposals.contains(match.getValue().toLowerCase())) { addProposal(match.getValue(), matchLocation); } } return VisitorInterest.CONTINUE; } VariableCompletionMatchVisitor(IFile file, String userInput, List<RobotCompletionProposal> proposals, IRegion replacementRegion, int maxVariableCharPos, int maxSettingCharPos); }
VariableCompletionMatchVisitor extends CompletionMatchVisitor { @Override public VisitorInterest visitMatch(ParsedString match, FileWithType matchLocation) { if (match.getArgCharPos() > maxVariableCharPos) { return VisitorInterest.STOP; } if (userInput == null || match.getUnescapedValue().toLowerCase().contains(getUnescapedUserInputLowerCase())) { if (!addedProposals.contains(match.getValue().toLowerCase())) { addProposal(match.getValue(), matchLocation); } } return VisitorInterest.CONTINUE; } VariableCompletionMatchVisitor(IFile file, String userInput, List<RobotCompletionProposal> proposals, IRegion replacementRegion, int maxVariableCharPos, int maxSettingCharPos); @Override VisitorInterest visitMatch(ParsedString match, FileWithType matchLocation); @Override LineType getWantedLineType(); @Override boolean visitImport(IFile sourceFile, RobotLine line); }
VariableCompletionMatchVisitor extends CompletionMatchVisitor { @Override public VisitorInterest visitMatch(ParsedString match, FileWithType matchLocation) { if (match.getArgCharPos() > maxVariableCharPos) { return VisitorInterest.STOP; } if (userInput == null || match.getUnescapedValue().toLowerCase().contains(getUnescapedUserInputLowerCase())) { if (!addedProposals.contains(match.getValue().toLowerCase())) { addProposal(match.getValue(), matchLocation); } } return VisitorInterest.CONTINUE; } VariableCompletionMatchVisitor(IFile file, String userInput, List<RobotCompletionProposal> proposals, IRegion replacementRegion, int maxVariableCharPos, int maxSettingCharPos); @Override VisitorInterest visitMatch(ParsedString match, FileWithType matchLocation); @Override LineType getWantedLineType(); @Override boolean visitImport(IFile sourceFile, RobotLine line);  }