@github/copilot-language-server 1.248.0 → 1.249.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/types.d.ts +74 -0
- package/dist/compiled/darwin/arm64/node_sqlite3.node +0 -0
- package/dist/compiled/darwin/x64/node_sqlite3.node +0 -0
- package/dist/compiled/linux/arm64/node_sqlite3.node +0 -0
- package/dist/compiled/linux/x64/node_sqlite3.node +0 -0
- package/dist/compiled/win32/x64/node_sqlite3.node +0 -0
- package/dist/language-server.js +248 -248
- package/dist/language-server.js.map +3 -3
- package/native/darwin-arm64/copilot-language-server +0 -0
- package/native/darwin-x64/copilot-language-server +0 -0
- package/native/linux-x64/copilot-language-server +0 -0
- package/native/win32-x64/copilot-language-server.exe +0 -0
- package/package.json +10 -4
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import {CancellationToken, Disposable, DocumentSelector, DocumentUri} from 'vscode-languageserver-protocol';
|
|
2
|
+
|
|
3
|
+
// Properties common to all context items
|
|
4
|
+
interface ContextItem {
|
|
5
|
+
/**
|
|
6
|
+
* Specifies the relative importance with respect to items of the same type.
|
|
7
|
+
* Cross-type comparisons is currently handled by the wishlist.
|
|
8
|
+
* Accepted values are integers in the range [0, 100], where 100 is the highest importance.
|
|
9
|
+
* Items with non-conforming importance values will be filtered out.
|
|
10
|
+
* Default value is 0.
|
|
11
|
+
*/
|
|
12
|
+
importance?: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// A key-value pair used for short string snippets.
|
|
16
|
+
export interface Trait extends ContextItem {
|
|
17
|
+
name: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Code snippet extracted from a file. The URI is used for content exclusion.
|
|
22
|
+
export interface CodeSnippet extends ContextItem {
|
|
23
|
+
uri: string;
|
|
24
|
+
value: string;
|
|
25
|
+
// Additional URIs that contribute the same code snippet.
|
|
26
|
+
additionalUris?: string[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type SupportedContextItem = Trait | CodeSnippet;
|
|
30
|
+
|
|
31
|
+
export interface ContextProviderApiV1 {
|
|
32
|
+
registerContextProvider<T extends SupportedContextItem>(provider: ContextProvider<T>): Disposable;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface ContextProvider<T extends SupportedContextItem> {
|
|
36
|
+
id: string;
|
|
37
|
+
selector: DocumentSelector;
|
|
38
|
+
resolver: ContextResolver<T>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface ContextResolver<T extends SupportedContextItem> {
|
|
42
|
+
resolve(context: CompletionContext, token: CancellationToken): Promise<T> | Promise<T[]> | AsyncIterable<T>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface DocumentContext {
|
|
46
|
+
uri: DocumentUri;
|
|
47
|
+
languageId: string;
|
|
48
|
+
version: number;
|
|
49
|
+
offset: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type Status = 'full' | 'partial' | 'none';
|
|
53
|
+
|
|
54
|
+
export type ContextUsageStatistics = {
|
|
55
|
+
usage: Status;
|
|
56
|
+
resolution: Status;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export interface CompletionContext {
|
|
60
|
+
documentContext: DocumentContext;
|
|
61
|
+
|
|
62
|
+
activeExperiments: Map<string, string | number | boolean | string[]>;
|
|
63
|
+
|
|
64
|
+
// The number of milliseconds for the context provider to provide context items.
|
|
65
|
+
// After the time budget runs out, the request will be cancelled and the CLS will stop
|
|
66
|
+
// iterating additional context items.
|
|
67
|
+
// Providers can use this value as a hint when computing context. Providers should expect the
|
|
68
|
+
// request to be cancelled once the time budget runs out.
|
|
69
|
+
timeBudget: number;
|
|
70
|
+
|
|
71
|
+
// Various statistics about the last completion request. This can be used by the context provider
|
|
72
|
+
// to make decisions about what context to provide for the current call.
|
|
73
|
+
previousUsageStatistics?: ContextUsageStatistics;
|
|
74
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|