extensionsMerge.ts ×8

Frontier kind: Code frontier

unlabeled · c_a90166636091

66 tests · 3563 LOC · 20 files · introduces 0 tests · 24 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges24 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
527 ranges3563 lines · 20 files · Browse complete extent
All tests (intent)
66 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: 24 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/userDataSync/common/extensionsMerge.ts 24 introduced LOC · 8 ranges

Open complete file

74 const localToRemote = compare(localExtensionsMap, remoteExtensionsMap, ignoredExtensionsSet, false);
75 if (localToRemote.added.size > 0 || localToRemote.removed.size > 0 || localToRemote.updated.size > 0) {
77 > const baseToLocal = compare(lastSyncExtensionsMap, localExtensionsMap, ignoredExtensionsSet, false);
78 > const baseToRemote = compare(lastSyncExtensionsMap, remoteExtensionsMap, ignoredExtensionsSet, true);
79 >
80 > const merge = (key: string, localExtension: ISyncExtension, remoteExtension: ISyncExtension, preferred: ISyncExtension): ISyncExtension => {
81 let pinned: boolean | undefined, version: string | undefined, preRelease: boolean | undefined;
82 if (localExtension.installed) {
111 };
112 };
114 > // Remotely removed extension => exist in base and does not in remote
115 > for (const key of baseToRemote.removed.values()) {
116 const localExtension = localExtensionsMap.get(key);
117 if (!localExtension) {
130
131 }
133 > // Remotely added extension => does not exist in base and exist in remote
134 > for (const key of baseToRemote.added.values()) {
135 const remoteExtension = assertReturnsDefined(remoteExtensionsMap.get(key));
136 const localExtension = localExtensionsMap.get(key);
154 }
155 }
157 > // Remotely updated extension => exist in base and remote
158 > for (const key of baseToRemote.updated.values()) {
159 const remoteExtension = assertReturnsDefined(remoteExtensionsMap.get(key));
160 const baseExtension = assertReturnsDefined(lastSyncExtensionsMap?.get(key));
180
181 }
183 > // Locally added extension => does not exist in base and exist in local
184 > for (const key of baseToLocal.added.values()) {
185 // If added in remote (already handled)
186 if (baseToRemote.added.has(key)) {
189 newRemoteExtensionsMap.set(key, assertReturnsDefined(localExtensionsMap.get(key)));
190 }
192 > // Locally updated extension => exist in base and local
193 > for (const key of baseToLocal.updated.values()) {
194 // If removed in remote (already handled)
195 if (baseToRemote.removed.has(key)) {
205 newRemoteExtensionsMap.set(key, merge(key, localExtension, remoteExtension, localExtension));
206 }
208 > // Locally removed extensions => exist in base and does not exist in local
209 > for (const key of baseToLocal.removed.values()) {
210 // If updated in remote (already handled)
211 if (baseToRemote.updated.has(key)) {
234 newRemoteExtensionsMap.delete(key);
235 }
237
238 const remote: ISyncExtension[] = [];