clang-tools  11.0.0
Public Types | Public Member Functions | Public Attributes | List of all members
clang::clangd::SymbolRelevanceSignals Struct Reference

Attributes of a symbol-query pair that affect how much we like it. More...

#include <Quality.h>

Collaboration diagram for clang::clangd::SymbolRelevanceSignals:
[legend]

Public Types

enum  AccessibleScope { FunctionScope, ClassScope, FileScope, GlobalScope }
 
enum  QueryType { CodeComplete, Generic }
 

Public Member Functions

void merge (const CodeCompletionResult &SemaResult)
 
void merge (const Symbol &IndexResult)
 
float evaluate () const
 

Public Attributes

llvm::StringRef Name
 The name of the symbol (for ContextWords). Must be explicitly assigned. More...
 
float NameMatch = 1
 0-1+ fuzzy-match score for unqualified name. Must be explicitly assigned. More...
 
llvm::StringSet * ContextWords = nullptr
 Lowercase words relevant to the context (e.g. near the completion point). More...
 
bool Forbidden = false
 
bool NeedsFixIts = false
 Whether fixits needs to be applied for that completion or not. More...
 
bool InBaseClass = false
 
URIDistanceFileProximityMatch = nullptr
 
llvm::StringRef SymbolURI
 These are used to calculate proximity between the index symbol and the query. More...
 
float SemaFileProximityScore = 0
 FIXME: unify with index proximity score - signals should be source-independent. More...
 
ScopeDistanceScopeProximityMatch = nullptr
 
llvm::Optional< llvm::StringRef > SymbolScope
 
bool SemaSaysInScope = false
 
enum clang::clangd::SymbolRelevanceSignals::AccessibleScope Scope = GlobalScope
 
enum clang::clangd::SymbolRelevanceSignals::QueryType Query = Generic
 
CodeCompletionContext::Kind Context = CodeCompletionContext::CCC_Other
 
bool IsInstanceMember = false
 
bool HadContextType = false
 
bool HadSymbolType = false
 
bool TypeMatchesPreferred = false
 

Detailed Description

Attributes of a symbol-query pair that affect how much we like it.

Definition at line 87 of file Quality.h.

Member Enumeration Documentation

◆ AccessibleScope

Enumerator
FunctionScope 
ClassScope 
FileScope 
GlobalScope 

Definition at line 115 of file Quality.h.

◆ QueryType

Enumerator
CodeComplete 
Generic 

Definition at line 122 of file Quality.h.

Member Function Documentation

◆ evaluate()

float clang::clangd::SymbolRelevanceSignals::evaluate ( ) const

◆ merge() [1/2]

void clang::clangd::SymbolRelevanceSignals::merge ( const CodeCompletionResult &  SemaResult)

◆ merge() [2/2]

void clang::clangd::SymbolRelevanceSignals::merge ( const Symbol IndexResult)

Member Data Documentation

◆ Context

CodeCompletionContext::Kind clang::clangd::SymbolRelevanceSignals::Context = CodeCompletionContext::CCC_Other

Definition at line 127 of file Quality.h.

Referenced by clang::clangd::operator<<().

◆ ContextWords

llvm::StringSet* clang::clangd::SymbolRelevanceSignals::ContextWords = nullptr

Lowercase words relevant to the context (e.g. near the completion point).

Definition at line 93 of file Quality.h.

Referenced by evaluate(), and clang::clangd::operator<<().

◆ FileProximityMatch

URIDistance* clang::clangd::SymbolRelevanceSignals::FileProximityMatch = nullptr

Definition at line 99 of file Quality.h.

Referenced by evaluate(), and clang::clangd::operator<<().

◆ Forbidden

bool clang::clangd::SymbolRelevanceSignals::Forbidden = false

Definition at line 94 of file Quality.h.

Referenced by evaluate(), merge(), and clang::clangd::operator<<().

◆ HadContextType

bool clang::clangd::SymbolRelevanceSignals::HadContextType = false

Definition at line 133 of file Quality.h.

Referenced by clang::clangd::operator<<().

◆ HadSymbolType

bool clang::clangd::SymbolRelevanceSignals::HadSymbolType = false

Definition at line 135 of file Quality.h.

Referenced by clang::clangd::operator<<().

◆ InBaseClass

bool clang::clangd::SymbolRelevanceSignals::InBaseClass = false

Definition at line 97 of file Quality.h.

Referenced by evaluate(), and merge().

◆ IsInstanceMember

bool clang::clangd::SymbolRelevanceSignals::IsInstanceMember = false

Definition at line 130 of file Quality.h.

Referenced by evaluate(), merge(), and clang::clangd::operator<<().

◆ Name

llvm::StringRef clang::clangd::SymbolRelevanceSignals::Name

The name of the symbol (for ContextWords). Must be explicitly assigned.

Definition at line 89 of file Quality.h.

Referenced by evaluate(), and clang::clangd::operator<<().

◆ NameMatch

float clang::clangd::SymbolRelevanceSignals::NameMatch = 1

0-1+ fuzzy-match score for unqualified name. Must be explicitly assigned.

Definition at line 91 of file Quality.h.

Referenced by evaluate(), and clang::clangd::operator<<().

◆ NeedsFixIts

bool clang::clangd::SymbolRelevanceSignals::NeedsFixIts = false

Whether fixits needs to be applied for that completion or not.

Definition at line 96 of file Quality.h.

Referenced by evaluate(), merge(), and clang::clangd::operator<<().

◆ Query

enum clang::clangd::SymbolRelevanceSignals::QueryType clang::clangd::SymbolRelevanceSignals::Query = Generic

◆ Scope

enum clang::clangd::SymbolRelevanceSignals::AccessibleScope clang::clangd::SymbolRelevanceSignals::Scope = GlobalScope

◆ ScopeProximityMatch

ScopeDistance* clang::clangd::SymbolRelevanceSignals::ScopeProximityMatch = nullptr

Definition at line 109 of file Quality.h.

Referenced by evaluate(), and clang::clangd::operator<<().

◆ SemaFileProximityScore

float clang::clangd::SymbolRelevanceSignals::SemaFileProximityScore = 0

FIXME: unify with index proximity score - signals should be source-independent.

Proximity between best declaration and the query. [0-1], 1 is closest.

Definition at line 106 of file Quality.h.

Referenced by evaluate(), merge(), and clang::clangd::operator<<().

◆ SemaSaysInScope

bool clang::clangd::SymbolRelevanceSignals::SemaSaysInScope = false

Definition at line 112 of file Quality.h.

Referenced by evaluate(), merge(), and clang::clangd::operator<<().

◆ SymbolScope

llvm::Optional<llvm::StringRef> clang::clangd::SymbolRelevanceSignals::SymbolScope

Definition at line 110 of file Quality.h.

Referenced by evaluate(), merge(), and clang::clangd::operator<<().

◆ SymbolURI

llvm::StringRef clang::clangd::SymbolRelevanceSignals::SymbolURI

These are used to calculate proximity between the index symbol and the query.

Definition at line 102 of file Quality.h.

Referenced by evaluate(), merge(), and clang::clangd::operator<<().

◆ TypeMatchesPreferred

bool clang::clangd::SymbolRelevanceSignals::TypeMatchesPreferred = false

Definition at line 137 of file Quality.h.

Referenced by evaluate(), and clang::clangd::operator<<().


The documentation for this struct was generated from the following files: