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

Include path settings don't trim white space

Open pwintz opened this issue 1 year ago • 5 comments

Type: Bug

I have files I want C++ to include in the directory /usr/local/include. When I added "/usr/local/include " (with a space at the end) to the "Include path" configuration for the C/C++ extension, a warning is shown below the box that says, "Cannot find: /usr/local/include " The trailing white space for each line should be trimmed so that such a warning is not shown.

Extension version: 1.18.5 VS Code version: Code 1.85.1 (0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2, 2023-12-13T09:49:37.021Z) OS version: Windows_NT x64 10.0.22621 Modes: Remote OS version: Linux x64 5.15.133.1-microsoft-standard-WSL2

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 x 2803)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 15.73GB (1.22GB free)
Process Argv --crash-reporter-id 52a0bd83-cab4-40c3-bdc8-a0e3553af2a2
Screen Reader no
VM 0%
Item Value
Remote Dev Container: Scarab-MPC Development Container
OS Linux x64 5.15.133.1-microsoft-standard-WSL2
CPUs 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 x 2803)
Memory (System) 7.63GB (5.70GB free)
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:30899288
vsclangdf:30486550
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30933248
pythongtdpath:30769146
i26e3531:30792625
welcomedialog:30910333
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
pythontbext0:30879054
accentitlementsc:30887149
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302

pwintz avatar Jan 15 '24 06:01 pwintz

Here is a screenshot of the warning: image

pwintz avatar Jan 15 '24 06:01 pwintz

Thank you for submitting this issue! We are currently looking into this.

browntarik avatar Jan 16 '24 18:01 browntarik

It's valid for there to be spaces in directory or file names. It seems wrong to me to trim whitespace from a user-provided path, and prevent a valid scenario, regardless of how unlikely. I'd suggest we put quotes around the path in the error message, so the spaces are apparent rather than invisible.

Colengms avatar Jan 23 '24 18:01 Colengms

The current plan is to only automatically remove the whitespace if the path with whitespace does not exist.

bobbrow avatar Jan 24 '24 16:01 bobbrow

@pwintz Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.19.3

sean-mcmanus avatar Feb 13 '24 22:02 sean-mcmanus