sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.11k stars 1.27k forks source link

trailing line number #3827

Closed yoonsio closed 5 years ago

yoonsio commented 5 years ago

Steps to reproduce:

I am not sure if this is expected behaviour but there is trailing :<number> appended at the end of link.

  1. Go to following github coder: https://github.com/hyperledger/fabric/blob/release-1.4/core/chaincode/shim/chaincode.go#L458
  2. Click on handleGetState and click on Go to definition
  3. Check :25 appended at the end of url.

Expected behavior:

Link should take you to L304

https://github.com/hyperledger/fabric/blob/release-1.4/core/chaincode/shim/handler.go#L304

Actual behavior:

Additional line number :25 appended at the end.

https://github.com/hyperledger/fabric/blob/release-1.4/core/chaincode/shim/handler.go#L304:25
dadlerj commented 5 years ago

Hey @sickyoon — yeah, this is expected. The :25 indicates that the selected symbol (the function name) starts at the 25th character on the 304th line. This lets Sourcegraph know what tooltip to show if there are multiple symbols on a line (e.g. for an argument to the function).