Git Product home page Git Product logo

Comments (5)

tonyarnold avatar tonyarnold commented on May 24, 2024

Yes, that's a good idea. In the meantime, you can always refer to Clang-Format Style Options to see how to enable/disable features in the clang-format binary itself.

from clangformat-xcode.

tonyarnold avatar tonyarnold commented on May 24, 2024

To answer whether it does this… it doesn't specify it, but perhaps this is the default in the upstream binary?

from clangformat-xcode.

robindegen avatar robindegen commented on May 24, 2024

It's a bit of a mistery to me what's actually going on here. The "official" clang format plugin for visual studio has explicit mention of a -sort-includes parameter given:
https://github.com/llvm-mirror/clang/blob/master/tools/clang-format-vs/ClangFormat/ClangFormatPackage.cs#L259

I can't seem to find that in the sources here (maybe i'm not looking well enough?). I wonder if behavior is different between platforms, or if it's just a matter of which version you use.

from clangformat-xcode.

tonyarnold avatar tonyarnold commented on May 24, 2024

This is just an Xcode plugin that calls through to the clangformat binary. If you've got a more recent version installed with support for sorting includes, and your configuration specifies it, it will be used (I believe the option appeared in Clang 3.8).

This plugin is not clang format, so there wouldn't be any mention of a specific config option here.

from clangformat-xcode.

robindegen avatar robindegen commented on May 24, 2024

It was my understanding however that it's disabled by default on the command-line. I'm trying to figure out what's causing it to get enabled. My configuration file has no mention of this.

I found this from chromium:
https://codereview.chromium.org/1616263006

Where they mention that header sorting is disabled if the Chromium style is used, I guess possible through BasedOnStyle: Chromium in the config.

There seems to be a lot of scattered information about this topic all over the place with no clear consensus about the actual default behavior of this.

from clangformat-xcode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.