Tabnine Logo
CompletionProposal.getRelevance
Code IndexAdd Tabnine to your IDE (free)

How to use
getRelevance
method
in
org.eclipse.jdt.core.CompletionProposal

Best Java code snippets using org.eclipse.jdt.core.CompletionProposal.getRelevance (Showing top 20 results out of 315)

origin: org.eclipse/org.eclipse.jdt.ui

protected int computeRelevance() {
  final int baseRelevance= fProposal.getRelevance() * 16;
  switch (fProposal.getKind()) {
    case CompletionProposal.PACKAGE_REF:
      return baseRelevance + 0;
    case CompletionProposal.LABEL_REF:
      return baseRelevance + 1;
    case CompletionProposal.KEYWORD:
      return baseRelevance + 2;
    case CompletionProposal.TYPE_REF:
    case CompletionProposal.ANONYMOUS_CLASS_DECLARATION:
      return baseRelevance + 3;
    case CompletionProposal.METHOD_REF:
    case CompletionProposal.METHOD_NAME_REFERENCE:
    case CompletionProposal.METHOD_DECLARATION:
    case CompletionProposal.ANNOTATION_ATTRIBUTE_REF:
      return baseRelevance + 4;
    case CompletionProposal.POTENTIAL_METHOD_DECLARATION:
      return baseRelevance + 4 /* + 99 */;
    case CompletionProposal.FIELD_REF:
      return baseRelevance + 5;
    case CompletionProposal.LOCAL_VARIABLE_REF:
    case CompletionProposal.VARIABLE_DECLARATION:
      return baseRelevance + 6;
    default:
      return baseRelevance;
  }
}

origin: org.eclipse.jdt/org.eclipse.jdt.ui

final int baseRelevance= proposal.getRelevance() * 16;
switch (proposal.getKind()) {
  case CompletionProposal.PACKAGE_REF:
origin: org.eclipse/org.eclipse.jdt.ui

final int baseRelevance= proposal.getRelevance() * 16;
switch (proposal.getKind()) {
  case CompletionProposal.PACKAGE_REF:
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

final int baseRelevance= proposal.getRelevance() * 16;
switch (proposal.getKind()) {
  case CompletionProposal.PACKAGE_REF:
origin: eclipse/eclipse.jdt.ls

@Override
public void accept(CompletionProposal proposal) {
  if (!isIgnored(proposal.getKind())) {
    if (proposal.getKind() == CompletionProposal.PACKAGE_REF && unit.getParent() != null && String.valueOf(proposal.getCompletion()).equals(unit.getParent().getElementName())) {
      // Hacky way to boost relevance of current package, for package completions, until
      // https://bugs.eclipse.org/518140 is fixed
      proposal.setRelevance(proposal.getRelevance() + 1);
    }
    proposals.add(proposal);
  }
}
origin: eclipse/eclipse.jdt.ls

@Override
public void accept(CompletionProposal proposal) {
  if (proposal.getKind() == CompletionProposal.TYPE_REF) {
    addType(proposal.getSignature(), proposal.getFlags(), proposal.getRelevance());
  }
}
origin: org.eclipse.recommenders.completion.rcp/subwords

public static SwLazyJavaTypeCompletionProposal createLazyJavaTypeCompletionProposal(
    final SubwordsProposalContext subwordsContext) {
  final CompletionProposal proposal = subwordsContext.getProposal();
  final SwLazyJavaTypeCompletionProposal res = new SwLazyJavaTypeCompletionProposal(proposal,
      subwordsContext.getContext(), subwordsContext);
  res.setRelevance(proposal.getRelevance());
  return res;
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
public void accept(CompletionProposal proposal) {
  if (proposal.getKind() == CompletionProposal.TYPE_REF) {
    addType(proposal.getSignature(), proposal.getFlags(), proposal.getRelevance());
  }
}

origin: org.eclipse/org.eclipse.jdt.ui

  public void accept(CompletionProposal proposal) {
    if (proposal.getKind() == CompletionProposal.TYPE_REF) {
      addType(proposal.getSignature(), proposal.getFlags(), proposal.getRelevance());
    }
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

@Override
public void accept(CompletionProposal proposal) {
  if (proposal.getKind() == CompletionProposal.TYPE_REF) {
    addType(proposal.getSignature(), proposal.getFlags(), proposal.getRelevance());
  }
}

origin: eclipse/eclipse.jdt.ls

@Override
public void accept(CompletionProposal proposal) {
  if (!isIgnored(proposal.getKind())) {
    if (proposal.getKind() == CompletionProposal.POTENTIAL_METHOD_DECLARATION) {
      acceptPotentialMethodDeclaration(proposal);
    } else {
      if (proposal.getKind() == CompletionProposal.PACKAGE_REF && unit.getParent() != null && String.valueOf(proposal.getCompletion()).equals(unit.getParent().getElementName())) {
        // Hacky way to boost relevance of current package, for package completions, until
        // https://bugs.eclipse.org/518140 is fixed
        proposal.setRelevance(proposal.getRelevance() + 1);
      }
      proposals.add(proposal);
    }
  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.core

buffer.append("-TokenEnd[").append(proposal.getTokenEnd()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
printDebugTab(tab, buffer);
buffer.append("\tRelevance[").append(proposal.getRelevance()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

buffer.append("-TokenEnd[").append(proposal.getTokenEnd()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
printDebugTab(tab, buffer);
buffer.append("\tRelevance[").append(proposal.getRelevance()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
origin: org.eclipse.tycho/org.eclipse.jdt.core

buffer.append("-TokenEnd[").append(proposal.getTokenEnd()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
printDebugTab(tab, buffer);
buffer.append("\tRelevance[").append(proposal.getRelevance()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

buffer.append("-TokenEnd[").append(proposal.getTokenEnd()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
printDebugTab(tab, buffer);
buffer.append("\tRelevance[").append(proposal.getRelevance()).append("]\n"); //$NON-NLS-1$ //$NON-NLS-2$
origin: org.eclipse/org.eclipse.jdt.ui

    proposal.getReplaceStart(),
    proposal.getReplaceEnd(),
    proposal.getRelevance(),
    JavaPluginImages.DESC_OBJS_PACKAGE);
return;
    proposal.getReplaceStart(),
    proposal.getReplaceEnd(),
    proposal.getRelevance(),
    JavaElementImageProvider.getTypeImageDescriptor(false, false, proposal.getFlags(), false),
    fFullyQualify ? new String(fullName) : null);
      proposal.getReplaceStart(),
      proposal.getReplaceEnd(),
      proposal.getRelevance(),
      null);
return;
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

    proposal.getReplaceStart(),
    proposal.getReplaceEnd(),
    proposal.getRelevance(),
    JavaPluginImages.DESC_OBJS_PACKAGE);
return;
    proposal.getReplaceStart(),
    proposal.getReplaceEnd(),
    proposal.getRelevance(),
    typeImageDescriptor,
    fullyQualify ? new String(fullName) : null);
      proposal.getReplaceStart(),
      proposal.getReplaceEnd(),
      proposal.getRelevance(),
      null);
return;
origin: org.eclipse.jdt/org.eclipse.jdt.ui

    proposal.getReplaceStart(),
    proposal.getReplaceEnd(),
    proposal.getRelevance(),
    JavaPluginImages.DESC_OBJS_PACKAGE);
return;
    proposal.getReplaceStart(),
    proposal.getReplaceEnd(),
    proposal.getRelevance(),
    typeImageDescriptor,
    fullyQualify ? new String(fullName) : null);
      proposal.getReplaceStart(),
      proposal.getReplaceEnd(),
      proposal.getRelevance(),
      null);
return;
origin: eclipse/eclipse.jdt.ls

private void acceptPotentialMethodDeclaration(CompletionProposal proposal) {
  try {
    IJavaElement enclosingElement = null;
    if (response.getContext().isExtended()) {
      enclosingElement = response.getContext().getEnclosingElement();
    } else if (unit != null) {
      // kept for backward compatibility: CU is not reconciled at this moment, information is missing (bug 70005)
      enclosingElement = unit.getElementAt(proposal.getCompletionLocation() + 1);
    }
    if (enclosingElement == null) {
      return;
    }
    IType type = (IType) enclosingElement.getAncestor(IJavaElement.TYPE);
    if (type != null) {
      String prefix = String.valueOf(proposal.getName());
      int completionStart = proposal.getReplaceStart();
      int completionEnd = proposal.getReplaceEnd();
      int relevance = proposal.getRelevance() + 6;
      GetterSetterCompletionProposal.evaluateProposals(type, prefix, completionStart, completionEnd - completionStart, relevance, proposals);
    }
  } catch (CoreException e) {
    JavaLanguageServerPlugin.logException("Accept potential method declaration failed for completion ", e);
  }
}
origin: eclipse/eclipse.jdt.ls

final int baseRelevance= proposal.getRelevance() * 16;
switch (proposal.getKind()) {
case CompletionProposal.LABEL_REF:
org.eclipse.jdt.coreCompletionProposalgetRelevance

Javadoc

Returns the relative relevance rating of this proposal.

Popular methods of CompletionProposal

  • getKind
    Returns the kind of completion being proposed. The set of different kinds of completion proposals is
  • getName
    Returns the simple name of the method, field, member, or variable relevant in the context, ornull if
  • getSignature
    Returns the signature of the method or type relevant in the context, or null if none. This field is
  • findParameterNames
    Finds the method parameter names. This information is relevant to method reference (and method decla
  • getCompletion
    Returns the proposed sequence of characters to insert into the source file buffer, replacing the cha
  • getDeclarationSignature
    Returns the type signature or package name of the relevant declaration in the context, or null if no
  • getReplaceStart
    Returns the character index of the start of the subrange in the source file buffer to be replaced by
  • create
    Creates a basic completion proposal. All instance field have plausible default values unless otherwi
  • getDeclarationKey
    Returns the key of the relevant declaration in the context, or null if none. This field is availabl
  • getReplaceEnd
    Returns the character index of the end of the subrange in the source file buffer to be replaced by t
  • getCompletionLocation
    Returns the character index in the source file buffer where source completion was requested (theoffs
  • getFlags
    Returns the modifier flags relevant in the context, orFlags.AccDefault if none. This field is avail
  • getCompletionLocation,
  • getFlags,
  • getRequiredProposals,
  • setCompletion,
  • setDeclarationSignature,
  • setRelevance,
  • setReplaceRange,
  • setSignature,
  • setFlags

Popular in Java

  • Start an intent from android
  • runOnUiThread (Activity)
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now