path.ts ×3

Frontier kind: Joint frontier

unlabeled · c_c502e64a8b8b

1 test · 3505 LOC · 18 files · introduces 1 test · 67 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
3 ranges67 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
502 ranges3505 lines · 18 files · Browse complete extent
All tests (intent)
1 testBrowse 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 specializationpath.ts ×1 · 3 introduced LOCpath.ts ×1path.ts ×4 · 14 introduced LOCpath.ts ×4path.ts ×1 · 6 introduced LOCpath.ts ×1path.ts ×1 · 2 introduced LOCpath.ts ×1path.ts ×6 · 24 introduced LOCpath.ts ×6path.ts ×2 · 3 introduced LOCpath.ts ×2path.ts ×1 · 3 introduced LOCpath.ts ×1uri.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 ×3lifecycle.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 ×1path.ts ×2 · 3 introduced LOCpath.ts ×2lifecycle.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.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) extname|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/path.test|title=Paths (Node Implementation) extname|occurrence=1path.test|title=Paths (N…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…Focused concept · path.ts ×3 · 67 introduced LOCpath.ts ×3

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.

1 test introduced at this concept.

Introduced code

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

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

src/vs/base/common/path.ts 67 introduced LOC · 3 ranges

Open complete file

908
909 extname(path: string): string {
910 > validateString(path, 'path'); path.ts
911 > let start = 0;
912 > let startDot = -1;
913 > let startPart = 0;
914 > let end = -1;
915 > let matchedSlash = true;
916 > // Track the state of characters (if any) we see before our first dot and
917 > // after any path separator we find
918 > let preDotState = 0;
919 >
920 > // Check for a drive letter prefix so as not to mistake the following
921 > // path separator as an extra separator at the end of the path that can be
922 > // disregarded
923 >
924 > if (path.length >= 2 &&
925 > path.charCodeAt(1) === CHAR_COLON &&
926 > isWindowsDeviceRoot(path.charCodeAt(0))) {
927 > start = startPart = 2;
928 > }
929 >
930 > for (let i = path.length - 1; i >= start; --i) {
931 > const code = path.charCodeAt(i);
932 > if (isPathSeparator(code)) {
933 > // If we reached a path separator that was not part of a set of path
934 > // separators at the end of the string, stop now
935 > if (!matchedSlash) {
936 > startPart = i + 1;
937 > break;
938 > }
939 > continue;
940 > }
941 > if (end === -1) {
942 > // We saw the first non-path separator, mark this as the end of our
943 > // extension
944 > matchedSlash = false;
945 > end = i + 1;
946 > }
947 > if (code === CHAR_DOT) {
948 > // If this is our first dot, mark it as the start of our extension
949 > if (startDot === -1) {
950 > startDot = i;
951 > }
952 > else if (preDotState !== 1) {
953 > preDotState = 1;
954 > }
955 > } else if (startDot !== -1) {
956 > // We saw a non-dot and non-path separator before our dot, so we should
957 > // have a good chance at having a non-empty extension
958 > preDotState = -1;
959 > }
960 > }
961 >
962 > if (startDot === -1 ||
963 > end === -1 ||
964 > // We saw a non-dot character immediately before the dot
965 > preDotState === 0 ||
966 > // The (right-most) trimmed path component is exactly '..'
967 > (preDotState === 1 &&
968 > startDot === end - 1 &&
969 > startDot === startPart + 1)) {
970 > return '';
971 > }
972 > return path.slice(startDot, end);
973 > },
974
975 format: _format.bind(null, '\\'),
1445 break;
1446 }
1447 > continue; path.ts
1448 > }
1449 if (end === -1) {
1450 // We saw the first non-path separator, mark this as the end of our
1474 // The (right-most) trimmed path component is exactly '..'
1475 (preDotState === 1 &&
1476 > startDot === end - 1 && path.ts
1477 startDot === startPart + 1)) {
1478 return '';