Skip to content

Commit 905206b

Browse files
feat: update to latest Copilot LSP
1 parent c1bb86a commit 905206b

File tree

4 files changed

+594
-570
lines changed

4 files changed

+594
-570
lines changed

copilot/js/api/types.d.ts

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,14 @@ export interface ContextProvider<T extends SupportedContextItem> {
5151
selector: DocumentSelector;
5252
resolver: ContextResolver<T>;
5353
}
54+
55+
export type ResolveOnTimeoutResult<T> = T | readonly T[];
56+
export type ResolveResult<T> = Promise<T> | Promise<readonly T[]> | AsyncIterable<T>;
57+
5458
export interface ContextResolver<T extends SupportedContextItem> {
55-
resolve(request: ResolveRequest, token: CancellationToken): Promise<T> | Promise<T[]> | AsyncIterable<T>;
59+
resolve(request: ResolveRequest, token: CancellationToken): ResolveResult<T>;
60+
// Optional method to be invoked if the request timed out. This requests additional context items.
61+
resolveOnTimeout?(request: ResolveRequest): ResolveOnTimeoutResult<T> | undefined;
5662
}
5763

5864
/**
@@ -141,14 +147,6 @@ export interface ResolveRequest {
141147
data?: unknown;
142148
}
143149

144-
/**
145-
* A context item marked as backup will only be used if the provider hits the timeout
146-
* and is not able to fully resolve.
147-
*/
148-
export enum ContextItemTag {
149-
Backup = 'backup',
150-
}
151-
152150
/**
153151
* These are the data types that can be provided by a context provider. Any non-conforming
154152
* context items will be filtered out.
@@ -175,13 +173,6 @@ interface ContextItem {
175173
* - update: context is provided via context/update
176174
*/
177175
origin?: ContextItemOrigin;
178-
179-
/**
180-
* Tags are used to provide additional metadata about the context item. Valid tags
181-
* are defined in the ContextItemTag. The type is a string[] to allow arbitrary tags
182-
* to be passed without failing schema validation.
183-
*/
184-
tags?: string[];
185176
}
186177

187178
// A key-value pair used for short string snippets.

copilot/js/main.js

Lines changed: 583 additions & 550 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

copilot/js/main.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lua/copilot/util.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function M.get_editor_info()
1313
editorPluginInfo = {
1414
name = "copilot.lua",
1515
-- reflects version of github/copilot-language-server-release
16-
version = "1.329.0",
16+
version = "1.338.0",
1717
},
1818
}
1919
return info

0 commit comments

Comments
 (0)