workingCopyService.ts ×9

Frontier kind: Joint frontier

unlabeled · c_85ac5d59e3d0

1 test · 23892 LOC · 123 files · introduces 1 test · 44 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges44 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
2783 ranges23892 lines · 123 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.

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.

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

src/vs/workbench/services/workingCopy/common/workingCopyService.ts 36 introduced LOC · 9 ranges

Open complete file

207 this._onDidRegister.fire(workingCopy);
208 if (workingCopy.isDirty()) {
209 > this._onDidChangeDirty.fire(workingCopy); workingCopyService.ts
210 > }
211
212 // Track Leaks
242 // (a disposed working copy cannot account for being dirty in our model)
243 if (workingCopy.isDirty()) {
244 > this._onDidChangeDirty.fire(workingCopy); workingCopyService.ts
245 > }
246
247 // Remove all listeners associated to working copy
252 has(resource: URI): boolean;
253 has(resourceOrIdentifier: URI | IWorkingCopyIdentifier): boolean {
254 > if (URI.isUri(resourceOrIdentifier)) { workingCopyService.ts
255 > return this.mapResourceToWorkingCopies.has(resourceOrIdentifier);
256 > }
257 >
258 > return this.mapResourceToWorkingCopies.get(resourceOrIdentifier.resource)?.has(resourceOrIdentifier.typeId) ?? false;
259 > }
260
261 get(identifier: IWorkingCopyIdentifier): IWorkingCopy | undefined {
262 > return this.mapResourceToWorkingCopies.get(identifier.resource)?.get(identifier.typeId); workingCopyService.ts
263 > }
264
265 getAll(resource: URI): readonly IWorkingCopy[] | undefined {
266 const workingCopies = this.mapResourceToWorkingCopies.get(resource);
267 if (!workingCopies) {
268 > return undefined; workingCopyService.ts
269 > }
270
271 return Array.from(workingCopies.values());
319
320 get hasDirty(): boolean {
321 > for (const workingCopy of this._workingCopies) { workingCopyService.ts
322 > if (workingCopy.isDirty()) {
323 > return true;
324 > }
325 > }
326 >
327 > return false;
328 > }
329
330 get dirtyCount(): number {
341
342 get dirtyWorkingCopies(): IWorkingCopy[] {
343 > return this.workingCopies.filter(workingCopy => workingCopy.isDirty()); workingCopyService.ts
344 > }
345
346 get modifiedCount(): number {
347 > let totalModifiedCount = 0; workingCopyService.ts
348 >
349 > for (const workingCopy of this._workingCopies) {
350 > if (workingCopy.isModified()) {
351 > totalModifiedCount++;
352 > }
353 > }
354 >
355 > return totalModifiedCount;
356 > }
357
358 get modifiedWorkingCopies(): IWorkingCopy[] {
359 > return this.workingCopies.filter(workingCopy => workingCopy.isModified()); workingCopyService.ts
360 > }
361
362 isDirty(resource: URI, typeId?: string): boolean {
src/vs/workbench/test/common/workbenchTestServices.ts 8 introduced LOC · 3 ranges

Open complete file

225
226 setContent(content: string): void {
227 > this._onDidChangeContent.fire(); workbenchTestServices.ts
228 > }
229
230 isDirty(): boolean {
233
234 isModified(): boolean {
235 > return this.isDirty(); workbenchTestServices.ts
236 > }
237
238 async save(options?: ISaveOptions, stat?: IFileStatWithMetadata): Promise<boolean> {
239 > this._onDidSave.fire({ reason: options?.reason ?? SaveReason.EXPLICIT, stat: stat ?? createFileStat(this.resource), source: options?.source }); workbenchTestServices.ts
240 >
241 > return true;
242 > }
243
244 async revert(options?: IRevertOptions): Promise<void> {