Skip to content

Commit 81652e8

Browse files
committed
Fix some stuff
1 parent b25a1c5 commit 81652e8

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

src/@types/vscode.proposed.chatParticipantAdditions.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ declare module 'vscode' {
105105
isComplete?: boolean;
106106
toolSpecificData?: ChatTerminalToolInvocationData;
107107
fromSubAgent?: boolean;
108-
presentation?: 'hidden' | 'hiddenAfterComplete' | undefined;
109108

110109
constructor(toolName: string, toolCallId: string, isError?: boolean);
111110
}

src/@types/vscode.proposed.chatSessionsProvider.d.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ declare module 'vscode' {
9595
*/
9696
description?: string | MarkdownString;
9797

98-
/**
99-
* An optional badge that provides additional context about the chat session.
100-
*/
101-
badge?: string | MarkdownString;
102-
10398
/**
10499
* An optional status indicating the current state of the session.
105100
*/

src/common/temporaryState.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import * as vscode from 'vscode';
66
import { disposeAll } from './lifecycle';
77
import Logger from './logger';
8+
import { isDescendant } from './utils';
89

910
let tempState: TemporaryState | undefined;
1011

@@ -39,14 +40,13 @@ export class TemporaryState extends vscode.Disposable {
3940
}
4041
}
4142

42-
private async writeState(subpath: string, filename: string, contents: Uint8Array, persistInSession: boolean, repositoryUri?: vscode.Uri): Promise<vscode.Uri> {
43+
private async writeState(subpath: string, filename: string, contents: Uint8Array, persistInSession: boolean, repositoryUri: vscode.Uri): Promise<vscode.Uri> {
4344
let filePath: vscode.Uri = this.path;
4445
let workspace: string | undefined;
4546

46-
// If repositoryUri is provided, find the matching workspace folder
47-
if (repositoryUri && vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) {
47+
if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) {
4848
const matchingFolder = vscode.workspace.workspaceFolders.find(folder =>
49-
folder.uri.toString() === repositoryUri.toString()
49+
isDescendant(folder.uri.fsPath, repositoryUri.fsPath) || isDescendant(repositoryUri.fsPath, folder.uri.fsPath)
5050
);
5151
workspace = matchingFolder?.name;
5252
}
@@ -80,14 +80,13 @@ export class TemporaryState extends vscode.Disposable {
8080
return file;
8181
}
8282

83-
private async readState(subpath: string, filename: string, repositoryUri?: vscode.Uri): Promise<Uint8Array> {
83+
private async readState(subpath: string, filename: string, repositoryUri: vscode.Uri): Promise<Uint8Array> {
8484
let filePath: vscode.Uri = this.path;
8585
let workspace: string | undefined;
8686

87-
// If repositoryUri is provided, find the matching workspace folder
88-
if (repositoryUri && vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) {
87+
if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) {
8988
const matchingFolder = vscode.workspace.workspaceFolders.find(folder =>
90-
folder.uri.toString() === repositoryUri.toString()
89+
isDescendant(folder.uri.fsPath, repositoryUri.fsPath) || isDescendant(repositoryUri.fsPath, folder.uri.fsPath)
9190
);
9291
workspace = matchingFolder?.name;
9392
}
@@ -123,15 +122,15 @@ export class TemporaryState extends vscode.Disposable {
123122
}
124123
}
125124

126-
static async write(subpath: string, filename: string, contents: Uint8Array, persistInSession: boolean = false, repositoryUri?: vscode.Uri): Promise<vscode.Uri | undefined> {
125+
static async write(subpath: string, filename: string, contents: Uint8Array, persistInSession: boolean = false, repositoryUri: vscode.Uri): Promise<vscode.Uri | undefined> {
127126
if (!tempState) {
128127
return;
129128
}
130129

131130
return tempState.writeState(subpath, filename, contents, persistInSession, repositoryUri);
132131
}
133132

134-
static async read(subpath: string, filename: string, repositoryUri?: vscode.Uri): Promise<Uint8Array | undefined> {
133+
static async read(subpath: string, filename: string, repositoryUri: vscode.Uri): Promise<Uint8Array | undefined> {
135134
if (!tempState) {
136135
return;
137136
}

0 commit comments

Comments
 (0)