Browse Source

Closes #1284 - adds terminal links setting

main
Eric Amodio 4 years ago
parent
commit
36913a3552
5 changed files with 36 additions and 3 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +8
    -2
      README.md
  3. +6
    -0
      package.json
  4. +3
    -0
      src/config.ts
  5. +18
    -1
      src/container.ts

+ 1
- 0
CHANGELOG.md View File

@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Adds a _Push to Commit..._ command to unpublished commits in the _Commits_, _Branches_, and _Repositories_ views, and to to unpublished files in the _File History_ and _Line History_ views
- Adds a welcome, i.e. richer empty state, to the _Search & Compare_ view
- Adds a `gitlens.integrations.enabled` setting to specify whether to enable rich integrations with any supported remote services — see [#1208](https://github.com/eamodio/vscode-gitlens/issues/1208)
- Adds a `gitlens.terminalLinks.enabled` setting to specify whether to enable terminal links — autolinks in the integrated terminal to quickly jump to more details for commits, branches, tags, and more — closes [#1284](https://github.com/eamodio/vscode-gitlens/issues/1284)
- Adds a `gitlens.showWelcomeOnInstall` setting to specify whether to show the Welcome (Quick Setup) experience on first install — closes [#1049](https://github.com/eamodio/vscode-gitlens/issues/1049) thanks to [PR #1258](https://github.com/eamodio/vscode-gitlens/pull/1258) by Rickard ([@rickardp](https://github.com/rickardp))
- Adds extensibility APIs
- Adds an _action runner_ extensibility point to provide a runner (handler) for the new _createPullRequest_ and _openPullRequest_ actions — see [`gitlens.d.ts`](https://github.com/eamodio/vscode-gitlens/blob/main/src/api/gitlens.d.ts) for API definitions

+ 8
- 2
README.md View File

@ -560,8 +560,8 @@ The _Search & Compare_ view lists pinnable (saved) results for searching commit
<img src="https://raw.githubusercontent.com/eamodio/vscode-gitlens/main/images/docs/terminal-links.gif" alt="Terminal Links" />
</p>
- Adds autolinks for branches, tags, and commit ranges in the integrated terminal to quickly explore their commit history
- Adds autolinks for commits in the integrated terminal to quickly explore the commit and take action upon it
- [Optionally](##terminal-links-settings- 'Jump to the Terminal Links settings') adds autolinks for branches, tags, and commit ranges in the integrated terminal to quickly explore their commit history
- [Optionally](##terminal-links-settings- 'Jump to the Terminal Links settings') adds autolinks for commits in the integrated terminal to quickly explore the commit and take action upon it
## Remote Provider Integrations [#](#remote-provider-integrations- 'Remote Provider Integrations')
@ -895,6 +895,12 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
| `gitlens.gitCommands.skipConfirmations` | Specifies which (and when) Git commands will skip the confirmation step, using the format: `git-command-name:(menu/command)` |
| `gitlens.gitCommands.sortBy` | Specifies how Git commands are sorted in the _Git Command Palette_<br /><br />`name` - sorts commands by name<br />`usage` - sorts commands by last used date |
## Terminal Links Settings [#](#terminal-links-settings- 'Terminal Links Settings')
| Name | Description |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gitlens.terminalLinks.enabled` | Specifies whether to enable terminal links &mdash; autolinks in the integrated terminal to quickly jump to more details for commits, branches, tags, and more |
## Remote Provider Integration Settings [#](#remote-provider-integration-settings- 'Remote Provider Integration Settings')
| Name | Description |

+ 6
- 0
package.json View File

@ -1633,6 +1633,12 @@
"markdownDescription": "Specifies the string to be shown in place of the _authors_ code lens when there are unsaved changes",
"scope": "window"
},
"gitlens.terminalLinks.enabled": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to enable terminal links &mdash; autolinks in the integrated terminal to quickly jump to more details for commits, branches, tags, and more",
"scope": "window"
},
"gitlens.views.branches.avatars": {
"type": "boolean",
"default": true,

+ 3
- 0
src/config.ts View File

@ -136,6 +136,9 @@ export interface Config {
};
};
};
terminalLinks: {
enabled: boolean;
};
views: ViewsConfig;
advanced: AdvancedConfig;
}

+ 18
- 1
src/container.ts View File

@ -40,6 +40,8 @@ export class Container {
| ((e: ConfigurationChangeEvent) => ConfigurationChangeEvent)
| undefined;
private static _terminalLinks: GitTerminalLinkProvider | undefined;
static initialize(extensionId: string, context: ExtensionContext, config: Config) {
this._extensionId = extensionId;
this._context = context;
@ -96,7 +98,22 @@ export class Container {
}
context.subscriptions.push((this._rebaseEditor = new RebaseEditorProvider()));
context.subscriptions.push(new GitTerminalLinkProvider());
if (config.terminalLinks.enabled) {
context.subscriptions.push((this._terminalLinks = new GitTerminalLinkProvider()));
}
context.subscriptions.push(
configuration.onDidChange(e => {
if (!configuration.changed(e, 'terminalLinks', 'enabled')) return;
this._terminalLinks?.dispose();
if (Container.config.terminalLinks.enabled) {
context.subscriptions.push((this._terminalLinks = new GitTerminalLinkProvider()));
}
}),
);
context.subscriptions.push(new GitFileSystemProvider());
context.subscriptions.push(configuration.onWillChange(this.onConfigurationChanging, this));

Loading…
Cancel
Save