kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.

thanks, LG, just some extra precautions.



================
Comment at: clang-tools-extra/clangd/CodeCompletionStrings.cpp:195
       ++SnippetArg;
-      *Snippet +=
-          "${" +
-          std::to_string(SnippetArg == CursorSnippetArg ? 0 : SnippetArg) + 
':';
-      appendEscapeSnippet(Chunk.Text, Snippet);
+      *Snippet += "${" + std::to_string(
+                             SnippetArg == CursorSnippetArg ? 0 : SnippetArg);
----------------
i think we shouldn't even have braces for `$0` (just to be safe). so what about:
```
if (SnippetArg == CursorSnippetArg) {
  *Snippet = "$0";
} else {
  *Snippet = "${" + std::to_string(SnippetArg) + ":";
  appendEscapeSnippet(Chunk.Text, Snippet);
  *Snippet += "}";
}
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128621

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to