diff --git a/package.json b/package.json index b96e2f9..42d73b1 100644 --- a/package.json +++ b/package.json @@ -5200,85 +5200,85 @@ "icon": "$(gear)" }, { - "command": "gitlens.showSettingsPage#views", + "command": "gitlens.showSettingsPage!views", "title": "Open Settings", "category": "GitLens", "icon": "$(gear)" }, { - "command": "gitlens.showSettingsPage#autolinks", + "command": "gitlens.showSettingsPage!autolinks", "title": "Configure Autolinks", "category": "GitLens", "icon": "$(gear)" }, { - "command": "gitlens.showSettingsPage#branches-view", + "command": "gitlens.showSettingsPage!branches-view", "title": "Open View Settings", "category": "GitLens", "icon": "$(gear)" }, { - "command": "gitlens.showSettingsPage#commits-view", + "command": "gitlens.showSettingsPage!commits-view", "title": "Open View Settings", "category": "GitLens", "icon": "$(gear)" }, { - "command": "gitlens.showSettingsPage#contributors-view", + "command": "gitlens.showSettingsPage!contributors-view", "title": "Open View Settings", "category": "GitLens", "icon": "$(gear)" }, { - "command": "gitlens.showSettingsPage#file-history-view", + "command": "gitlens.showSettingsPage!file-history-view", "title": "Open View Settings", "category": "GitLens", "icon": "$(gear)" }, { - "command": "gitlens.showSettingsPage#line-history-view", + "command": "gitlens.showSettingsPage!line-history-view", "title": "Open View Settings", "category": "GitLens", "icon": "$(gear)" }, { - "command": "gitlens.showSettingsPage#remotes-view", + "command": "gitlens.showSettingsPage!remotes-view", "title": "Open View Settings", "category": "GitLens", "icon": "$(gear)" }, { - "command": "gitlens.showSettingsPage#repositories-view", + "command": "gitlens.showSettingsPage!repositories-view", "title": "Open View Settings", "category": "GitLens", "icon": "$(gear)" }, { - "command": "gitlens.showSettingsPage#search-compare-view", + "command": "gitlens.showSettingsPage!search-compare-view", "title": "Open View Settings", "category": "GitLens", "icon": "$(gear)" }, { - "command": "gitlens.showSettingsPage#stashes-view", + "command": "gitlens.showSettingsPage!stashes-view", "title": "Open View Settings", "category": "GitLens", "icon": "$(gear)" }, { - "command": "gitlens.showSettingsPage#tags-view", + "command": "gitlens.showSettingsPage!tags-view", "title": "Open View Settings", "category": "GitLens", "icon": "$(gear)" }, { - "command": "gitlens.showSettingsPage#worktrees-view", + "command": "gitlens.showSettingsPage!worktrees-view", "title": "Open View Settings", "category": "GitLens", "icon": "$(gear)" }, { - "command": "gitlens.showSettingsPage#commit-graph", + "command": "gitlens.showSettingsPage!commit-graph", "title": "Open Commit Graph Settings", "category": "GitLens", "icon": "$(gear)" @@ -8694,55 +8694,55 @@ "when": "gitlens:enabled" }, { - "command": "gitlens.showSettingsPage#views", + "command": "gitlens.showSettingsPage!views", "when": "false" }, { - "command": "gitlens.showSettingsPage#branches-view", + "command": "gitlens.showSettingsPage!branches-view", "when": "false" }, { - "command": "gitlens.showSettingsPage#commits-view", + "command": "gitlens.showSettingsPage!commits-view", "when": "false" }, { - "command": "gitlens.showSettingsPage#contributors-view", + "command": "gitlens.showSettingsPage!contributors-view", "when": "false" }, { - "command": "gitlens.showSettingsPage#file-history-view", + "command": "gitlens.showSettingsPage!file-history-view", "when": "false" }, { - "command": "gitlens.showSettingsPage#line-history-view", + "command": "gitlens.showSettingsPage!line-history-view", "when": "false" }, { - "command": "gitlens.showSettingsPage#remotes-view", + "command": "gitlens.showSettingsPage!remotes-view", "when": "false" }, { - "command": "gitlens.showSettingsPage#repositories-view", + "command": "gitlens.showSettingsPage!repositories-view", "when": "false" }, { - "command": "gitlens.showSettingsPage#search-compare-view", + "command": "gitlens.showSettingsPage!search-compare-view", "when": "false" }, { - "command": "gitlens.showSettingsPage#stashes-view", + "command": "gitlens.showSettingsPage!stashes-view", "when": "false" }, { - "command": "gitlens.showSettingsPage#tags-view", + "command": "gitlens.showSettingsPage!tags-view", "when": "false" }, { - "command": "gitlens.showSettingsPage#worktrees-view", + "command": "gitlens.showSettingsPage!worktrees-view", "when": "false" }, { - "command": "gitlens.showSettingsPage#commit-graph", + "command": "gitlens.showSettingsPage!commit-graph", "when": "false" }, { @@ -11959,57 +11959,57 @@ "group": "navigation@-98" }, { - "command": "gitlens.showSettingsPage#branches-view", + "command": "gitlens.showSettingsPage!branches-view", "when": "view =~ /^gitlens\\.views\\.branches/", "group": "9_gitlens@1" }, { - "command": "gitlens.showSettingsPage#commits-view", + "command": "gitlens.showSettingsPage!commits-view", "when": "view =~ /^gitlens\\.views\\.commits/", "group": "9_gitlens@1" }, { - "command": "gitlens.showSettingsPage#contributors-view", + "command": "gitlens.showSettingsPage!contributors-view", "when": "view =~ /^gitlens\\.views\\.contributors/", "group": "9_gitlens@1" }, { - "command": "gitlens.showSettingsPage#file-history-view", + "command": "gitlens.showSettingsPage!file-history-view", "when": "view =~ /^gitlens\\.views\\.fileHistory/", "group": "9_gitlens@1" }, { - "command": "gitlens.showSettingsPage#line-history-view", + "command": "gitlens.showSettingsPage!line-history-view", "when": "view =~ /^gitlens\\.views\\.lineHistory/", "group": "9_gitlens@1" }, { - "command": "gitlens.showSettingsPage#remotes-view", + "command": "gitlens.showSettingsPage!remotes-view", "when": "view =~ /^gitlens\\.views\\.remotes/", "group": "9_gitlens@1" }, { - "command": "gitlens.showSettingsPage#repositories-view", + "command": "gitlens.showSettingsPage!repositories-view", "when": "view =~ /^gitlens\\.views\\.repositories/", "group": "9_gitlens@1" }, { - "command": "gitlens.showSettingsPage#search-compare-view", + "command": "gitlens.showSettingsPage!search-compare-view", "when": "view =~ /^gitlens\\.views\\.searchAndCompare\\b/", "group": "9_gitlens@1" }, { - "command": "gitlens.showSettingsPage#stashes-view", + "command": "gitlens.showSettingsPage!stashes-view", "when": "view =~ /^gitlens\\.views\\.stashes/", "group": "9_gitlens@1" }, { - "command": "gitlens.showSettingsPage#tags-view", + "command": "gitlens.showSettingsPage!tags-view", "when": "view =~ /^gitlens\\.views\\.tags/", "group": "9_gitlens@1" }, { - "command": "gitlens.showSettingsPage#worktrees-view", + "command": "gitlens.showSettingsPage!worktrees-view", "when": "view =~ /^gitlens\\.views\\.worktrees/", "group": "9_gitlens@1" } @@ -12692,12 +12692,12 @@ "alt": "gitlens.copyRemoteFileUrlWithoutRange" }, { - "command": "gitlens.showSettingsPage#autolinks", + "command": "gitlens.showSettingsPage!autolinks", "when": "viewItem =~ /gitlens:autolinked:items\\b/", "group": "inline@99" }, { - "command": "gitlens.showSettingsPage#autolinks", + "command": "gitlens.showSettingsPage!autolinks", "when": "viewItem =~ /gitlens:autolinked:items\\b/", "group": "1_gitlens_actions@99" }, @@ -14531,7 +14531,7 @@ "group": "1_gitlens@1" }, { - "command": "gitlens.showSettingsPage#commit-graph", + "command": "gitlens.showSettingsPage!commit-graph", "group": "9_gitlens@1" } ], @@ -15636,7 +15636,7 @@ { "id": "gitlens.welcome.hostingServiceIntegrations", "title": "Integrate with Git hosting services", - "description": "Simplify your workflow and quickly gain insights with automatic linking of issues and pull requests across multiple Git hosting services including GitHub, GitHub Enterprise ✨, GitLab, GitLab self-managed ✨, Gitea, Gerrit, Google Source, Bitbucket, Bitbucket Server, Azure DevOps, and custom servers.\n\nAll integration provide automatic linking, while rich integrations with GitHub & GitLab offer detailed hover information for autolinks, and correlations between pull requests, branches, and commits, as well as user avatars for added context.\n\n**Define your own autolinks**\nUse autolinks to linkify external references, like Jira issues or Zendesk tickets, in commit messages.\n\n[Configure Autolinks](command:gitlens.showSettingsPage?%22autolinks%22)", + "description": "Simplify your workflow and quickly gain insights with automatic linking of issues and pull requests across multiple Git hosting services including GitHub, GitHub Enterprise ✨, GitLab, GitLab self-managed ✨, Gitea, Gerrit, Google Source, Bitbucket, Bitbucket Server, Azure DevOps, and custom servers.\n\nAll integration provide automatic linking, while rich integrations with GitHub & GitLab offer detailed hover information for autolinks, and correlations between pull requests, branches, and commits, as well as user avatars for added context.\n\n**Define your own autolinks**\nUse autolinks to linkify external references, like Jira issues or Zendesk tickets, in commit messages.\n\n[Configure Autolinks](command:gitlens.showSettingsPage!autolinks)", "media": { "markdown": "walkthroughs/welcome/integrations.md" } diff --git a/src/constants.ts b/src/constants.ts index 9689be5..382ff6b 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -272,20 +272,20 @@ export const enum Commands { ShowRepositoriesView = 'gitlens.showRepositoriesView', ShowSearchAndCompareView = 'gitlens.showSearchAndCompareView', ShowSettingsPage = 'gitlens.showSettingsPage', - ShowSettingsPageAndJumpToBranchesView = 'gitlens.showSettingsPage#branches-view', - ShowSettingsPageAndJumpToCommitsView = 'gitlens.showSettingsPage#commits-view', - ShowSettingsPageAndJumpToContributorsView = 'gitlens.showSettingsPage#contributors-view', - ShowSettingsPageAndJumpToFileHistoryView = 'gitlens.showSettingsPage#file-history-view', - ShowSettingsPageAndJumpToLineHistoryView = 'gitlens.showSettingsPage#line-history-view', - ShowSettingsPageAndJumpToRemotesView = 'gitlens.showSettingsPage#remotes-view', - ShowSettingsPageAndJumpToRepositoriesView = 'gitlens.showSettingsPage#repositories-view', - ShowSettingsPageAndJumpToSearchAndCompareView = 'gitlens.showSettingsPage#search-compare-view', - ShowSettingsPageAndJumpToStashesView = 'gitlens.showSettingsPage#stashes-view', - ShowSettingsPageAndJumpToTagsView = 'gitlens.showSettingsPage#tags-view', - ShowSettingsPageAndJumpToWorkTreesView = 'gitlens.showSettingsPage#worktrees-view', - ShowSettingsPageAndJumpToViews = 'gitlens.showSettingsPage#views', - ShowSettingsPageAndJumpToCommitGraph = 'gitlens.showSettingsPage#commit-graph', - ShowSettingsPageAndJumpToAutolinks = 'gitlens.showSettingsPage#autolinks', + ShowSettingsPageAndJumpToBranchesView = 'gitlens.showSettingsPage!branches-view', + ShowSettingsPageAndJumpToCommitsView = 'gitlens.showSettingsPage!commits-view', + ShowSettingsPageAndJumpToContributorsView = 'gitlens.showSettingsPage!contributors-view', + ShowSettingsPageAndJumpToFileHistoryView = 'gitlens.showSettingsPage!file-history-view', + ShowSettingsPageAndJumpToLineHistoryView = 'gitlens.showSettingsPage!line-history-view', + ShowSettingsPageAndJumpToRemotesView = 'gitlens.showSettingsPage!remotes-view', + ShowSettingsPageAndJumpToRepositoriesView = 'gitlens.showSettingsPage!repositories-view', + ShowSettingsPageAndJumpToSearchAndCompareView = 'gitlens.showSettingsPage!search-compare-view', + ShowSettingsPageAndJumpToStashesView = 'gitlens.showSettingsPage!stashes-view', + ShowSettingsPageAndJumpToTagsView = 'gitlens.showSettingsPage!tags-view', + ShowSettingsPageAndJumpToWorkTreesView = 'gitlens.showSettingsPage!worktrees-view', + ShowSettingsPageAndJumpToViews = 'gitlens.showSettingsPage!views', + ShowSettingsPageAndJumpToCommitGraph = 'gitlens.showSettingsPage!commit-graph', + ShowSettingsPageAndJumpToAutolinks = 'gitlens.showSettingsPage!autolinks', ShowStashesView = 'gitlens.showStashesView', ShowTagsView = 'gitlens.showTagsView', ShowTimelinePage = 'gitlens.showTimelinePage', diff --git a/src/plus/webviews/graph/graphWebview.ts b/src/plus/webviews/graph/graphWebview.ts index 33358e3..3da4759 100644 --- a/src/plus/webviews/graph/graphWebview.ts +++ b/src/plus/webviews/graph/graphWebview.ts @@ -395,7 +395,7 @@ export class GraphWebviewProvider implements WebviewProvider void executeCommand( Commands.ShowGraphPage, - { _type: 'WebviewPanelShowOptions' }, + undefined, this.repository, ), ), diff --git a/src/plus/webviews/graph/registration.ts b/src/plus/webviews/graph/registration.ts index 30cb1c3..73c6165 100644 --- a/src/plus/webviews/graph/registration.ts +++ b/src/plus/webviews/graph/registration.ts @@ -99,21 +99,11 @@ export function registerGraphWebviewCommands( return executeCommand(Commands.ShowGraphView, ...args); } - return executeCommand( - Commands.ShowGraphPage, - { _type: 'WebviewPanelShowOptions' }, - undefined, - ...args, - ); + return executeCommand(Commands.ShowGraphPage, undefined, ...args); }), registerCommand(`${panels.id}.switchToEditorLayout`, async () => { await configuration.updateEffective('graph.layout', 'editor'); - queueMicrotask( - () => - void executeCommand(Commands.ShowGraphPage, { - _type: 'WebviewPanelShowOptions', - }), - ); + queueMicrotask(() => void executeCommand(Commands.ShowGraphPage)); }), registerCommand(`${panels.id}.switchToPanelLayout`, async () => { await configuration.updateEffective('graph.layout', 'panel'); diff --git a/src/webviews/apps/home/home.html b/src/webviews/apps/home/home.html index 2550532..68e9d32 100644 --- a/src/webviews/apps/home/home.html +++ b/src/webviews/apps/home/home.html @@ -322,7 +322,7 @@ > - Configure Autolinks @@ -583,7 +583,7 @@ >GitLens Settings Autolinks Settings(panels: WebviewPanelsProxy { // The show and jump commands are structured to have a # separating the base command from the anchor let anchor: string | undefined; - const match = /.*?#(.*)/.exec(c); + const match = /.*?!(.*)/.exec(c); if (match != null) { [, anchor] = match; } diff --git a/src/webviews/webviewsController.ts b/src/webviews/webviewsController.ts index 00a7a17..5343183 100644 --- a/src/webviews/webviewsController.ts +++ b/src/webviews/webviewsController.ts @@ -357,13 +357,8 @@ export class WebviewsController implements Disposable { }), registerCommand( command.id, - (...args: unknown[]) => { - if (hasWebviewPanelShowOptions(args)) { - const [{ _type, ...opts }, ...rest] = args; - return show({ ...command.options, ...opts }, ...(rest as ShowingArgs)); - } - - return show({ ...command.options }, ...(args as ShowingArgs)); + (opts: WebviewPanelShowOptions | undefined, ...args: unknown[]) => { + return show({ ...command.options, ...opts }, ...(args as ShowingArgs)); }, this, ), @@ -415,10 +410,7 @@ interface WebviewPanelsShowOptions extends WebviewPanelShowOptions { preserveInstance?: string | boolean; } -export type WebviewPanelShowCommandArgs = [ - WebviewPanelsShowOptions & { _type: 'WebviewPanelShowOptions' }, - ...args: unknown[], -]; +export type WebviewPanelShowCommandArgs = [WebviewPanelsShowOptions | undefined, ...args: unknown[]]; export interface WebviewViewShowOptions { column?: never; @@ -518,8 +510,3 @@ function getBestController(o: unknown): o is { state: Partial } { return o != null && typeof o === 'object' && 'state' in o && o.state != null && typeof o.state === 'object'; } - -function hasWebviewPanelShowOptions(args: unknown[]): args is WebviewPanelShowCommandArgs { - const [arg] = args; - return arg != null && typeof arg === 'object' && '_type' in arg && arg._type === 'WebviewPanelShowOptions'; -}