Skip to content

Incorrect activeParameter in type declarations for signature help. #6040

@ckipp01

Description

@ckipp01

Describe the bug

Given a minimal piece of code like this:

trait Test[A, B] {
  def doThing[C](f: B => Test[A@@, C]) = ???
}

Assume the user triggers a signature help indicated at the position of @@. Current the request and the response looks like this:

[Trace - 01:40:58 PM] Received request 'textDocument/signatureHelp - (11)'
Params: {
  "textDocument": {
    "uri": "file:///Users/ckipp/Documents/scala-workspace/minimal/Test.scala"
  },
  "position": {
    "line": 1,
    "character": 30
  }
}


[Trace - 01:40:58 PM] Sending response 'textDocument/signatureHelp - (11)'. Processing request took 88ms
Result: {
  "signatures": [
    {
      "label": "Test[A, B]: Test",
      "parameters": [
        {
          "label": "A"
        },
        {
          "label": "B"
        }
      ]
    }
  ],
  "activeSignature": 0,
  "activeParameter": 1
}

Notice the activeParameter is 1 when it should be 0 causing this to display incorrectly:

Screenshot 2024-01-23 at 13 43 47

Expected behavior

I'd expect this to return 0 as the active parameter.

Operating system

macOS

Editor/Extension

Nvim (nvim-metals)

Version of Metals

1.2.0+77-ecb7dcfd-SNAPSHOT

Extra context or search terms

No response

Metadata

Metadata

Assignees

Labels

bugSomething that is making a piece of functionality unusableupstream-fix-neededWaiting on a fix upstream

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions