sourcegraph / sourcegraph-extension-api

Sourcegraph extension API: use and build extensions that enhance reading and reviewing code in your existing tools. "The extension API you wish your code host had."
44 stars 2 forks source link

Extension request: Git blame #100

Closed sqs closed 5 years ago

sqs commented 6 years ago

The extension API lets you add after-line decorations. As a developer, I would like to be able to toggle on/off seeing blame annotations for all lines in the file. Currently Sourcegraph shows you this on the selected line but not all lines, and GitHub (and other code hosts) requires you to go to a different page for this info.

This would be implemented by:

  1. Show a Blame toggle button and storing the toggle state in settings
  2. When blame is on, fetch the blame data for all lines in the current file (e.g., from the Sourcegraph GraphQL API using sourcegraph.commands.executeCommand('queryGraphQL', graphqlquerystring, mapofvars)
  3. Display an after-line decoration for each line with the blame author, date, commit message summary, abbreviated SHA, etc. (whatever is useful and looks good; there is a lot of prior art here)
sqs commented 5 years ago

Done! https://sourcegraph.com/extensions/sourcegraph/git-extras