8000 If instructionsFilesLocation contains a path that can't be parsed, chat "send" button stops working by aeschli · Pull Request #251911 · microsoft/vscode · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

If instructionsFilesLocation contains a path that can't be parsed, chat "send" button stops working #251911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/

import { URI } from '../../../../../../base/common/uri.js';
import { assert } from '../../../../../../base/common/assert.js';
import { isAbsolute } from '../../../../../../base/common/path.js';
import { ResourceSet } from '../../../../../../base/common/map.js';
import { IFileService } from '../../../../../../platform/files/common/files.js';
Expand All @@ -23,6 +22,7 @@ import { TPromptsStorage } from '../service/promptsService.js';
import { IUserDataProfileService } from '../../../../../services/userDataProfile/common/userDataProfile.js';
import { Emitter, Event } from '../../../../../../base/common/event.js';
import { Disposable, DisposableStore } from '../../../../../../base/common/lifecycle.js';
import { ILogService } from '../../../../../../platform/log/common/log.js';

/**
* Utility class to locate prompt files.
Expand All @@ -36,6 +36,7 @@ export class PromptFilesLocator extends Disposable {
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
@ISearchService private readonly searchService: ISearchService,
@IUserDataProfileService private readonly userDataService: IUserDataProfileService,
@ILogService private readonly logService: ILogService
) {
super();
}
Expand Down Expand Up @@ -209,25 +210,24 @@ export class PromptFilesLocator extends Disposable {
const { folders } = this.workspaceService.getWorkspace();

for (const configuredLocation of configuredLocations) {
if (isAbsolute(configuredLocation)) {
const remoteAuthority = this.environmentService.remoteAuthority;
if (remoteAuthority) {
// if the location is absolute and we are in a remote environment,
// we need to convert it to a file URI with the remote authority
result.add(URI.from({ scheme: Schemas.vscodeRemote, authority: remoteAuthority, path: configuredLocation }));
try {
if (isAbsolute(configuredLocation)) {
let uri = URI.file(configuredLocation);
const remoteAuthority = this.environmentService.remoteAuthority;
if (remoteAuthority) {
// if the location is absolute and we are in a remote environment,
// we need to convert it to a file URI with the remote authority
uri = uri.with({ scheme: Schemas.vscodeRemote, authority: remoteAuthority });
}
result.add(uri);
} else {
result.add(URI.file(configuredLocation));
}
} else {
for (const workspaceFolder of folders) {
const absolutePath = joinPath(workspaceFolder.uri, configuredLocation);
// a sanity check on the expected outcome of the `joinPath()` call
assert(
isAbsolute(absolutePath.path),
`Provided location must be an absolute path, got '${absolutePath.path}'.`,
);
result.add(absolutePath);
for (const workspaceFolder of folders) {
const absolutePath = joinPath(workspaceFolder.uri, configuredLocation);
result.add(absolutePath);
}
}
} catch (error) {
this.logService.error(`Failed to resolve prompt file location: ${configuredLocation}`, error);
}
}

Expand Down
Loading
0