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

Stale inlayHints in worksheets #7050

Open
ckipp01 opened this issue Dec 19, 2024 · 0 comments
Open

Stale inlayHints in worksheets #7050

ckipp01 opened this issue Dec 19, 2024 · 0 comments
Labels
bug Something that is making a piece of functionality unusable worksheets Use for tickets related to worksheets

Comments

@ckipp01
Copy link
Member

ckipp01 commented Dec 19, 2024

Describe the bug

If I have a piece of code like this:

val x = "hello"

I will correctly get the inlay hints I'd expect. However If I change hello to 3 like this:

val x = 3

but don't save the buffer yet I get sent inlay hints again that look like this:

[Trace - 09:08:10 PM] Sending response 'textDocument/inlayHint - (53)'. Processing request took 24ms
Result: [
  {
    "position": {
      "line": 1,
      "character": 5
    },
    "label": [
      {
        "value": ": "
      },
      {
        "value": "Int"
      }
    ],
    "kind": 1,
    "data": {
      "uri": "file:///Users/ckipp/Documents/scala-workspace/inlay-test/src/main/scala/example/example.worksheet.sc",
      "labelParts": [
        {
          "dataType": "string",
          "string": ""
        },
        {
          "dataType": "string",
          "string": "scala/Int#"
        }
      ]
    }
  },
  {
    "position": {
      "line": 1,
      "character": 9
    },
    "label": " // : String \u003d \"hello\"",
    "tooltip": "x: String \u003d \"hello\""
  }
]

Notice that it still includes the hello hints at the bottom causing the hints to look not right in your editor.

Expected behavior

When these hints are sent it should only send them for what is currently in the buffer, not text that has been removed.

Operating system

macOS

Editor/Extension

Nvim (nvim-metals)

Version of Metals

latest snapshot

Extra context or search terms

No response

@tgodzik tgodzik added bug Something that is making a piece of functionality unusable worksheets Use for tickets related to worksheets labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is making a piece of functionality unusable worksheets Use for tickets related to worksheets
Projects
Status: Triage
Development

No branches or pull requests

2 participants