-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathinlineCompletionWithReferences.ts
88 lines (82 loc) · 2.63 KB
/
inlineCompletionWithReferences.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import { InlineCompletionItem } from 'vscode-languageserver-types'
/**
* Extend InlineCompletionItem to include optional references and imports.
*/
export type InlineCompletionItemWithReferences = InlineCompletionItem & {
/**
* Identifier for the the recommendation returned by server.
*/
itemId: string
references?: {
referenceName?: string
referenceUrl?: string
licenseName?: string
position?: {
startCharacter?: number
endCharacter?: number
}
}[]
mostRelevantMissingImports?: {
statement?: string
}[]
}
/**
* Extend InlineCompletionList to include optional references. This is not inheriting from `InlineCompletionList`
* since the `items` arrays are incompatible.
*/
export type InlineCompletionListWithReferences = {
/**
* Server returns a session ID for current recommendation session.
* Client need to attach this session ID in the request when sending
* a completion session results.
*/
sessionId: string
/**
* The inline completion items with optional references
*/
items: InlineCompletionItemWithReferences[]
/**
* Server returns partialResultToken for client to request next set of results
*/
partialResultToken?: number | string
}
export interface InlineCompletionStates {
/**
* Completion item was displayed in the client application UI.
*/
seen: boolean
/**
* Completion item was accepted.
*/
accepted: boolean
/**
* Recommendation was filtered out on the client-side and marked as discarded.
*/
discarded: boolean
}
export interface LogInlineCompletionSessionResultsParams {
/**
* Session Id attached to get completion items response.
* This value must match to the one that server returned in InlineCompletionListWithReferences response.
*/
sessionId: string
/**
* Map with results of interaction with completion items in the client UI.
* This list contain a state of each recommendation items from the recommendation session.
*/
completionSessionResult: {
[itemId: string /* Completion itemId */]: InlineCompletionStates
}
/**
* Time from completion request invocation start to rendering of the first recommendation in the UI.
*/
firstCompletionDisplayLatency?: number
/**
* Total time when items from this completion session were visible in UI
*/
totalSessionDisplayTime?: number
/**
* Length of additional characters inputed by user from when the trigger happens to when the user decision was made
*/
typeaheadLength?: number
}