Skip to content
Snippets Groups Projects
Open Extension API: Expose hover location in context
  • View options
  • Extension API: Expose hover location in context

  • View options
  • Open Issue created by Administrator

    Created by: eseliger

    TL;DR: We don't expose the line and column of the symbol being hovered on in the extension API (I think?)

    During the hackathon I worked on a project that adds a button to the hover tooltip, using the extension API. Getting the button there worked super well, and I was able to quickly add it where I want. Then, I went ahead and found the open command, which would do just what I need. Open a URL, pass it the hover location, filename, repo, and revision to uniquely identify the location, and done. I then learned about context, which I can use to construct exactly the URL I need. Looking at the available context keys, I found everything I needed and proceeded.

    In the end, I realized that component.selections behaves slightly different than I expected it to. I would've thought that it returns the current hover location, ie. the location that the hover tooltip is pinned to. It is, however, the location that is currently pinned in the blob view (when you click on a line, for example).

    To my understanding, we don't have a context key today for the current hover location in the hover contribution context. Without that, it's hard to build a meaningful extension that adds a button there that does something based on the current hover location. Am I missing something? Or do we not have the hover location exposed to the extension today? If so, can we add it to the context?

    Where = the hover tooltip, not exactly the right position within it, maybe it would also be nice to be able to provide some ordering weight to the contributed button.

    • Merge request
    • Branch

    Activity

    • All activity
    • Comments only
    • History only
    • Newest first
    • Oldest first