diff --git a/src/commands/diffWithRevision.ts b/src/commands/diffWithRevision.ts index 73dd01f..58b47ac 100644 --- a/src/commands/diffWithRevision.ts +++ b/src/commands/diffWithRevision.ts @@ -47,7 +47,7 @@ export class DiffWithRevisionCommand extends ActiveEditorCommand { const title = `Open Changes with Revision${Strings.pad(GlyphChars.Dot, 2, 2)}`; const pick = await CommitPicker.show( log, - `${title}${gitUri.getFormattedFilename({ + `${title}${gitUri.getFormattedFileName({ suffix: gitUri.sha ? `:${GitRevision.shorten(gitUri.sha)}` : undefined, truncateTo: quickPickTitleMaxChars - title.length, })}`, diff --git a/src/commands/diffWithRevisionFrom.ts b/src/commands/diffWithRevisionFrom.ts index 8796cda..97715c2 100644 --- a/src/commands/diffWithRevisionFrom.ts +++ b/src/commands/diffWithRevisionFrom.ts @@ -41,7 +41,7 @@ export class DiffWithRevisionFromCommand extends ActiveEditorCommand { const title = `Open Changes with Branch or Tag${Strings.pad(GlyphChars.Dot, 2, 2)}`; const pick = await ReferencePicker.show( gitUri.repoPath, - `${title}${gitUri.getFormattedFilename({ truncateTo: quickPickTitleMaxChars - title.length })}`, + `${title}${gitUri.getFormattedFileName({ truncateTo: quickPickTitleMaxChars - title.length })}`, 'Choose a branch or tag to compare with', { allowEnteringRefs: true, diff --git a/src/commands/git/log.ts b/src/commands/git/log.ts index f709802..acc8e8e 100644 --- a/src/commands/git/log.ts +++ b/src/commands/git/log.ts @@ -140,7 +140,7 @@ export class LogGitCommand extends QuickCommand { )}`; if (state.fileName) { - context.title += `${Strings.pad(GlyphChars.Dot, 2, 2)}${GitUri.getFormattedFilename(state.fileName, { + context.title += `${Strings.pad(GlyphChars.Dot, 2, 2)}${GitUri.getFormattedFileName(state.fileName, { truncateTo: quickPickTitleMaxChars - context.title.length - 3, })}`; } diff --git a/src/commands/git/stash.ts b/src/commands/git/stash.ts index 7f6ceb6..75dcf1d 100644 --- a/src/commands/git/stash.ts +++ b/src/commands/git/stash.ts @@ -523,7 +523,7 @@ export class StashGitCommand extends QuickCommand { state.uris != null ? `${Strings.pad(GlyphChars.Dot, 2, 2)}${ state.uris.length === 1 - ? GitUri.getFormattedFilename(state.uris[0]) + ? GitUri.getFormattedFileName(state.uris[0]) : `${state.uris.length} files` }` : undefined, @@ -569,7 +569,7 @@ export class StashGitCommand extends QuickCommand { label: context.title, detail: `Will stash changes from ${ state.uris.length === 1 - ? GitUri.getFormattedFilename(state.uris[0]) + ? GitUri.getFormattedFileName(state.uris[0]) : `${state.uris.length} files` }`, }), @@ -577,7 +577,7 @@ export class StashGitCommand extends QuickCommand { label: `${context.title} & Keep Staged`, detail: `Will stash changes from ${ state.uris.length === 1 - ? GitUri.getFormattedFilename(state.uris[0]) + ? GitUri.getFormattedFileName(state.uris[0]) : `${state.uris.length} files` }, but will keep staged files intact`, }), diff --git a/src/commands/openFileAtRevision.ts b/src/commands/openFileAtRevision.ts index cfdaf69..d667741 100644 --- a/src/commands/openFileAtRevision.ts +++ b/src/commands/openFileAtRevision.ts @@ -97,7 +97,7 @@ export class OpenFileAtRevisionCommand extends ActiveEditorCommand { } at Revision${Strings.pad(GlyphChars.Dot, 2, 2)}`; const pick = await CommitPicker.show( log, - `${title}${gitUri.getFormattedFilename({ + `${title}${gitUri.getFormattedFileName({ suffix: gitUri.sha ? `:${GitRevision.shorten(gitUri.sha)}` : undefined, truncateTo: quickPickTitleMaxChars - title.length, })}`, diff --git a/src/commands/openFileAtRevisionFrom.ts b/src/commands/openFileAtRevisionFrom.ts index 8d793b7..3ce6bf6 100644 --- a/src/commands/openFileAtRevisionFrom.ts +++ b/src/commands/openFileAtRevisionFrom.ts @@ -43,7 +43,7 @@ export class OpenFileAtRevisionFromCommand extends ActiveEditorCommand { const title = `Open File at Branch or Tag${Strings.pad(GlyphChars.Dot, 2, 2)}`; const pick = await ReferencePicker.show( gitUri.repoPath, - `${title}${gitUri.getFormattedFilename({ truncateTo: quickPickTitleMaxChars - title.length })}`, + `${title}${gitUri.getFormattedFileName({ truncateTo: quickPickTitleMaxChars - title.length })}`, 'Choose a branch or tag to open the file revision from', { allowEnteringRefs: true, diff --git a/src/commands/quickCommand.steps.ts b/src/commands/quickCommand.steps.ts index 04d0962..c474bdb 100644 --- a/src/commands/quickCommand.steps.ts +++ b/src/commands/quickCommand.steps.ts @@ -1689,7 +1689,7 @@ export async function* showCommitOrStashFileStep< }), state, context, - `${Strings.pad(GlyphChars.Dot, 2, 2)}${GitUri.getFormattedFilename(state.fileName)}`, + `${Strings.pad(GlyphChars.Dot, 2, 2)}${GitUri.getFormattedFileName(state.fileName)}`, ), placeholder: `${GitUri.getFormattedPath(state.fileName, { relativeTo: state.repo.path, @@ -1756,7 +1756,7 @@ async function getShowCommitOrStashFileStepItems< if (file == null) return []; const items: CommandQuickPickItem[] = [ - new CommitFilesQuickPickItem(state.reference, undefined, GitUri.getFormattedFilename(state.fileName)), + new CommitFilesQuickPickItem(state.reference, undefined, GitUri.getFormattedFileName(state.fileName)), ]; let remotes: GitRemote[] | undefined; diff --git a/src/git/git.ts b/src/git/git.ts index 625b559..30bf0f6 100644 --- a/src/git/git.ts +++ b/src/git/git.ts @@ -1291,13 +1291,13 @@ export namespace Git { export async function rev_parse__verify( repoPath: string, ref: string, - filename?: string, + fileName?: string, ): Promise { const data = await git( { cwd: repoPath, errors: GitErrorHandling.Ignore }, 'rev-parse', '--verify', - filename ? `${ref}:./${filename}` : `${ref}^{commit}`, + fileName ? `${ref}:./${fileName}` : `${ref}^{commit}`, ); return data.length === 0 ? undefined : data.trim(); } diff --git a/src/git/gitUri.ts b/src/git/gitUri.ts index 4aea930..6109046 100644 --- a/src/git/gitUri.ts +++ b/src/git/gitUri.ts @@ -184,8 +184,8 @@ export class GitUri extends (Uri as any as UriEx) { return this.sha === (GitUri.is(uri) ? uri.sha : undefined); } - getFormattedFilename(options: { suffix?: string; truncateTo?: number } = {}): string { - return GitUri.getFormattedFilename(this.fsPath, options); + getFormattedFileName(options: { suffix?: string; truncateTo?: number } = {}): string { + return GitUri.getFormattedFileName(this.fsPath, options); } getFormattedPath(options: { relativeTo?: string; suffix?: string; truncateTo?: number } = {}): string { @@ -330,7 +330,7 @@ export class GitUri extends (Uri as any as UriEx) { return directory == null || directory.length === 0 || directory === '.' ? emptyStr : directory; } - static getFormattedFilename( + static getFormattedFileName( fileNameOrUri: string | Uri, options: { suffix?: string; diff --git a/src/webviews/settingsWebview.ts b/src/webviews/settingsWebview.ts index a5684b7..1f0e18c 100644 --- a/src/webviews/settingsWebview.ts +++ b/src/webviews/settingsWebview.ts @@ -75,7 +75,7 @@ export class SettingsWebview extends WebviewBase { } } - get filename(): string { + get fileName(): string { return 'settings.html'; } diff --git a/src/webviews/webviewBase.ts b/src/webviews/webviewBase.ts index 19a7cca..f1cf7aa 100644 --- a/src/webviews/webviewBase.ts +++ b/src/webviews/webviewBase.ts @@ -61,7 +61,7 @@ export abstract class WebviewBase implements Disposable { ); } - abstract get filename(): string; + abstract get fileName(): string; abstract get id(): string; abstract get title(): string; @@ -322,7 +322,7 @@ export abstract class WebviewBase implements Disposable { } private async getHtml(webview: Webview): Promise { - const uri = Uri.joinPath(this.container.context.extensionUri, 'dist', 'webviews', this.filename); + const uri = Uri.joinPath(this.container.context.extensionUri, 'dist', 'webviews', this.fileName); const content = new TextDecoder('utf8').decode(await workspace.fs.readFile(uri)); const [head, body, endOfBody] = await Promise.all([ diff --git a/src/webviews/welcomeWebview.ts b/src/webviews/welcomeWebview.ts index 49dcd4a..c171e7e 100644 --- a/src/webviews/welcomeWebview.ts +++ b/src/webviews/welcomeWebview.ts @@ -9,7 +9,7 @@ export class WelcomeWebview extends WebviewBase { super(Commands.ShowWelcomePage, container); } - get filename(): string { + get fileName(): string { return 'welcome.html'; }