browserSearch.ts ×12

Frontier kind: Code frontier

unlabeled · c_98e5b2f98a76

9 tests · 3685 LOC · 19 files · introduces 0 tests · 55 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges55 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
518 ranges3685 lines · 19 files · Browse complete extent
All tests (intent)
9 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

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 native relationship evidence on this page.

Introduced files, introduced tests, and structurally relevant concept specializationbrowserSearch.ts ×4 · 8 introduced LOCbrowserSearch.ts ×4browserSearch.ts ×6 · 15 introduced LOCbrowserSearch.ts ×6fragment is a URL (percent-encoded later)|occurrence=1, browserSearch.test|title=BrowserSearch - resolveAddressBarInput input is trimmed before classification|occurrence=1 · 0 introduced LOCfragment is a URL (perce…browserSearch.ts ×4 · 16 introduced LOCbrowserSearch.ts ×4browserSearch.ts ×2 · 5 introduced LOCbrowserSearch.ts ×2browserSearch.ts ×4 · 9 introduced LOCbrowserSearch.ts ×4browserSearch.ts ×6 · 13 introduced LOCbrowserSearch.ts ×6browserSearch.test|title=BrowserSearch - resolveAddressBarInput whitespace in the userinfo with an IP-literal host is still a URL|occurrence=1 · 0 introduced LOCbrowserSearch.test|title…browserSearch.ts ×2 · 4 introduced LOCbrowserSearch.ts ×2browserSearch.test|title=BrowserSearch - resolveAddressBarInput an explicit http(s) scheme keeps whitespace-userinfo input a URL|occurrence=1 · 0 introduced LOCbrowserSearch.test|title…browserSearch.ts ×2 · 7 introduced LOCbrowserSearch.ts ×2browserSearch.ts ×4 · 13 introduced LOCbrowserSearch.ts ×4browserSearch.ts ×1 · 2 introduced LOCbrowserSearch.ts ×1browserSearch.ts ×2 · 5 introduced LOCbrowserSearch.ts ×2browserSearch.ts ×1 · 3 introduced LOCbrowserSearch.ts ×1browserSearch.ts ×1 · 7 introduced LOCbrowserSearch.ts ×1browserSearch.ts ×1 · 3 introduced LOCbrowserSearch.ts ×1browserSearch.ts ×1 · 4 introduced LOCbrowserSearch.ts ×1browserSearch.ts ×1 · 2 introduced LOCbrowserSearch.ts ×1browserSearch.ts ×8 · 19 introduced LOCbrowserSearch.ts ×8browserSearch.ts ×8 · 211 introduced LOCbrowserSearch.ts ×8uri.test|title=URI URI#file, win-speciale|occurrence=1, charCode.test|title=CharCode has good values|occurrence=1, +2 · 0 introduced LOCuri.test|title=URI URI#f…utils.ts ×3 · 9 introduced LOCutils.ts ×3nls.ts ×1 · 1 introduced LOCnls.ts ×1nls.ts ×6 · 13 introduced LOCnls.ts ×6lifecycle.ts ×2 · 4 introduced LOClifecycle.ts ×2lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×4 · 8 introduced LOClifecycle.ts ×4lifecycle.ts ×6 · 16 introduced LOClifecycle.ts ×6lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×1 · 3 introduced LOClifecycle.ts ×1map.ts ×97 · 3334 introduced LOCmap.ts ×97src/vs/base/common/arrays.ts · 949 LOCcommon/arrays.tssrc/vs/base/common/arraysFind.ts · 226 LOCcommon/arraysFind.tssrc/vs/base/common/assert.ts · 91 LOCcommon/assert.tssrc/vs/base/common/charCode.ts · 450 LOCcommon/charCode.tssrc/vs/base/common/collections.ts · 176 LOCcommon/collections.tssrc/vs/base/common/errors.ts · 357 LOCcommon/errors.tssrc/vs/base/common/functional.ts · 32 LOCcommon/functional.tssrc/vs/base/common/iterator.ts · 194 LOCcommon/iterator.tssrc/vs/base/common/lifecycle.ts · 974 LOCcommon/lifecycle.tssrc/vs/base/common/map.ts · 1016 LOCcommon/map.tssrc/vs/base/common/marshallingIds.ts · 33 LOCcommon/marshallingIds.tssrc/vs/base/common/path.ts · 1589 LOCcommon/path.tssrc/vs/base/common/platform.ts · 281 LOCcommon/platform.tssrc/vs/base/common/process.ts · 76 LOCcommon/process.tssrc/vs/base/common/types.ts · 410 LOCcommon/types.tssrc/vs/base/common/uri.ts · 754 LOCcommon/uri.tssrc/vs/base/test/common/utils.ts · 107 LOCcommon/utils.tssrc/vs/nls.ts · 244 LOCvs/nls.tssrc/vs/workbench/contrib/browserView/common/browserSearch.ts · 449 LOCcommon/browserSearch.tscharCode.test|title=CharCode has good values|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/charCode.test|title=CharCode has good values|occurrence=1charCode.test|title=Char…path.test|title=Paths (Node Implementation) path|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/path.test|title=Paths (Node Implementation) path|occurrence=1path.test|title=Paths (N…uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1uri.test|title=URI File …uri.test|title=URI URI#file, win-speciale|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI URI#file, win-speciale|occurrence=1uri.test|title=URI URI#f…browserSearch.test|title=BrowserSearch - resolveAddressBarInput ambiguous inputs return unknown|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/browserView/test/common/browserSearch.test|title=BrowserSearch - resolveAddressBarInput ambiguous inputs return unknown|occurrence=1browserSearch.test|title…browserSearch.test|title=BrowserSearch - resolveAddressBarInput an explicit http(s) scheme keeps whitespace-userinfo input a URL|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/browserView/test/common/browserSearch.test|title=BrowserSearch - resolveAddressBarInput an explicit http(s) scheme keeps whitespace-userinfo input a URL|occurrence=1browserSearch.test|title…browserSearch.test|title=BrowserSearch - resolveAddressBarInput input is trimmed before classification|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/browserView/test/common/browserSearch.test|title=BrowserSearch - resolveAddressBarInput input is trimmed before classification|occurrence=1browserSearch.test|title…browserSearch.test|title=BrowserSearch - resolveAddressBarInput queries (whitespace or invalid host chars) return query|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/browserView/test/common/browserSearch.test|title=BrowserSearch - resolveAddressBarInput queries (whitespace or invalid host chars) return query|occurrence=1browserSearch.test|title…browserSearch.test|title=BrowserSearch - resolveAddressBarInput recognized schemes are URLs|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/browserView/test/common/browserSearch.test|title=BrowserSearch - resolveAddressBarInput recognized schemes are URLs|occurrence=1browserSearch.test|title…browserSearch.test|title=BrowserSearch - resolveAddressBarInput scheme-less hosts and IPs are URLs|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/browserView/test/common/browserSearch.test|title=BrowserSearch - resolveAddressBarInput scheme-less hosts and IPs are URLs|occurrence=1browserSearch.test|title…fragment is a URL (percent-encoded later)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/browserView/test/common/browserSearch.test|title=BrowserSearch - resolveAddressBarInput whitespace in the path/query/fragment is a URL (percent-encoded later)|occurrence=1fragment is a URL (perce…browserSearch.test|title=BrowserSearch - resolveAddressBarInput whitespace in the userinfo is unknown (defaults to search)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/browserView/test/common/browserSearch.test|title=BrowserSearch - resolveAddressBarInput whitespace in the userinfo is unknown (defaults to search)|occurrence=1browserSearch.test|title…browserSearch.test|title=BrowserSearch - resolveAddressBarInput whitespace in the userinfo with an IP-literal host is still a URL|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/browserView/test/common/browserSearch.test|title=BrowserSearch - resolveAddressBarInput whitespace in the userinfo with an IP-literal host is still a URL|occurrence=1browserSearch.test|title…Focused concept · browserSearch.ts ×12 · 55 introduced LOCbrowserSearch.ts ×12

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 55 introduced LOC across 12 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/browserView/common/browserSearch.ts 55 introduced LOC · 12 ranges

Open complete file

154 * `HOST_CHARS_REGEX` at the call site).
155 */
156 > function toAsciiHost(host: string): string | undefined { browserSearch.ts
157 > const needsUrlParse = host.startsWith('[') || !/^[\x00-\x7F]*$/.test(host);
158 > if (!needsUrlParse) {
159 > return host;
160 > }
161 try {
162 return new URL(`http://${host}`).hostname;
164 return undefined;
165 }
167
168 interface IParsedAuthority {
173 }
174
175 > function parseHostAndPath(rest: string): IParsedAuthority { browserSearch.ts
176 > const sepMatch = /[/?#]/.exec(rest);
177 > const authority = sepMatch ? rest.slice(0, sepMatch.index) : rest;
178 > const pathAndRest = sepMatch ? rest.slice(sepMatch.index) : '';
179 >
180 > let userinfo: string | undefined;
181 > let hostport = authority;
182 > const atIdx = authority.lastIndexOf('@');
183 > if (atIdx >= 0) {
184 userinfo = authority.slice(0, atIdx);
185 hostport = authority.slice(atIdx + 1);
186 }
188 > let host = hostport;
189 > let port: string | undefined;
190 > if (host.startsWith('[')) {
191 const end = host.indexOf(']');
192 if (end >= 0) {
199 }
200 }
201 > } else { browserSearch.ts
202 > const colonIdx = host.lastIndexOf(':');
203 > if (colonIdx >= 0) {
204 const maybePort = host.slice(colonIdx + 1);
205 if (PORT_REGEX.test(maybePort)) {
208 }
209 }
211 >
212 > return { userinfo, host, port, pathAndRest };
213 > }
214
215 function hasKnownTld(host: string): boolean {
323 return 'unknown';
324 }
326 > // http / https / scheme-less from here on. Strip the scheme prefix (and
327 > // optional `//`) for authority parsing — but only if we actually
328 > // recognized a scheme above. For inputs like `localhost:3000` where
329 > // `candidateScheme` is set but `scheme` is undefined, we leave the
330 > // colon in place so it's parsed as host:port.
331 > let rest = trimmed;
332 > if (scheme) {
333 rest = trimmed.slice(schemeMatch![0].length);
334 if (rest.startsWith('//')) {
336 }
337 }
339 > const { userinfo, host: rawHost, port, pathAndRest } = parseHostAndPath(rest);
340 >
341 > // Host-less input that starts with `/` is treated as an absolute path URL
342 > // (e.g. `/usr/local/bin`, `//example.com`).
343 > if (rawHost.length === 0) {
344 return pathAndRest.startsWith('/') ? 'url' : 'query';
345 }
347 > // Canonicalize the host via the WHATWG URL parser: converts Unicode
348 > // hostnames to punycode/IDN and validates/canonicalizes bracketed IPv6
349 > // literals. Falls back to `query` if the host can't be canonicalized.
350 > const host = toAsciiHost(rawHost);
351 > if (host === undefined) {
352 return 'query';
353 }
355 > // A canonicalized bracketed IPv6 literal is a URL.
356 if (host.startsWith('[') && host.endsWith(']')) {
357 return 'url';
358 }
360 > // Validate host characters.
361 > if (!HOST_CHARS_REGEX.test(host)) {
362 return 'query';
363 }
365 > // IPv4 dotted-quad.
366 > const ipv4Match = IPV4_REGEX.exec(host);
367 > if (ipv4Match) {
368 const octets = ipv4Match.slice(1, 5).map(Number);
369 if (octets.every(o => o <= 255)) {