Parcourir la source

Delays the custom view to improve startup time

main
Eric Amodio il y a 7 ans
Parent
révision
3be416faf0
5 fichiers modifiés avec 14 ajouts et 9 suppressions
  1. +1
    -0
      CHANGELOG.md
  2. +1
    -1
      package.json
  3. +3
    -1
      src/commands.ts
  4. +1
    -0
      src/constants.ts
  5. +8
    -7
      src/extension.ts

+ 1
- 0
CHANGELOG.md Voir le fichier

@ -27,6 +27,7 @@ ATTENTION! To support multi-root workspaces some underlying fundamentals had to
- Optimizes event handling, executing git commands, and general processing to improve performance and reduce any lag
- Optimizes current line hover annotations to only be computed on hover (i.e. lazily evaluated) to reduce the compute required when changing lines
- Protects credentials from possibly being affected by poor network conditions via Git Credential Manager (GCM) for Windows environment variables
- Delays (slightly) the initial loading of the `GitLens` custom view to improve startup performance
### Fixed
- Fixes jumpy code lens when deleting characters from a line with a Git code lens

+ 1
- 1
package.json Voir le fichier

@ -2162,7 +2162,7 @@
{
"id": "gitlens.gitExplorer",
"name": "GitLens",
"when": "gitlens:enabled && gitlens:hasRepository && config.gitlens.gitExplorer.enabled"
"when": "gitlens:enabled && gitlens:gitExplorer && gitlens:hasRepository && config.gitlens.gitExplorer.enabled"
}
]
}

+ 3
- 1
src/commands.ts Voir le fichier

@ -1,5 +1,5 @@
'use strict';
import { ExtensionContext } from 'vscode';
import { commands, ExtensionContext } from 'vscode';
import { AnnotationController } from './annotations/annotationController';
import { CurrentLineController } from './currentLineController';
import { CodeLensController } from './codeLensController';
@ -58,6 +58,8 @@ export function configureCommands(
currentLineController: CurrentLineController,
codeLensController: CodeLensController
): void {
context.subscriptions.push(commands.registerTextEditorCommand('gitlens.computingFileAnnotations', () => { }));
context.subscriptions.push(new Commands.CloseUnchangedFilesCommand(git));
context.subscriptions.push(new Commands.OpenChangedFilesCommand(git));
context.subscriptions.push(new Commands.ExternalDiffCommand(git));

+ 1
- 0
src/constants.ts Voir le fichier

@ -28,6 +28,7 @@ export enum CommandContext {
AnnotationStatus = 'gitlens:annotationStatus',
CanToggleCodeLens = 'gitlens:canToggleCodeLens',
Enabled = 'gitlens:enabled',
GitExplorer = 'gitlens:gitExplorer',
GitExplorerAutoRefresh = 'gitlens:gitExplorer:autoRefresh',
GitExplorerFilesLayout = 'gitlens:gitExplorer:files:layout',
GitExplorerView = 'gitlens:gitExplorer:view',

+ 8
- 7
src/extension.ts Voir le fichier

@ -1,6 +1,5 @@
'use strict';
// import { Objects } from './system';
import { commands, ExtensionContext, extensions, languages, window, workspace } from 'vscode';
import { ExtensionContext, extensions, languages, window, workspace } from 'vscode';
import { AnnotationController } from './annotations/annotationController';
import { CodeLensLocations, Configuration, IConfig, LineHighlightLocations } from './configuration';
import { ApplicationInsightsKey, CommandContext, ExtensionKey, GlobalState, QualifiedExtensionId, setCommandContext } from './constants';
@ -66,23 +65,25 @@ export async function activate(context: ExtensionContext) {
const annotationController = new AnnotationController(context, git, gitContextTracker);
context.subscriptions.push(annotationController);
const codeLensController = new CodeLensController(context, git, gitContextTracker);
context.subscriptions.push(codeLensController);
const currentLineController = new CurrentLineController(context, git, gitContextTracker, annotationController);
context.subscriptions.push(currentLineController);
context.subscriptions.push(new Keyboard());
const codeLensController = new CodeLensController(context, git, gitContextTracker);
context.subscriptions.push(codeLensController);
context.subscriptions.push(workspace.registerTextDocumentContentProvider(GitContentProvider.scheme, new GitContentProvider(context, git)));
context.subscriptions.push(languages.registerCodeLensProvider(GitRevisionCodeLensProvider.selector, new GitRevisionCodeLensProvider(context, git)));
context.subscriptions.push(window.registerTreeDataProvider('gitlens.gitExplorer', new GitExplorer(context, git)));
context.subscriptions.push(commands.registerTextEditorCommand('gitlens.computingFileAnnotations', () => { }));
context.subscriptions.push(new Keyboard());
configureCommands(context, git, annotationController, currentLineController, codeLensController);
// Constantly over my data cap so stop collecting initialized event
// Telemetry.trackEvent('initialized', Objects.flatten(cfg, 'config', true));
// Slightly delay enabling the explorer to not stop the rest of GitLens from being usable
setTimeout(() => setCommandContext(CommandContext.GitExplorer, true), 1000);
}
// this method is called when your extension is deactivated

Chargement…
Annuler
Enregistrer