Incorrect hover behavior on GitHub outdated PR comment snippets
Created by: sqs
Repro:
Hover over tokens on line 516 above https://github.com/sourcegraph/codeintellify/pull/77#discussion_r240263029. Hovers do not work on this snippet. This causes #1334 (closed) because it causes any provider to be invoked incorrectly, with:
- A document URI with the head SHA of the PR 0c3d013aab9353f75b0bd1fa0e358dbc8c048f4c, not the head SHA of the snippet ce472adbfc6ac8ccf1bf7afbe71f18505ca994ec (note the "outdated", indicating that the snippet is actually from an older head of the PR). Note that this bug is hard to notice because usually PR heads don't differ too much. This bug alone would probably NOT cause #1334 (closed) by itself, but it is definitely problematic.
- Empty
text
; i.e., if the provider is(doc, pos) => { ... }
, thedoc.text
value is"\n"
(i.e., the string consisting of a single newline). Thedoc.text
value should be the full document contents of src/hoverifier.ts at SHA ce472adbfc6ac8ccf1bf7afbe71f18505ca994ec.
cc @lguychard