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

The 'Add #include' code action incorrectly uses "../" instead of <> when an includePath is used that is lexicographically less than the source file's parent directory

Open sean-mcmanus opened this issue 1 year ago • 1 comments

See the 2 screenshots: If the includePath has "${workspaceFolder}/a" then the bug repros,

image

but with "${workspaceFolder}/t" it behaves correctly -- t is lexicographically greater than the source's parent directory "sub". image

Tests added for https://github.com/microsoft/vscode-cpptools/issues/11989 caused this to start to be hit (after a lexigraphically smaller includePath was added).

sean-mcmanus avatar Feb 23 '24 20:02 sean-mcmanus

Also repos for me when removing the algorithms library from the ship.cpp file in endless sky (https://github.com/endless-sky/endless-sky/blob/master/source/Ship.cpp) and adding a call to transform: image

AlexandraKemperMS avatar Mar 08 '24 20:03 AlexandraKemperMS

I got a repro with a our internal test project (add_missing_include test folder).

sean-mcmanus avatar Sep 23 '24 21:09 sean-mcmanus