Skip to content

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

@Colengms

Description

@Colengms

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.

Metadata

Metadata

Assignees

Labels

Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.parserworld readyAn issue relating string character encodings, localization translations, etc.

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions