Vscode-cpptools: Formatting Failed C/C++ No info in Output window

Created on 9 Mar 2019  Â·  10Comments  Â·  Source: microsoft/vscode-cpptools

Type: LanguageService

Pop up says Formatting failed. See the output window for details. Source: C/C++ (Extension)
I am using code-insiders 1.33.0
on arch linux.
I have had the same problem with the regular build as well.
Also i believe the errors that I see have an issue. Simple things like a semi cause an error in what seems like the wrong place.
Maybe I am just supposed to do something, Sorry if I just missed something, any help would be great.
Quick Fix:
No Code Actions Available
for missing semicolon

Describe the bug

  • OS and Version:
  • VS Code Version:
  • C/C++ Extension Version:
  • Other extensions you installed (and if the issue persists after disabling them):
  • A clear and concise description of what the bug is.

To Reproduce

  1. Create a C file.
  2. Format Document
  3. Pop up shows the error

Expected behavior
Errors on the document like missing semi and unused variables.
The document should be formatted.

Screenshots

DeepinScreenshot_select-area_20190309151251

Language Service bug duplicate

Most helpful comment

Ubuntu 19.04 Fix this bug:
sudo apt-get install libncurses5-dev
locate libncurses.so

output : /usr/lib/x86_64-linux-gnu/libncurses.so.6

sudo ln -s /usr/lib/x86_64-linux-gnu/libncurses.so.6 /usr/lib/libtinfo.so.5

All 10 comments

What does the output window say?

Has formatting ever worked for you?

Can you try running /home/user/.vscode-insiders/extensions/ms-vscode.cpptools-0.21.0/LLVM/bin/clang-format from a command line and seeing what errors it gives?

We ship a version of the clang-format binary that was intended to run on Ubuntu 14-18.04. It's possible the binary is not compatible with your OS. We have received reports of it failing with Ubuntu 18.10, but no reports of it failing on Arch Linux yet. Can you download a binary at releases.llvm.org/download.html , maybe the AArch64 Linux one, and then set your C_Cpp.clang_format_path to the path of the clang-format file?

@djorborn, the output window is currently showing output from "Tasks". Can you click on the drop down box and select "C/C++"? Then you should see the error details.

Sorry i feel silly I didnt see that drop down. The error was that clang-format could not find libtinfo.so, I did some research and found a solution to install the package ncurses5-compat-libs from the Arch User Repository. After that the error was gone. Thank you for the help sorry it took so long to get back to you.

Ubuntu 19.04 Fix this bug:
sudo apt-get install libncurses5-dev
locate libncurses.so

output : /usr/lib/x86_64-linux-gnu/libncurses.so.6

sudo ln -s /usr/lib/x86_64-linux-gnu/libncurses.so.6 /usr/lib/libtinfo.so.5

It said no libtinfo.so.5. In fact, there are only /usr/lib/x86_64-linux-gnu/libtinfo.so.6 in my system. It seems a soft link solved this problem.
sudo ln -s /usr/lib/x86_64-linux-gnu/libtinfo.so.6 /usr/lib/x86_64-linux-gnu/libtinfo.so.5

Ubuntu 19.04 Fix this bug:
sudo apt-get install libncurses5-dev
locate libncurses.so

output : /usr/lib/x86_64-linux-gnu/libncurses.so.6

sudo ln -s /usr/lib/x86_64-linux-gnu/libncurses.so.6 /usr/lib/libtinfo.so.5

THANKS

This shouldnt be closed, as the solution is just a workaround

@croraf It's okay if this is closed because it's a duplicate issue that we're tracking already with https://github.com/microsoft/vscode-cpptools/issues/3174 .

Our Insiders release fixes the clang-format dependency problems: https://github.com/microsoft/vscode-cpptools/releases/tag/0.27.0-insiders

@djorborn, the output window is currently showing output from "Tasks". Can you click on the drop down box and select "C/C++"? Then you should see the error details.

For me this was the answer and probably the 5 others who upvoted this comment. Although this issue may not be a "real issue" per se, indeed raises the question if the "prompt error" is clear and maybe should say to check the C/C++ output to make it clearer.

Was this page helpful?
0 / 5 - 0 ratings