[all-commits] [llvm/llvm-project] 800e7f: [clangd] Offer Extract to Function for single expr...

Christian Kandeler via All-commits all-commits at lists.llvm.org
Fri Sep 11 11:12:49 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 800e7f8f308196b27cec5880789a1519e0bee70a
      https://github.com/llvm/llvm-project/commit/800e7f8f308196b27cec5880789a1519e0bee70a
  Author: Christian Kandeler <christian.kandeler at qt.io>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    M clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp
    M clang-tools-extra/clangd/unittests/tweaks/ExtractFunctionTests.cpp
    M clang-tools-extra/docs/ReleaseNotes.md

  Log Message:
  -----------
  [clangd] Offer Extract to Function for single expression-statements (#219945)

The tweak refused to trigger whenever the extraction zone contained a
single statement that was an expression, e.g. a lone call like
`log("connection failed");` or an overloaded-operator statement like
`std::cout << "x";`. The former was blocked by an overly broad check in
validSingleChild(); the latter additionally required
getParentOfRootStmts() to recognize that such a statement can be its own
root statement even while marked Unselected, rather than being treated
as a container of root statements.

Fixes clangd/clangd#698
Fixes  clangd/clangd#1254

Assisted-by: Claude



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list