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

Changes to files.encoding should trigger purge/reparse of all files (without BOM) in DB #10892

Closed
Colengms opened this issue Apr 27, 2023 · 0 comments · Fixed by #13047
Closed
Assignees
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service parser world ready An issue relating string character encodings, localization translations, etc.
Milestone

Comments

@Colengms
Copy link
Contributor

Currently, if the files.encoding setting is changed, a new parse-root occurs. That's not sufficient.

The value of files.encoding is used to interpret files read directly from disk by the native processes (cpptools.exe and cpptools-srv.exe). If a file does not have a BOM and is not detected to be UTF-16, it's assumed to be in the specified encoding. Files are converted from that encoding to UTF-8. (VS Code does the same. It provide buffers for files open in the editor that are already converted to UTF-8).

Either the entire database needs to be reset, or encoding info about the file could be added to the database and only those files that had relied upon the default/fallback encoding could be purged/reparsed.

The last seen encoding setting value should also be persisted. If the user changes the encoding when the C/C++ extension is not active, the database work still needs to occur.

@Colengms Colengms added this to the Backlog milestone Apr 27, 2023
@Colengms Colengms added world ready An issue relating string character encodings, localization translations, etc. parser labels Apr 27, 2023
@bobbrow bobbrow added this to cpptools Dec 9, 2024
@bobbrow bobbrow moved this to Todo in cpptools Dec 9, 2024
@Colengms Colengms moved this from Todo to In progress in cpptools Dec 12, 2024
@sean-mcmanus sean-mcmanus modified the milestones: Backlog, 1.23.3 Dec 14, 2024
@sean-mcmanus sean-mcmanus moved this from In progress to Pull Request in cpptools Dec 16, 2024
@github-project-automation github-project-automation bot moved this from Pull Request to Done in cpptools Dec 16, 2024
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service parser world ready An issue relating string character encodings, localization translations, etc.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants