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

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 #12010

Closed
sean-mcmanus opened this issue Feb 23, 2024 · 2 comments
Assignees
Labels
bug Feature: Add '#include' Add '#include' code action on undefined symbols fixed Check the Milestone for the release in which the fix is or will be available. Language Service Visual Studio Inherited from Visual Studio
Milestone

Comments

@sean-mcmanus
Copy link
Collaborator

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 #11989 caused this to start to be hit (after a lexigraphically smaller includePath was added).

@sean-mcmanus sean-mcmanus added bug Language Service Visual Studio Inherited from Visual Studio Feature: Add '#include' Add '#include' code action on undefined symbols labels Feb 23, 2024
@sean-mcmanus sean-mcmanus added this to the 1.20 milestone Feb 23, 2024
@sean-mcmanus sean-mcmanus self-assigned this Feb 23, 2024
@AlexandraKemperMS
Copy link

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

@sean-mcmanus sean-mcmanus modified the milestones: 1.20, 1.21 Apr 22, 2024
@bobbrow bobbrow assigned browntarik and unassigned sean-mcmanus May 14, 2024
@bobbrow bobbrow modified the milestones: 1.21, On Deck Jun 17, 2024
@sean-mcmanus
Copy link
Collaborator Author

sean-mcmanus commented Sep 23, 2024

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

@sean-mcmanus sean-mcmanus reopened this Sep 23, 2024
@sean-mcmanus sean-mcmanus modified the milestones: On Deck, 1.22, 1.23.0 Sep 25, 2024
@browntarik browntarik added the fixed Check the Milestone for the release in which the fix is or will be available. label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Feature: Add '#include' Add '#include' code action on undefined symbols fixed Check the Milestone for the release in which the fix is or will be available. Language Service Visual Studio Inherited from Visual Studio
Projects
Status: Done
Development

No branches or pull requests

4 participants