[clangd] Add a trained DecisionForest for code completion.

Replaces the dummy CodeCompletion model with a trained DecisionForest
model.
The features.json needs to be manually curated specifying the features
to be used. This is a one-time cost and does not change if the model
changes until we decide to add/remove features.

Differential Revision: https://reviews.llvm.org/D88071
This commit is contained in:
Utkarsh Saxena 2020-09-22 07:56:08 +02:00
parent f775fe5964
commit b5f7e9e26c
2 changed files with 382711 additions and 6 deletions

View File

@ -1,8 +1,84 @@
[
{
"name": "FilterLength",
"kind": "NUMBER"
},
{
"name": "IsDeprecated",
"kind": "NUMBER"
},
{
"name": "IsReservedName",
"kind": "NUMBER"
},
{
"name": "IsImplementationDetail",
"kind": "NUMBER"
},
{
"name": "NumReferences",
"kind": "NUMBER"
},
{
"name": "IsNameInContext",
"kind": "NUMBER"
},
{
"name": "IsForbidden",
"kind": "NUMBER"
},
{
"name": "IsInBaseClass",
"kind": "NUMBER"
},
{
"name": "FileProximityDistance",
"kind": "NUMBER"
},
{
"name": "SemaFileProximityScore",
"kind": "NUMBER"
},
{
"name": "SymbolScopeDistance",
"kind": "NUMBER"
},
{
"name": "SemaSaysInScope",
"kind": "NUMBER"
},
{
"name": "IsInstanceMember",
"kind": "NUMBER"
},
{
"name": "HadContextType",
"kind": "NUMBER"
},
{
"name": "HadSymbolType",
"kind": "NUMBER"
},
{
"name": "TypeMatchesPreferred",
"kind": "NUMBER"
},
{
"name": "SymbolCategory",
"kind": "ENUM",
"type": "clang::clangd::SymbolQualitySignals::SymbolCategory",
"header": "Quality.h"
},
{
"name": "ContextKind",
"kind": "ENUM",
"type": "clang::CodeCompletionContext::Kind",
"header": "clang/Sema/CodeCompleteConsumer.h"
},
{
"name": "Scope",
"kind": "ENUM",
"type": "clang::clangd::SymbolRelevanceSignals::AccessibleScope",
"header": "Quality.h"
}
]

File diff suppressed because it is too large Load Diff