Code Action
clice advertises textDocument/codeAction support but currently returns an empty list. This page tracks the intended scope.
Quick Fixes
Actions derived from FixItHints attached to clang / clang-tidy diagnostics.
- Apply a compiler
FixItHintas a quick fix - Apply clang-tidy fix-its
-
source.fixAll— batch-apply all available fixes in the file (clangd#1446) - "Fix all occurrences" of the same diagnostic kind in one action (clangd#830)
- Apply fixes whose edits fall outside the main file (clangd#1747)
- Honor client code-action capabilities (
isPreferred, resolve support) (clangd#573) - Optionally apply formatting to code-action edits (clangd#2476)
Include Actions
- Add a missing
#includefor an unresolved symbol (clangd#1017) - Insert includes using project-relative paths, not absolute (clangd#2010)
- Configurable include style — quoted vs. angle brackets (clangd#1367)
- Remove unused
#include(include-cleaner) - Respect IWYU pragmas (
export,keep,private) - Suggest a
usingdeclaration as alternative to qualifying an unresolved symbol (clangd#976) - C files: suggest
<stdlib.h>not<cstdlib>(clangd#2246)
Refactorings
Cursor/selection-driven refactorings.
Extract
- Extract variable (clangd#446)
- Extract variable should replace all occurrences of the expression (clangd#924)
- Extract variable in macro arguments (clangd#1197)
- Extract function / method (clangd#698)
- Extract function should preserve placeholder return types (
auto) (clangd#653) - Extract function must not introduce desugared types (clangd#1496)
- Extract function must handle types defined in enclosing scope (clangd#1710)
- Extract function for C files (clangd#1810)
Inline / Expand
- Inline variable / function
- Expand
auto/ deduced type - Expand macro one level (clangd#820)
Move / Define
- Define method out-of-line (move body out of the class)
- Define method inline (move body into the declaration)
- Generate a missing method definition from declaration (clangd#445)
- Generate a missing declaration from out-of-line definition (clangd#2454, clangd#730)
Transform
- Add a
usingdeclaration (clangd#73) - Replace
using namespaceby qualifying names in place (clangd#1067) - Remove unnecessary type qualifiers (clangd#1619)
- Swap
if/elsebranches (clangd#466) - Populate
switchcases (clangd#807) - Convert to raw string literal
- Create a declaration from a usage (clangd#467)
- Remove function / method (clangd#2580)
- Modify function parameters and update call sites (clangd#460)
- Fix mismatched declaration/definition signatures (clangd#77)
- Generate stubs for pure virtual methods of base class (clangd#1037)
- Swap binary operands
- Convert unscoped enum to scoped enum
- Generate memberwise constructor
- Declare implicit copy/move special members
- Rename symbol (as code action)
- Include-cleaner: batch fix unused/missing includes
Changelog
| Date | Change | PR |
|---|---|---|
| — | Stub handler (always returns empty list) | — |