Skip to content

[clangd] IncludeCleaner missing includes inserts a different path than header-insertion #81215

@torshepherd

Description

@torshepherd

Basically, when I accept "add missing include" from the suggested fixes for IncludeCleaner, clangd inserts headers with various paths:

  • just the filename (header.hpp)
  • the full path from my desktop (with /home/tor.shepherd/root-dir/relative-path/header.hpp)

However, header-insertion on autocomplete consistently produces the correct path (relative-path/header.hpp) according to my codebase's guidelines.

(Note, both utilities produce the correct headers for stdlib includes, except IncludeCleaner produces a full path to the actual header file for using namespace std::chrono_literals; and autocomplete doesn't add any include for this; I would expect to be added)

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions