-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
Expose a Way to Determine if a User Changes Thier Text Document Language Using the Language Mode Option in the VS Code UI #227643
Comments
In C/C++, whether a ".h" file should be interpreted as C, C++ or even CUDA, depends on what other file(s) include that file. The C/C++ Extension will leverage an 'include graph' to determine an appropriate source file to use, and the header file will be interpreted in the context of that source file. (The source file is used to build the IntelliSense Translation Unit). This is also useful in order to configure IntelliSense properly, as configurations from custom configuration providers (CMake Tools, Makefile Tools), or Currently, we automatically change the file association of that header file (using This ask is for an API that indicates if the user explicitly selected a language to associate a file with vs. using a default (or otherwise auto-corrected) association. If we detect that an explicit selection was made, we could choose an appropriate language source file (if available) that matches that language, in the scenario I described above, instead of considering the entire include graph. A secondary issue here is that the A tertiary issue is that |
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation. Happy Coding! |
This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation. Happy Coding! |
🙁 In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation. Happy Coding! |
We are currently working on the C++ Extension on adding behavior that will correctly identify the textDocumentLanguage of an extensionless file that is opened using a C++ extension feature. We are running into an issue where when we use the vscode.languages.setTextDocumentLanguage() when we first open a file, we overwrite any language mode that is selected through the UI in the bottom right.
We want to be able to detect whether the textDocument for a file was set using this option so we do not overwrite it. Is there an existing way to identify this? If not, would it be possible to add a flag to determine if this is how a textDocument language was set?
This is in reference to microsoft/vscode-cpptools#4077
The text was updated successfully, but these errors were encountered: