NES/Inline Completion - Get more information on show
Problem statement
Compared to the simplified context of ghostText, which would appear only after users cursor, providing guarantees around visibility, NES does not elicit the same behavior.
With possibility of suggestions being collapsed/out of view or presented in views which might not be properly readable/understandable it would be interesting for the engineering teams to understand in more detail what is happening in the guts of inlineCompletion flow.
e.g. which view is being presented, what is the visible range, what is the actual decoration that is shown (since there may be some arbitrary minification applied)
Proposal
Add additional info property on the handleDidShow() function, which could send back to the provider:
viewName: string // e.g. sideBySide, lineReplacement
visibleRanges: Range[] // all the ranges that are visible to the user. Note that diff view can have multiple
edits: TextEdit[] // Diff used for visualisaiton, which can be minified compared to the original edit
cursor: Position // The current cursor position
For example in NES, this would mean that e.g. when user is shown a collapsed suggestion outside of screen, and scrolls to it, we could capture multiple events, allowing to distinguish between user intent to preview and arbitrary scroll. Once the view changes, e.g. to sideBySide it is a much stronger signal of visibility that a simple shown signal, which is now sent once the inlineEdit object is created inside the inlineCompletionsModel.
Happy to contribute with the change