monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

[Bug] inlay hint bug in sticky line

Open troy351 opened this issue 1 year ago • 1 comments

Reproducible in vscode.dev or in VS Code Desktop?

  • [X] Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.51.0#XQAAAAKbAQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscwzt51RgmSaumWUF-TBOs7hSruXioSxyeSO7k_l1UIzWNddFqt-6khNLmgbO-hd7_R9DHrqg9S4UTF4tNbOQ6HWysoutPZajWg6a6p4gu_aijmUDOoVbql1zvXc--j_6BXxKfUIVOWBV9SRM_oPYAAYrQcgs4cuI-zuvU2UoPxlzIsSmj0jQAnUhWfyLjRI4l3nvAhiuyIF2IfXsiOdgKeb7Is2JnTgxZZFStTSaAvLaA3NgEtQlWZiPCXmcRie_aVz43uf7KgfKtbSUdLQRooKr943W_-09tDdvotyVJQx3akcatJmcaqAbBMuWvIp5VFoWEvI_w91R8

Monaco Editor Playground Code

const value = `
function foo(option) {}

export default foo({
${'  //\n'.repeat(80)}
  bar() {
    //
  },
})
`;

const editor = monaco.editor.create(document.getElementById("container"), {
  value,
  language: "javascript",
});

monaco.languages.typescript.javascriptDefaults.setInlayHintsOptions({
  includeInlayParameterNameHints: 'all',
})

Reproduction Steps

  • Open playground link
  • scroll down the preview code to about line number 88

Actual (Problematic) Behavior

image

Expected Behavior

no bug

Additional Context

No response

troy351 avatar Aug 27 '24 10:08 troy351

Can repro. @aiday-mar can you look into this in debt week?

hediet avatar Aug 28 '24 07:08 hediet

Hi thank you for filing this issue. After some investigation I believe sticky scroll works as intended, it is reflecting the editor lines which themselves have a growing number of inlay hints appended to them. You can see this happen in the following screen recording where we briefly see the actual editor lines with all the extra inlay hints.

https://github.com/user-attachments/assets/460fc235-b5d9-491b-88b6-f7da27a7bcf5

This behavior is also mirrored in the following issue https://github.com/microsoft/monaco-editor/issues/4700. I will close this issue, as it is a consequence of the root cause of the issue.

aiday-mar avatar Dec 11 '24 09:12 aiday-mar