Eric Amodio пре 4 година
родитељ
комит
f5c351e83e
4 измењених фајлова са 19 додато и 22 уклоњено
  1. +13
    -11
      src/git/models/repository.ts
  2. +1
    -3
      src/views/nodes/fileHistoryNode.ts
  3. +1
    -3
      src/views/nodes/lineHistoryNode.ts
  4. +4
    -5
      src/views/nodes/repositoryNode.ts

+ 13
- 11
src/git/models/repository.ts Прегледај датотеку

@ -726,19 +726,21 @@ export class Repository implements Disposable {
await Container.context.workspaceState.update(WorkspaceState.StarredRepositories, starred);
}
startWatchingFileSystem() {
startWatchingFileSystem() class="o">: Disposable {
this._fsWatchCounter++;
if (this._fsWatcherDisposable != null) return;
if (this._fsWatcherDisposable == null) {
// TODO: createFileSystemWatcher doesn't work unless the folder is part of the workspaceFolders
// https://github.com/Microsoft/vscode/issues/3025
const watcher = workspace.createFileSystemWatcher(new RelativePattern(this.folder, '**'));
this._fsWatcherDisposable = Disposable.from(
watcher,
watcher.onDidChange(this.onFileSystemChanged, this),
watcher.onDidCreate(this.onFileSystemChanged, this),
watcher.onDidDelete(this.onFileSystemChanged, this),
);
}
// TODO: createFileSystemWatcher doesn't work unless the folder is part of the workspaceFolders
// https://github.com/Microsoft/vscode/issues/3025
const watcher = workspace.createFileSystemWatcher(new RelativePattern(this.folder, '**'));
this._fsWatcherDisposable = Disposable.from(
watcher,
watcher.onDidChange(this.onFileSystemChanged, this),
watcher.onDidCreate(this.onFileSystemChanged, this),
watcher.onDidDelete(this.onFileSystemChanged, this),
);
return { dispose: () => this.stopWatchingFileSystem() };
}
stopWatchingFileSystem() {

+ 1
- 3
src/views/nodes/fileHistoryNode.ts Прегледај датотеку

@ -132,11 +132,9 @@ export class FileHistoryNode extends SubscribeableViewNode implements PageableVi
const subscription = Disposable.from(
repo.onDidChange(this.onRepoChanged, this),
repo.onDidChangeFileSystem(this.onRepoFileSystemChanged, this),
{ dispose: () => repo.stopWatchingFileSystem() },
repo.startWatchingFileSystem(),
);
repo.startWatchingFileSystem();
return subscription;
}

+ 1
- 3
src/views/nodes/lineHistoryNode.ts Прегледај датотеку

@ -262,11 +262,9 @@ export class LineHistoryNode extends SubscribeableViewNode implements PageableVi
const subscription = Disposable.from(
repo.onDidChange(this.onRepoChanged, this),
repo.onDidChangeFileSystem(this.onRepoFileSystemChanged, this),
{ dispose: () => repo.stopWatchingFileSystem() },
repo.startWatchingFileSystem(),
);
repo.startWatchingFileSystem();
return subscription;
}

+ 4
- 5
src/views/nodes/repositoryNode.ts Прегледај датотеку

@ -248,11 +248,10 @@ export class RepositoryNode extends SubscribeableViewNode {
// }
if (this.includeWorkingTree) {
disposables.push(this.repo.onDidChangeFileSystem(this.onFileSystemChanged, this), {
dispose: () => this.repo.stopWatchingFileSystem(),
});
this.repo.startWatchingFileSystem();
disposables.push(
this.repo.onDidChangeFileSystem(this.onFileSystemChanged, this),
this.repo.startWatchingFileSystem(),
);
}
return Disposable.from(...disposables);

Loading…
Откажи
Сачувај