Class FuzzyMatcher

java.lang.Object
tools.refinery.language.ide.contentassist.FuzzyMatcher
All Implemented Interfaces:
org.eclipse.xtext.ide.editor.contentassist.IPrefixMatcher

public class FuzzyMatcher extends Object implements org.eclipse.xtext.ide.editor.contentassist.IPrefixMatcher
Implements the candidate matching algorithm used by CodeMirror 6.

Using this class ensures that the same candidates will be returned when filtering content assist proposals on the server as on the client.

The matching is "fuzzy" (fzf-like), i.e., the prefix characters may occur anywhere in the name, but must be in the same order as in the prefix.

  • Constructor Details

    • FuzzyMatcher

      public FuzzyMatcher()
  • Method Details

    • isCandidateMatchingPrefix

      public boolean isCandidateMatchingPrefix(String name, String prefix)
      Specified by:
      isCandidateMatchingPrefix in interface org.eclipse.xtext.ide.editor.contentassist.IPrefixMatcher