usaxena95 created this revision.
Herald added subscribers: cfe-commits, kadircet, arphaman.
Herald added a project: clang.
usaxena95 requested review of this revision.
Herald added subscribers: MaskRay, ilya-biryukov.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88071

Files:
  clang-tools-extra/clangd/quality/model/features.json
  clang-tools-extra/clangd/quality/model/forest.json


Index: clang-tools-extra/clangd/quality/model/features.json
===================================================================
--- clang-tools-extra/clangd/quality/model/features.json
+++ clang-tools-extra/clangd/quality/model/features.json
@@ -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"
     }
 ]
\ No newline at end of file


Index: clang-tools-extra/clangd/quality/model/features.json
===================================================================
--- clang-tools-extra/clangd/quality/model/features.json
+++ clang-tools-extra/clangd/quality/model/features.json
@@ -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"
     }
 ]
\ No newline at end of file
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D88071: [clangd] Ad... UTKARSH SAXENA via Phabricator via cfe-commits

Reply via email to