Repository: vscode
Issue: Redo action does not reveal content that was added by accepting inlay hint
Labels: bug,inlay-hints

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 1.86.0-insider (Universal) and 1.85.1 (Universal)
- OS Version: macOS 14.1.1

## Steps to Reproduce:

1. Apply any inlay hint. (refer to the **note section** below)
2. Undo.
3. Scroll to make the line where the suggestion was applied out of view.
4. Redo.

## Expected result:
I expected the editor to automatically scroll to the position where the change was made, as it usually does.

## Actual result:
After performing the redo action and reapplying the suggestion, the scroll position and cursor remain unchanged. Users need to manually navigate to the modified code to verify it.

## Screencast
https://github.com/microsoft/vscode/assets/116561995/471b88d3-08b0-4fdd-8e4d-0ee6dede892b


## NOTE
I am not aware of any built-in functionality that offers insertable inlay hints. To achieve this functionality, extensions such as [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) can be utilized. In this scenario, create a cargo project containing the following content in the **main.rs** file (an inlay hint will be generated for the type of variable `a`)
```rust
fn main() {
  let _a = 2;
}
/* 

Blank space

*/
```
#### OR
This can be achieved by modifying the source code of the built-in extension **vscode.typescript-language-features**.
Add the following line below the [result.paddingRight = hint.whitespaceAfter;](https://github.com/aramikuto/vscode/blob/860d67064a9c1ef8ce0c8de35a78bea01033f76c/extensions/typescript-language-features/src/languageFeatures/inlayHints.ts#L104) in **extensions/typescript-language-features/src/languageFeatures/inlayHints.ts:104** 
```ts
result.paddingLeft = hint.whitespaceBefore;
result.paddingRight = hint.whitespaceAfter;
result.textEdits = [new vscode.TextEdit(new vscode.Range(new vscode.Position(hint.position.line - 1, hint.position.offset), new vscode.Position(hint.position.line - 1, hint.position.offset)), ':any /*[HINTED]*/')];
```
and create a new typescript file with the following content :
```ts
const foo = Date.now();
/*

Blank space

*/
```
In this scenario, the setting `typescript.inlayHints.variableTypes.enabled` must be turned on to display the hint.