Skip to content

Commit

Permalink
Merge pull request #352 from CodinGame/fix-registered-file-system-window
Browse files Browse the repository at this point in the history
Fix registered file system on Window
  • Loading branch information
CGNonofr authored Feb 26, 2024
2 parents 932c0dd + 5dd50a9 commit c6d475b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/service-override/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { DisposableStore, IDisposable, Disposable, toDisposable } from 'vs/base/
import { extUri, joinPath } from 'vs/base/common/resources'
import { Emitter, Event } from 'vs/base/common/event'
import { HTMLFileSystemProvider } from 'vs/platform/files/browser/htmlFileSystemProvider'
import * as path from 'vs/base/common/path'
import 'vs/workbench/contrib/files/browser/files.configuration.contribution'
import { Schemas } from 'vs/base/common/network'
import { IndexedDBFileSystemProvider, IndexedDBFileSystemProviderErrorData, IndexedDBFileSystemProviderErrorDataClassification } from 'vs/platform/files/browser/indexedDBFileSystemProvider'
import { IndexedDB } from 'vs/base/browser/indexedDB'
Expand All @@ -25,6 +23,7 @@ import { BrowserElevatedFileService } from 'vs/workbench/services/files/browser/
import { IElevatedFileService } from 'vs/workbench/services/files/common/elevatedFileService'
import { checkServicesNotInitialized, registerServiceInitializePreParticipant } from '../lifecycle'
import { logsPath } from '../workbench'
import 'vs/workbench/contrib/files/browser/files.configuration.contribution'

abstract class RegisteredFile {
private ctime: number
Expand Down Expand Up @@ -153,12 +152,11 @@ class RegisteredFileSystemProvider extends Disposable implements IFileSystemProv
disposableStore.add(file.onDidRename(({ from, to }) => {
if (this.files.get(from.toString()) === file) {
this.files.delete(from.toString())
this.files.set(to.toString(), file)
this._onDidChangeFile.fire([{
resource: from,
type: FileChangeType.DELETED
}])
this.files.set(to.toString(), file)
this._onDidChangeFile.fire([{
}, {
resource: to,
type: FileChangeType.ADDED
}])
Expand Down Expand Up @@ -191,7 +189,7 @@ class RegisteredFileSystemProvider extends Disposable implements IFileSystemProv

public async readdir (resource: URI): Promise<[string, FileType][]> {
const includedPaths = Array.from(this.files.keys())
.map(uri => path.relative(resource.path, URI.parse(uri).path))
.map(uri => extUri.relativePath(resource, URI.parse(uri))!)
.filter(path => !path.startsWith('..'))

const files = includedPaths.filter(path => !path.includes('/'))
Expand Down

0 comments on commit c6d475b

Please sign in to comment.