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

Intellisense #include completion does not display package-like foo.bar header files #5698

Closed
vlmillet opened this issue Jun 25, 2020 · 14 comments
Labels
enhancement Improvement to an existing feature Feature: Auto-complete fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix
Milestone

Comments

@vlmillet
Copy link

Type: LanguageService

Describe the bug

  • Windows 10
  • VS Code Version : 1.46.1
  • C/C++ Extension Version: last 0.28.3

package-like files (ex: MyEngine.Math.Vector3) are not displayed in #include because they are interpreted as unrecognized extension while they don't really have extension

Steps to reproduce

type #include <MyEngine.Math. in a C++ file with some MyEngine.Math.Vector3 file existing in include path

Expected behavior
I want to be able to customize what files can be displayed in the #include completion. In my case I have extension-less package-like files that contains c++ code but have not a recognized extension (ex : MyEngine.Math.Vector3)
I'm expecting an option that allows me to filter files being displayed in #include completion because C++ preprocessor has no constraints relative to file extensions in #include directives

@sean-mcmanus
Copy link
Collaborator

Would showing types associated with "c" or "cpp" in the files.associations be sufficient? Or did you want a setting to show all types? Or did you have some other idea?

@sean-mcmanus sean-mcmanus added the more info needed The issue report is not actionable in its current state label Jun 25, 2020
@vlmillet
Copy link
Author

vlmillet commented Jun 25, 2020

Showing only types associated with c and cpp wouldn’t be enough as there is no efficient way to associate these files except by using a pattern*.*and that would pollute every other feature using the file associations.
I think an option just to « display every file on #include completion » would do the job, and maybe being able to enable it only in a list of given include path, that way we could display all files only in some desired folders where we know we only have package-like files or other non standard header files.
Would it be feasible ?

@sean-mcmanus sean-mcmanus added more votes needed Issues that have been postponed until more community members upvote it and removed more info needed The issue report is not actionable in its current state labels Jun 26, 2020
@sean-mcmanus
Copy link
Collaborator

It's feasible (might have some performance impact).

@vlmillet
Copy link
Author

When do you think this could be integrated ? What is the policy about 'enhancement' integrations ?
I ask because we are stuck without a workaround right now and cannot really migrate fully to vscode for this reason, even if I'd really want programmers to use it here.
If someone in your team can guide me on how to make a workaround, that would be great ! at least until the feature ends up in a release, if it does.

@sean-mcmanus
Copy link
Collaborator

I don't know. It's not a matter of being "integrated" it's a matter of being "changed"/"fixed". The change would have to be done in our closed source cpptools process. I thought this might be a one line change to stop the filtering, but there's something more complicated going on, so I don't know how long it would take to investigate/fix this and we are currently working on higher priority issues (this is the only report we've seen from users using foo.bar style headers).

@vlmillet
Copy link
Author

vlmillet commented Jul 9, 2020

Okay I see, thanks for the explanations.
Can you keep me in touch once it is on going ?
I still struggle to find a workaround right now except changing all our file organisation which you can guess is not really a good plan !
If you have an idea of a possible workaround/hack to this, please let me know.

@sean-mcmanus
Copy link
Collaborator

Sure.

@bobbrow bobbrow added this to the Backlog milestone Jul 9, 2020
@Colengms Colengms modified the milestones: Backlog, Triage Oct 16, 2020
@vlmillet
Copy link
Author

What is the status about the issue right now ?

@sean-mcmanus sean-mcmanus added fixed Check the Milestone for the release in which the fix is or will be available. quick fix labels Dec 23, 2020
@sean-mcmanus sean-mcmanus modified the milestones: Triage, 1.2.0 Dec 23, 2020
@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Dec 23, 2020

I re-tried the one-line fix I tried previously, which didn't work before, and it works now, so it should be available in 1.2.0-insiders unless we find some other problem with the change.

@vlmillet
Copy link
Author

Great thanks !

@sean-mcmanus sean-mcmanus removed the more votes needed Issues that have been postponed until more community members upvote it label Dec 23, 2020
@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Jan 21, 2021

Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/1.2.0-insiders2

We still exclude hardcoded file types that we associate with source files and don't expect or recommend being #included, even though the language doesn't enforce that. It's a design trade off -- users could file a feature request to add a setting to make .cpp/.c etc. files appear in the #include completion list, but it would need more upvotes.

@bobbrow bobbrow added fixed Check the Milestone for the release in which the fix is or will be available. and removed fixed Check the Milestone for the release in which the fix is or will be available. labels Jan 26, 2021
@Colengms Colengms closed this as completed Feb 3, 2021
@vlmillet
Copy link
Author

vlmillet commented Feb 26, 2021

I tried and the issue is still there.
I've created a foo.bar file in the root of my includePath, and it doesn't show in the completion list after typing #include <
Is there an option or a setting to set up so that it works ?

@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Feb 26, 2021

You need to reload window after creating the foo.bar because our code for handling the file creation doesn't update the include completion cache unless the created file is extensionless or a known header, i.e. it's a bug -- that looks to be easy to fix for 1.3.0-insiders (I hit the bug 9 days ago, but didn't realize this was the cause (#6987)).

image

@sean-mcmanus
Copy link
Collaborator

The issue mentioned in my previous comment is fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/1.3.0-insiders . Let us know if you notice any other bugs regarding headers with non-standard extensions.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Improvement to an existing feature Feature: Auto-complete fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix
Projects
None yet
Development

No branches or pull requests

4 participants