1
>
/*---------------------------------------------------------------------------------------------
network.ts
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 * as errors from './errors.js';
7
>
import * as platform from './platform.js';
8
>
import { equalsIgnoreCase, startsWithIgnoreCase } from './strings.js';
9
>
import { URI } from './uri.js';
10
>
import * as paths from './path.js';
11
>
12
>
export namespace Schemas {
13
>
14
>
/**
15
>
* A schema that is used for models that exist in memory
16
>
* only and that have no correspondence on a server or such.
17
>
*/
18
>
export const inMemory = 'inmemory';
19
>
20
>
/**
21
>
* A schema that is used for setting files
22
>
*/
23
>
export const vscode = 'vscode';
24
>
25
>
/**
26
>
* A schema that is used for internal private files
27
>
*/
28
>
export const internal = 'private';
29
>
30
>
/**
31
>
* A walk-through document.
32
>
*/
33
>
export const walkThrough = 'walkThrough';
34
>
35
>
/**
36
>
* An embedded code snippet.
37
>
*/
38
>
export const walkThroughSnippet = 'walkThroughSnippet';
39
>
40
>
export const http = 'http';
41
>
42
>
export const https = 'https';
43
>
44
>
export const file = 'file';
45
>
46
>
export const mailto = 'mailto';
47
>
48
>
export const untitled = 'untitled';
49
>
50
>
export const data = 'data';
51
>
52
>
export const command = 'command';
53
>
54
>
export const vscodeRemote = 'vscode-remote';
55
>
56
>
export const vscodeRemoteResource = 'vscode-remote-resource';
57
>
58
>
export const vscodeManagedRemoteResource = 'vscode-managed-remote-resource';
59
>
60
>
export const vscodeUserData = 'vscode-userdata';
61
>
62
>
export const vscodeCustomEditor = 'vscode-custom-editor';
63
>
64
>
export const vscodeNotebookCell = 'vscode-notebook-cell';
65
>
export const vscodeNotebookCellMetadata = 'vscode-notebook-cell-metadata';
66
>
export const vscodeNotebookCellMetadataDiff = 'vscode-notebook-cell-metadata-diff';
67
>
export const vscodeNotebookCellOutput = 'vscode-notebook-cell-output';
68
>
export const vscodeNotebookCellOutputDiff = 'vscode-notebook-cell-output-diff';
69
>
export const vscodeNotebookMetadata = 'vscode-notebook-metadata';
70
>
export const vscodeInteractiveInput = 'vscode-interactive-input';
71
>
72
>
export const vscodeSettings = 'vscode-settings';
73
>
74
>
export const vscodeWorkspaceTrust = 'vscode-workspace-trust';
75
>
76
>
export const vscodeTerminal = 'vscode-terminal';
77
>
78
>
/** Scheme used for the image carousel editor. */
79
>
export const vscodeImageCarousel = 'vscode-image-carousel';
80
>
81
>
/** Scheme used for code blocks in chat. */
82
>
export const vscodeChatCodeBlock = 'vscode-chat-code-block';
83
>
84
>
/** Scheme used for LHS of code compare (aka diff) blocks in chat. */
85
>
export const vscodeChatCodeCompareBlock = 'vscode-chat-code-compare-block';
86
>
87
>
/** Scheme used for the chat input editor. */
88
>
export const vscodeChatEditor = 'vscode-chat-editor';
89
>
90
>
/** Scheme used for the chat input part */
91
>
export const vscodeChatInput = 'chatSessionInput';
92
>
93
>
/** Scheme used for local chat session content */
94
>
export const vscodeLocalChatSession = 'vscode-chat-session';
95
>
96
>
/**
97
>
* Scheme used internally for webviews that aren't linked to a resource (i.e. not custom editors)
98
>
*/
99
>
export const webviewPanel = 'webview-panel';
100
>
101
>
/**
102
>
* Scheme used for loading the wrapper html and script in webviews.
103
>
*/
104
>
export const vscodeWebview = 'vscode-webview';
105
>
106
>
/**
107
>
* Scheme used for integrated browser tabs using WebContentsView.
108
>
*/
109
>
export const vscodeBrowser = 'vscode-browser';
110
>
111
>
/**
112
>
* Scheme used for extension pages
113
>
*/
114
>
export const extension = 'extension';
115
>
116
>
/**
117
>
* Scheme used as a replacement of `file` scheme to load
118
>
* files with our custom protocol handler (desktop only).
119
>
*/
120
>
export const vscodeFileResource = 'vscode-file';
121
>
122
>
/**
123
>
* Scheme used for temporary resources
124
>
*/
125
>
export const tmp = 'tmp';
126
>
127
>
/**
128
>
* Scheme used vs live share
129
>
*/
130
>
export const vsls = 'vsls';
131
>
132
>
/**
133
>
* Scheme used for the Source Control commit input's text document
134
>
*/
135
>
export const vscodeSourceControl = 'vscode-scm';
136
>
137
>
/**
138
>
* Scheme used for input box for creating comments.
139
>
*/
140
>
export const commentsInput = 'comment';
141
>
142
>
/**
143
>
* Scheme used for special rendering of settings in the release notes
144
>
*/
145
>
export const codeSetting = 'code-setting';
146
>
147
>
/**
148
>
* Scheme used for output panel resources
149
>
*/
150
>
export const outputChannel = 'output';
151
>
152
>
/**
153
>
* Scheme used for the accessible view
154
>
*/
155
>
export const accessibleView = 'accessible-view';
156
>
157
>
/**
158
>
* Used for snapshots of chat edits
159
>
*/
160
>
export const chatEditingSnapshotScheme = 'chat-editing-snapshot-text-model';
161
>
export const chatEditingModel = 'chat-editing-text-model';
162
>
163
>
/**
164
>
* Used for rendering multidiffs in copilot agent sessions
165
>
*/
166
>
export const copilotPr = 'copilot-pr';
167
>
}
168
>
169
>
export function matchesScheme(target: URI | string, scheme: string): boolean {
170
if (URI.isUri(target)) {
171
return equalsIgnoreCase(target.scheme, scheme);