File tree Expand file tree Collapse file tree 3 files changed +10
-14
lines changed Expand file tree Collapse file tree 3 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ struct CodeCompleteOptions {
133
133
enum CodeCompletionRankingModel {
134
134
Heuristics,
135
135
DecisionForest,
136
- } RankingModel = DecisionForest ;
136
+ } RankingModel = Heuristics ;
137
137
138
138
// / Callback used to score a CompletionCandidate if DecisionForest ranking
139
139
// / model is enabled.
Original file line number Diff line number Diff line change @@ -580,16 +580,12 @@ evaluateDecisionForest(const SymbolQualitySignals &Quality,
580
580
// multiplciative boost (like NameMatch). This allows us to weigh the
581
581
// prediciton score and NameMatch appropriately.
582
582
Scores.ExcludingName = pow (Base, Evaluate (E));
583
- // Following cases are not part of the generated training dataset:
584
- // - Symbols with `NeedsFixIts`.
585
- // - Forbidden symbols.
586
- // - Keywords: Dataset contains only macros and decls.
583
+ // NeedsFixIts is not part of the DecisionForest as generating training
584
+ // data that needs fixits is not-feasible.
587
585
if (Relevance.NeedsFixIts )
588
586
Scores.ExcludingName *= 0.5 ;
589
587
if (Relevance.Forbidden )
590
588
Scores.ExcludingName *= 0 ;
591
- if (Quality.Category == SymbolQualitySignals::Keyword)
592
- Scores.ExcludingName *= 4 ;
593
589
594
590
// NameMatch should be a multiplier on total score to support rescoring.
595
591
Scores.Total = Relevance.NameMatch * Scores.ExcludingName ;
Original file line number Diff line number Diff line change @@ -647,13 +647,13 @@ TEST(CompletionTest, ScopedWithFilter) {
647
647
}
648
648
649
649
TEST (CompletionTest, ReferencesAffectRanking) {
650
- EXPECT_THAT ( completions (" int main() { abs^ }" , {func ( " absA " ), func (" absB " )})
651
- .Completions ,
652
- HasSubsequence (Named (" absA " ), Named (" absB " )));
653
- EXPECT_THAT ( completions (" int main() { abs^ }" ,
654
- { func ( " absA " ), withReferences ( 1000 , func (" absB " ))})
655
- .Completions ,
656
- HasSubsequence (Named (" absB " ), Named (" absA " )));
650
+ auto Results = completions (" int main() { abs^ }" , {ns ( " absl " ), func (" absb " )});
651
+ EXPECT_THAT (Results .Completions ,
652
+ HasSubsequence (Named (" absb " ), Named (" absl " )));
653
+ Results = completions (" int main() { abs^ }" ,
654
+ { withReferences ( 10000 , ns ( " absl " )), func (" absb " )});
655
+ EXPECT_THAT (Results .Completions ,
656
+ HasSubsequence (Named (" absl " ), Named (" absb " )));
657
657
}
658
658
659
659
TEST (CompletionTest, ContextWords) {
You can’t perform that action at this time.
0 commit comments