1

I have a definition provider for my language extension for VSCode which works in giving a go-to link and a preview of the definition when holding down Ctrl and hovering over the text. I would like the hover that is provided when you activate the definition provider to always be active on hovering and not just on holding down Ctrl.

I cannot figure out a way to configure it in VSCode so that the DefinitionProvider is always showing the hover without holding down Ctrl.

I have tried just doing a seperate HoverProvider method to always provide the hover, but this creates duplicated hovers when I activate the DefinitionProvider to use the go-to-link. I cannot find a way to prevent the HoverProvider from being active while the DefinitionProvider hover is active or vice versa.

If anyone knows of a way to make it so only one hover shows up or to configure VSCode separately from the code to make it so that the DefinitionProvider preview is always visible I would appreciate it.

Sophia
  • 13
  • 1
  • 3
  • I have figured out a workaround. I used the HoverProvider to display the definition and in the DefinitionProvider the location I provide has the correct document uri but the range is essentially empty. `Location.create(uri, { start: { line: startLine, character: 0 }, end: { line: startLine, character: 0 } })` – Sophia Apr 25 '23 at 21:43

0 Answers0