mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-01 22:12:26 +01:00
Use more standard values for scheme constants (#153367)
This drops the `:` from the scheme constants as it was easy to misuse this
This commit is contained in:
@@ -5,21 +5,21 @@
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
export const Schemes = {
|
||||
http: 'http:',
|
||||
https: 'https:',
|
||||
file: 'file:',
|
||||
export const Schemes = Object.freeze({
|
||||
http: 'http',
|
||||
https: 'https',
|
||||
file: 'file',
|
||||
untitled: 'untitled',
|
||||
mailto: 'mailto:',
|
||||
data: 'data:',
|
||||
vscode: 'vscode:',
|
||||
'vscode-insiders': 'vscode-insiders:',
|
||||
mailto: 'mailto',
|
||||
data: 'data',
|
||||
vscode: 'vscode',
|
||||
'vscode-insiders': 'vscode-insiders',
|
||||
notebookCell: 'vscode-notebook-cell',
|
||||
};
|
||||
});
|
||||
|
||||
const knownSchemes = [
|
||||
...Object.values(Schemes),
|
||||
`${vscode.env.uriScheme}:`
|
||||
`${vscode.env.uriScheme}`
|
||||
];
|
||||
|
||||
export function getUriForLinkWithKnownExternalScheme(link: string): vscode.Uri | undefined {
|
||||
@@ -31,5 +31,5 @@ export function getUriForLinkWithKnownExternalScheme(link: string): vscode.Uri |
|
||||
}
|
||||
|
||||
export function isOfScheme(scheme: string, link: string): boolean {
|
||||
return link.toLowerCase().startsWith(scheme);
|
||||
return link.toLowerCase().startsWith(scheme + ':');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user