src/vs/workbench/contrib/externalUriOpener/common/configuration.ts

73 LOC · 67 covered · 6 uncovered · 1 ranges · 5 concepts · 1 introducers · 3 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the filesrc/vs/workbench/contrib/externalUriOpener/common/externalUriOpenerService.ts · 239 LOCcommon/externalUriOpener…externalUriOpenerService.ts ×2 · 4 introduced LOCexternalUriOpenerService…externalUriOpenerService.ts ×1 · 2 introduced LOCexternalUriOpenerService…externalUriOpenerService.ts ×9 · 38 introduced LOCexternalUriOpenerService…externalUriOpenerService.ts ×2 · 3 introduced LOCexternalUriOpenerService…externalUriOpenerService.ts ×9 · 172 introduced LOCexternalUriOpenerService…externalUriOpenerService.test|title=ExternalUriOpenerService Should automatically pick single preferred opener without prompt|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/externalUriOpener/test/common/externalUriOpenerService.test|title=ExternalUriOpenerService Should automatically pick single preferred opener without prompt|occurrence=1externalUriOpenerService…externalUriOpenerService.test|title=ExternalUriOpenerService Should not open if there are no openers|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/externalUriOpener/test/common/externalUriOpenerService.test|title=ExternalUriOpenerService Should not open if there are no openers|occurrence=1externalUriOpenerService…externalUriOpenerService.test|title=ExternalUriOpenerService Should prompt if there is at least one enabled opener|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/externalUriOpener/test/common/externalUriOpenerService.test|title=ExternalUriOpenerService Should prompt if there is at least one enabled opener|occurrence=1externalUriOpenerService…Focused file · src/vs/workbench/contrib/externalUriOpener/common/configuration.ts · 73 LOCcommon/configuration.ts

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 > /*--------------------------------------------------------------------------------------------- externalUriOpenerService.ts ×9
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 { IConfigurationNode, IConfigurationRegistry, Extensions } from '../../../../platform/configuration/common/configurationRegistry.js';
7 > import { workbenchConfigurationNodeBase } from '../../../common/configuration.js';
8 > import * as nls from '../../../../nls.js';
9 > import { IJSONSchema } from '../../../../base/common/jsonSchema.js';
10 > import { Registry } from '../../../../platform/registry/common/platform.js';
11 >
12 > export const defaultExternalUriOpenerId = 'default';
13 >
14 > export const externalUriOpenersSettingId = 'workbench.externalUriOpeners';
15 >
16 > export interface ExternalUriOpenersConfiguration {
17 > readonly [uriGlob: string]: string;
18 > }
19 >
20 > const externalUriOpenerIdSchemaAddition: IJSONSchema = {
21 > type: 'string',
22 > enum: []
23 > };
24 >
25 > const exampleUriPatterns = `
26 > - \`https://microsoft.com\`: Matches this specific domain using https
27 > - \`https://microsoft.com:8080\`: Matches this specific domain on this port using https
28 > - \`https://microsoft.com:*\`: Matches this specific domain on any port using https
29 > - \`https://microsoft.com/foo\`: Matches \`https://microsoft.com/foo\` and \`https://microsoft.com/foo/bar\`, but not \`https://microsoft.com/foobar\` or \`https://microsoft.com/bar\`
30 > - \`https://*.microsoft.com\`: Match all domains ending in \`microsoft.com\` using https
31 > - \`microsoft.com\`: Match this specific domain using either http or https
32 > - \`*.microsoft.com\`: Match all domains ending in \`microsoft.com\` using either http or https
33 > - \`http://192.168.0.1\`: Matches this specific IP using http
34 > - \`http://192.168.0.*\`: Matches all IP's with this prefix using http
35 > - \`*\`: Match all domains using either http or https`;
36 >
37 > export const externalUriOpenersConfigurationNode: IConfigurationNode = {
38 > ...workbenchConfigurationNodeBase,
39 > properties: {
40 > [externalUriOpenersSettingId]: {
41 > type: 'object',
42 > markdownDescription: nls.localize('externalUriOpeners', "Configure the opener to use for external URIs (http, https)."),
43 > defaultSnippets: [{
44 > body: {
45 > 'example.com': '$1'
46 > }
47 > }],
48 > additionalProperties: {
49 > anyOf: [
50 > {
51 > type: 'string',
52 > markdownDescription: nls.localize('externalUriOpeners.uri', "Map URI pattern to an opener id.\nExample patterns: \n{0}", exampleUriPatterns),
53 > },
54 > {
55 > type: 'string',
56 > markdownDescription: nls.localize('externalUriOpeners.uri', "Map URI pattern to an opener id.\nExample patterns: \n{0}", exampleUriPatterns),
57 > enum: [defaultExternalUriOpenerId],
58 > enumDescriptions: [nls.localize('externalUriOpeners.defaultId', "Open using VS Code's standard opener.")],
59 > },
60 > externalUriOpenerIdSchemaAddition
61 > ]
62 > }
63 > }
64 > }
65 > };
66 >
67 > export function updateContributedOpeners(enumValues: string[], enumDescriptions: string[]): void {
68 externalUriOpenerIdSchemaAddition.enum = enumValues;
69 externalUriOpenerIdSchemaAddition.enumDescriptions = enumDescriptions;
70
71 Registry.as<IConfigurationRegistry>(Extensions.Configuration)
72 .notifyConfigurationSchemaUpdated(externalUriOpenersConfigurationNode);
73 }