vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

remote clang-format failed

Open zbl-96 opened this issue 7 years ago • 3 comments

Issue Type: Bug

I use remote-ssh to debug c++ code on ubuntu,but clang-format failed,the output:

Command failed: clang-format -style='{*********}'
/bin/sh: 1: clang-format: not found.

I have no problem testing on ubuntu physical machine and mac. Then i install clang-format use this command

sudo apt install clang-format

format extension can be used,but my setting are invalid. image It will formatting ues default setting .

Simply put, it works fine locally, the remote is not normal.

Extension version: 0.23.1 VS Code version: Code - Insiders 1.35.0-insider (a5536b8f5a16a10d859f3dec1e59701671bf069e, 2019-05-20T05:15:57.974Z) OS version: Darwin x64 18.6.0 Remote OS version: Linux x64 4.15.0-50-generic

System Info
Item Value
CPUs Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz (8 x 2300)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 16.00GB (1.36GB free)
Process Argv -psn_0_2642565
Screen Reader no
VM 0%
Item Value
Remote SSH: iexpress
OS Linux x64 4.15.0-50-generic
CPUs Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 x 1092)
Memory (System) 15.56GB (3.15GB free)
VM 0%

zbl-96 avatar May 21 '19 03:05 zbl-96

That "Command failed" message is not from our extension. Do you have another formatting extension installed?

Can you logon to the remote machine and see if the ~/.vscode/extensions/ms-vscode-0.23.1/LLVM/bin/clang-format executable exists and if it is runnable via the command line?

If you install clang-format via "apt install" you will need to set the C_Cpp.clang_format_path to that location to use that version (we install 6.0 by default) -- the version we install has been known to have certain dependencies that are not available by default on some Linux OS's.

sean-mcmanus avatar May 21 '19 18:05 sean-mcmanus

Sorry, I saw that clang-format is provided by your extension, so guess the message is from yours. And my remote machine returns. image I have not set C_Cpp.clang_format_path.And i need report this issue to remote-ssh extension ? Anyway, thank you very much for your help.

zbl-96 avatar May 22 '19 01:05 zbl-96

This should be fixed in the latest version of the extension.

bobbrow avatar Apr 02 '20 21:04 bobbrow