Skip to content

Add a new IntelliSense translation string and normalize JSON trailing newlines.#14579

Open
sean-mcmanus wants to merge 1 commit into
mainfrom
seanmcm/updateIntelliSenseStringAddJsonNewlines
Open

Add a new IntelliSense translation string and normalize JSON trailing newlines.#14579
sean-mcmanus wants to merge 1 commit into
mainfrom
seanmcm/updateIntelliSenseStringAddJsonNewlines

Conversation

@sean-mcmanus

Copy link
Copy Markdown
Contributor

Add a new IntelliSense translation string and normalize JSON trailing newlines.

Fixed by Copilot (Claude Opus 4.8) in VS Code.

Summary

The C++ IntelliSense language server can now emit an additional diagnostic
message. Its localized message tables under Extension/bin/messages/<locale>/messages.json
are positional arrays indexed by message ID, so every locale's array must be at
least as long as the highest message ID the server can produce. A locale whose
array was shorter than the new message's index would hit an out-of-range lookup
when that diagnostic was emitted, failing the language server for that locale.

This adds the new English string to every locale's table so all locales stay in
sync. The entry is intentionally left in English for now; localized translations
will arrive later through the normal translation-import pipeline.

While making that change, this PR also makes JSON trailing newlines consistent
across the extension and stops them from being silently stripped on save.

Message table update

  • Appended the new string to all 13 locale files in Extension/bin/messages:

    "too many nested user-defined conversions (possible cycle of converting constructors)"
    

    It is added at the same positional index in every locale, matching the new
    message ID, so lookups line up across all languages.

JSON trailing-newline consistency

Two settings in .vscode/settings.json disagreed: [jsonc] inserted a final
newline on save, but [json] did not. Because [json] also formats on save,
saving any .json file reformatted it and then dropped the trailing newline,
producing spurious diffs whenever a JSON file was opened and saved. Several
files had already lost their final newline this way.

Changes:

  • .vscode/settings.json: set files.insertFinalNewline to true for [json]
    (it was false), matching [jsonc]. Saving a JSON file no longer strips the
    trailing newline.
  • Normalized all tracked .json files to end with a single trailing newline,
    including the generated i18n/**/*.i18n.json translation files.
  • gulpfile.js (translations-import): append a trailing newline to each
    generated .i18n.json after it is written, so future translation imports keep
    the files consistent with the convention above. The existing generators for
    bin/messages and package.json already write a trailing newline, so no
    change was needed there.

Notes

  • No behavioral change to the extension beyond preventing the localized failure
    described above; the remaining changes are whitespace-only and tooling.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@sean-mcmanus

Copy link
Copy Markdown
Contributor Author

These shouldn't get checked in until the corresponding cpptools side PR 757614 gets approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pull Request

Development

Successfully merging this pull request may close these issues.

2 participants