Skip to content

Commit 39385f2

Browse files
committed
Use propsed content exclusion extensions for vscode language model
1 parent fa80d44 commit 39385f2

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

Extension/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@
3838
"Snippets"
3939
],
4040
"enabledApiProposals": [
41-
"terminalDataWriteEvent"
41+
"terminalDataWriteEvent",
42+
"chatVariableResolver",
43+
"chatParticipantPrivate",
44+
"chatParticipantAdditions"
4245
],
4346
"capabilities": {
4447
"untrustedWorkspaces": {

Extension/src/LanguageServer/Providers/CopilotHoverProvider.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@ export class CopilotHoverProvider implements vscode.HoverProvider {
107107
try {
108108
const response = await this.client.languageClient.sendRequest(GetCopilotHoverInfoRequest, params, this.currentCancellationToken);
109109
requestInfo = response.content;
110+
if (response.files) {
111+
for (const file of response.files) {
112+
const fileUri = vscode.Uri.parse(file);
113+
const token = this.currentCancellationToken ?? new vscode.CancellationTokenSource().token;
114+
if (await vscode.lm.fileIsIgnored(fileUri, token)) {
115+
return "";
116+
}
117+
}
118+
}
119+
110120
} catch (e: any) {
111121
if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) {
112122
throw new vscode.CancellationError();

Extension/src/LanguageServer/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ export interface GetCopilotHoverInfoParams {
541541

542542
interface GetCopilotHoverInfoResult {
543543
content: string;
544+
files: string[];
544545
}
545546

546547
export interface ChatContextResult {

0 commit comments

Comments
 (0)