syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.69k stars 4.9k forks source link

`#include <fstream>` deleted by `c-c+-organize-includes` #16501

Closed tigerjack closed 3 months ago

tigerjack commented 3 months ago

Description :octocat:

The function c-c++-organize-includes automatically delete the #include <fstream> line.

Reproduction guide :beetle:

#include <fstream>

int main() {
  std::ifstream file("a.txt");
}

Observed behaviour: :eyes: :broken_heart:

The include string gets deleted

Expected behaviour: :heart: :smile: The include string DOES NOT get deleted

System Info :computer:

smile13241324 commented 3 months ago

Sorry but this functionality is provided by the package cpp-auto-include please open an issue for the package in it's repo.

Ref: https://github.com/syl20bnr/spacemacs/blob/develop/layers%2F%2Blang%2Fc-c%2B%2B%2Fpackages.el#L132