clang-tools  7.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

float NameMatch = 1
 0-1+ fuzzy-match score for unqualified name. Must be explicitly assigned. More...
 
bool Forbidden = false
 
URIDistanceFileProximityMatch = nullptr
 
llvm::StringRef SymbolURI
 This is used to calculate proximity between the index symbol and the query. More...
 
float SemaProximityScore = 0
 Proximity between best declaration and the query. More...
 
enum clang::clangd::SymbolRelevanceSignals::AccessibleScope Scope = GlobalScope
 
enum clang::clangd::SymbolRelevanceSignals::QueryType Query = Generic
 
CodeCompletionContext::Kind Context = CodeCompletionContext::CCC_Other
 
bool IsInstanceMember = false
 

Detailed Description

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

Definition at line 76 of file Quality.h.

Member Enumeration Documentation

◆ AccessibleScope

Enumerator
FunctionScope 
ClassScope 
FileScope 
GlobalScope 

Definition at line 91 of file Quality.h.

◆ QueryType

Enumerator
CodeComplete 
Generic 

Definition at line 98 of file Quality.h.

Member Function Documentation

◆ evaluate()

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

Definition at line 306 of file Quality.cpp.

References clang::clangd::proximityScore().

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

◆ 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 103 of file Quality.h.

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

◆ FileProximityMatch

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

Definition at line 81 of file Quality.h.

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

◆ Forbidden

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

Definition at line 79 of file Quality.h.

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

◆ IsInstanceMember

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

Definition at line 106 of file Quality.h.

Referenced by 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 78 of file Quality.h.

Referenced by 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

◆ SemaProximityScore

float clang::clangd::SymbolRelevanceSignals::SemaProximityScore = 0

Proximity between best declaration and the query.

[0-1], 1 is closest. FIXME: unify with index proximity score - signals should be source-independent.

Definition at line 88 of file Quality.h.

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

◆ SymbolURI

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

This is used to calculate proximity between the index symbol and the query.

Definition at line 84 of file Quality.h.

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


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