snippetsMerge.ts ×7

Frontier kind: Code frontier

unlabeled · c_bf0b3b5aeef8

55 tests · 3458 LOC · 19 files · introduces 0 tests · 34 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges34 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
496 ranges3458 lines · 19 files · Browse complete extent
All tests (intent)
55 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.

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: 34 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/userDataSync/common/snippetsMerge.ts 34 introduced LOC · 7 ranges

Open complete file

42 };
43 }
45 > const baseToLocal = compare(base, local);
46 > const baseToRemote = compare(base, remote);
47 >
48 > const remoteAdded: IStringDictionary<string> = {};
49 > const remoteUpdated: IStringDictionary<string> = {};
50 > const remoteRemoved: Set<string> = new Set<string>();
51 >
52 > const conflicts: Set<string> = new Set<string>();
53 >
54 > // Removed snippets in Local
55 > for (const key of baseToLocal.removed.values()) {
56 // Conflict - Got updated in remote.
57 if (baseToRemote.updated.has(key)) {
64 }
65 }
67 > // Removed snippets in Remote
68 > for (const key of baseToRemote.removed.values()) {
69 if (conflicts.has(key)) {
70 continue;
79 }
80 }
82 > // Updated snippets in Local
83 > for (const key of baseToLocal.updated.values()) {
84 if (conflicts.has(key)) {
85 continue;
95 }
96 }
98 > // Updated snippets in Remote
99 > for (const key of baseToRemote.updated.values()) {
100 if (conflicts.has(key)) {
101 continue;
111 }
112 }
114 > // Added snippets in Local
115 > for (const key of baseToLocal.added.values()) {
116 if (conflicts.has(key)) {
117 continue;
127 }
128 }
130 > // Added snippets in remote
131 > for (const key of baseToRemote.added.values()) {
132 if (conflicts.has(key)) {
133 continue;
143 }
144 }
146 > return {
147 > local: { added: localAdded, removed: [...localRemoved.values()], updated: localUpdated },
148 > remote: { added: remoteAdded, removed: [...remoteRemoved.values()], updated: remoteUpdated },
149 > conflicts: [...conflicts.values()],
150 > };
151 > }
152
153 function compare(from: IStringDictionary<string> | null, to: IStringDictionary<string> | null): { added: Set<string>; removed: Set<string>; updated: Set<string> } {