Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extension not respecting clang-format.style option #140

Open
gv-sothebys-james opened this issue May 2, 2022 · 3 comments
Open

extension not respecting clang-format.style option #140

gv-sothebys-james opened this issue May 2, 2022 · 3 comments

Comments

@gv-sothebys-james
Copy link

gv-sothebys-james commented May 2, 2022

Hello,

I've used this extension a lot previously (with great success), but on a recent machine the formatter seems to assume the ColumnLimit is quite small, that is, I notice a lot of line breaks for what I would consider relatively short lines. I tried to play around with the clang-format.style setting but couldn't notice any difference, so I cranked up the IndentWidth to see if the settings were being respected at all, and it turns out what I specified for clang-format.style had no impact on how the formatter behaved at all.

Interesting enough, if I run clang-format --style="{IndentWidth: 40, BasedOnStyle: Google, ColumnLimit: 160}" file.proto directly from the terminal then I see a huge amount of indentation (indicating the specified style is being respected).

Here is what I have in my settings.json file:

"protoc": {
        "clang-format.style": "{IndentWidth: 40, BasedOnStyle: Google, ColumnLimit: 160}"
}

How can I go about debugging this? It would be really nice to get the formatter to respect these options. I'm running this on a linux machine (Manjaro specifically).

Thanks,

@gv-sothebys-james
Copy link
Author

I just test this on a Windows machine (using VSCode with WSL) and I'm actually running into the same issue. I suppose I hadn't noticed it before because it turns out clang-format was not present in the WSL installation. Now that I have installed it I am running into the exact same issue.

@zxh0
Copy link
Owner

zxh0 commented May 11, 2022

@gv-sothebys-james I am sorry that I have no time to improve this extension currently. I will try to find some time to fix these problems. Thank you

@oliver-ni
Copy link

oliver-ni commented Jul 16, 2022

@gv-sothebys-james it seems to looks for the clang-format.style option in the root configuration, not under protoc. Not sure whether that's desirable, but if you need to get it to work — it does

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants