Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/src/extension/chatSessions/claude/common/claudeSessionUri.ts
13405 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { URI } from '../../../../util/vs/base/common/uri';
7
8
export namespace ClaudeSessionUri {
9
export const scheme = 'claude-code';
10
11
export function forSessionId(sessionId: string): URI {
12
return URI.from({ scheme: ClaudeSessionUri.scheme, path: '/' + sessionId });
13
}
14
15
export function getSessionId(resource: URI): string {
16
if (resource.scheme !== ClaudeSessionUri.scheme) {
17
throw new Error('Invalid resource scheme for Claude Code session');
18
}
19
20
return resource.path.slice(1);
21
}
22
}
23
24