[PATCH] D75623: [clangd][VSCode] Force VSCode to use the ranking provided by clangd.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 5 06:35:44 PST 2020


hokein added a comment.

thanks for fixing that! Played around it locally, it seems work, found an issue where the global code completion is not triggered, see my comment.



================
Comment at: clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts:116
+            // Get the incomplete identifier before the cursor.
+            let word = document.getWordRangeAtPosition(position);
+            let prefix = document.getText(new vscode.Range(word.start, position));
----------------
the word is `undefined` if we trigger the global code completion, e.g. `^`, `std::^`.




================
Comment at: clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts:124
+            })
+            return new vscode.CompletionList(items, true);
+          }
----------------
nit: /*isInComplete=*/true


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75623/new/

https://reviews.llvm.org/D75623





More information about the cfe-commits mailing list