Bladeren bron

Code-splits the file annotations

main
Eric Amodio 1 jaar geleden
bovenliggende
commit
0a9c584a08
1 gewijzigde bestanden met toevoegingen van 15 en 8 verwijderingen
  1. +15
    -8
      src/annotations/fileAnnotationController.ts

+ 15
- 8
src/annotations/fileAnnotationController.ts Bestand weergeven

@ -39,10 +39,7 @@ import type {
} from '../trackers/gitDocumentTracker';
import type { AnnotationContext, AnnotationProviderBase, TextEditorCorrelationKey } from './annotationProvider';
import { AnnotationStatus, getEditorCorrelationKey } from './annotationProvider';
import { GutterBlameAnnotationProvider } from './gutterBlameAnnotationProvider';
import type { ChangesAnnotationContext } from './gutterChangesAnnotationProvider';
import { GutterChangesAnnotationProvider } from './gutterChangesAnnotationProvider';
import { GutterHeatmapBlameAnnotationProvider } from './gutterHeatmapBlameAnnotationProvider';
export const enum AnnotationClearReason {
User = 'User',
@ -467,17 +464,27 @@ export class FileAnnotationController implements Disposable {
let provider: AnnotationProviderBase | undefined = undefined;
switch (type) {
case FileAnnotationType.Blame:
case FileAnnotationType.Blame: {
const { GutterBlameAnnotationProvider } = await import(
/* webpackChunkName: "annotations-blame" */ './gutterBlameAnnotationProvider'
);
provider = new GutterBlameAnnotationProvider(editor, trackedDocument, this.container);
break;
case FileAnnotationType.Changes:
}
case FileAnnotationType.Changes: {
const { GutterChangesAnnotationProvider } = await import(
/* webpackChunkName: "annotations-changes" */ './gutterChangesAnnotationProvider'
);
provider = new GutterChangesAnnotationProvider(editor, trackedDocument, this.container);
break;
case FileAnnotationType.Heatmap:
}
case FileAnnotationType.Heatmap: {
const { GutterHeatmapBlameAnnotationProvider } = await import(
/* webpackChunkName: "annotations-heatmap" */ './gutterHeatmapBlameAnnotationProvider'
);
provider = new GutterHeatmapBlameAnnotationProvider(editor, trackedDocument, this.container);
break;
}
}
if (provider == null || !(await provider.validate())) return undefined;

Laden…
Annuleren
Opslaan