sublimelsp/LSP-clangd

formatting instructions ignored

kendfss opened this issue · 3 comments

I'm writing wrt the guide at:

instructions saved in .clang-format were ignored.
Then I tried the settings file. first:

        "clangd.fallback-style": "{IndentWidth: 4}", // as per command line style (I received type warnings when trying to enter in regular object notation)

then:

"command": [
        "/usr/bin/clangd",
        "-i",
        "-style='{IndentWidth: 4}'"
    ]

To no avail.
The following (at the command-line) works fine though:

clangd -i -style='{IndentWidth: 4}' main.c

What am I doing wrong?
What else should I try?

I think this is worth closing because the issue seems to be with clangd itself
clangd/clangd#362
Gavin's post gives a viable workaround for linux.

rchl commented

.clang-format should probably still work though? The issue you've linked doesn't seem to say anything about that.

The output of LSP: Troubleshoot server might help to analyze that (assuming that .clang-format should work).

It didn't work until I put it under /. This is fine for me because I don't use this server for anything other than small personal projects, but I assume it won't be ideal for people looking to alternate between/contribute to larger ones. I never checked the output (assuming it isn't automatically printed into the sublime terminal). I'll check it out later this week though.