settingsMerge.ts ×9

Frontier kind: Code frontier

unlabeled · c_a14ffcb2e9f0

27 tests · 11123 LOC · 47 files · introduces 0 tests · 36 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges36 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1256 ranges11123 lines · 47 files · Browse complete extent
All tests (intent)
27 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: 36 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/userDataSync/common/settingsMerge.ts 36 introduced LOC · 9 ranges

Open complete file

128 return { conflictsSettings: [], localContent, remoteContent: null, hasConflicts: false };
129 }
131 > /* remote and local has changed */
132 > let localContent = originalLocalContent;
133 > let remoteContent = originalRemoteContent;
134 > const local = parse(originalLocalContent);
135 > const remote = parse(originalRemoteContent);
136 const base = baseContent ? parse(baseContent) : null;
137
165 }
166 }
168 > // Removed settings in Remote
169 > for (const key of baseToRemote.removed.values()) {
170 if (handledConflicts.has(key)) {
171 continue;
180 }
181 }
183 > // Updated settings in Local
184 > for (const key of baseToLocal.updated.values()) {
185 if (handledConflicts.has(key)) {
186 continue;
196 }
197 }
199 > // Updated settings in Remote
200 > for (const key of baseToRemote.updated.values()) {
201 if (handledConflicts.has(key)) {
202 continue;
212 }
213 }
215 > // Added settings in Local
216 > for (const key of baseToLocal.added.values()) {
217 if (handledConflicts.has(key)) {
218 continue;
228 }
229 }
231 > // Added settings in remote
232 > for (const key of baseToRemote.added.values()) {
233 if (handledConflicts.has(key)) {
234 continue;
244 }
245 }
247 > const hasConflicts = conflicts.size > 0 || !areSame(localContent, remoteContent, ignoredSettings);
248 const hasLocalChanged = hasConflicts || !areSame(localContent, originalLocalContent, []);
249 const hasRemoteChanged = hasConflicts || !areSame(remoteContent, originalRemoteContent, []);
296 }
297
298 > function compare(from: IStringDictionary<any> | null, to: IStringDictionary<any>, ignored: Set<string>): { added: Set<string>; removed: Set<string>; updated: Set<string> } { settingsMerge.ts
299 > const fromKeys = from ? Object.keys(from).filter(key => !ignored.has(key)) : [];
300 > const toKeys = Object.keys(to).filter(key => !ignored.has(key));
301 > const added = toKeys.filter(key => !fromKeys.includes(key)).reduce((r, key) => { r.add(key); return r; }, new Set<string>());
302 > const removed = fromKeys.filter(key => !toKeys.includes(key)).reduce((r, key) => { r.add(key); return r; }, new Set<string>());
303 > const updated: Set<string> = new Set<string>();
304 >
305 > if (from) {
306 > for (const key of fromKeys) {
307 if (removed.has(key)) {
308 continue;
314 }
315 }
317 >
318 > return { added, removed, updated };
319 > }
320
321 export function addSetting(key: string, sourceContent: string, targetContent: string, formattingOptions: FormattingOptions): string {