fileService.ts ×7

Frontier kind: Code frontier

unlabeled · c_8df35e359ff0

22 tests · 11649 LOC · 44 files · introduces 0 tests · 25 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges25 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1871 ranges11649 lines · 44 files · Browse complete extent
All tests (intent)
22 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: 25 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/files/common/fileService.ts 25 introduced LOC · 7 ranges

Open complete file

816
817 private async doMoveCopy(sourceProvider: IFileSystemProvider, source: URI, targetProvider: IFileSystemProvider, target: URI, mode: 'move' | 'copy', overwrite: boolean): Promise<'move' | 'copy'> {
818 > if (source.toString() === target.toString()) { fileService.ts
819 return mode; // simulate node.js behaviour here and do a no-op if paths match
820 }
822 > // validation
823 > const { exists, isSameResourceWithDifferentPathCase } = await this.doValidateMoveCopy(sourceProvider, source, targetProvider, target, mode, overwrite);
824 >
825 > // delete as needed (unless target is same resurce with different path case)
826 > if (exists && !isSameResourceWithDifferentPathCase && overwrite) {
827 await this.del(target, { recursive: true });
828 }
830 > // create parent folders
831 > await this.mkdirp(targetProvider, this.getExtUri(targetProvider).providerExtUri.dirname(target));
832 >
833 > // copy source => target
834 > if (mode === 'copy') {
835
836 // same provider with fast copy: leverage copy() functionality
871 }
872 }
873 > } fileService.ts
874
875 private async doCopyFile(sourceProvider: IFileSystemProvider, source: URI, targetProvider: IFileSystemProvider, target: URI): Promise<void> {
915
916 private async doValidateMoveCopy(sourceProvider: IFileSystemProvider, source: URI, targetProvider: IFileSystemProvider, target: URI, mode: 'move' | 'copy', overwrite?: boolean): Promise<{ exists: boolean; isSameResourceWithDifferentPathCase: boolean }> {
917 > let isSameResourceWithDifferentPathCase = false; fileService.ts
918 >
919 > // Check if source is equal or parent to target (requires providers to be the same)
920 > if (sourceProvider === targetProvider) {
921 const { providerExtUri, isPathCaseSensitive } = this.getExtUri(sourceProvider);
922 if (!isPathCaseSensitive) {
932 }
933 }
935 > // Extra checks if target exists and this is not a rename
936 > const exists = await this.exists(target);
937 > if (exists && !isSameResourceWithDifferentPathCase) {
938
939 // Bail out if target exists and we are not about to overwrite
951 }
952 }
954 > return { exists, isSameResourceWithDifferentPathCase };
955 > }
956
957 private getExtUri(provider: IFileSystemProvider): { providerExtUri: IExtUri; isPathCaseSensitive: boolean } {