// const sampleMarkdown = '## message `not code` *not important* _no underline_ \n> don\'t quote me \n- don\'t list me \n+ don\'t list me \n1. don\'t list me \nnot h1 \n=== \nnot h2 \n---\n***\n---\n___';
@ -35,47 +34,75 @@ export class DiffWithRevisionCommand extends ActiveEditorCommand {
constgitUri=awaitGitUri.fromUri(uri);
constplaceHolder=`Compare ${gitUri.getFormattedPath()}${gitUri.sha?`${Strings.pad(GlyphChars.Dot,1,1)}${gitUri.shortSha}`:''} with ${GlyphChars.Ellipsis}`;
description:`${Strings.pad(GlyphChars.Dash,2,3)} to history of ${GlyphChars.Space}$(file-text) ${gitUri.getFormattedPath()}${gitUri.sha?` from ${GlyphChars.Space}$(git-commit) ${gitUri.shortSha}`:''}`
},Commands.DiffWithRevision,[uri,{...args}]),
currentCommand: newCommandQuickPickItem(
{
label:`go back ${GlyphChars.ArrowBack}`,
description:`${Strings.pad(GlyphChars.Dash,2,3)} to history of ${
GlyphChars.Space
}$(file-text)${gitUri.getFormattedPath()}${
gitUri.sha?` from ${GlyphChars.Space}$(git-commit) ${gitUri.shortSha}`:''
}`
},
Commands.DiffWithRevision,
[uri,{...args}]
),
nextPageCommand: args.nextPageCommand,
previousPageCommand: previousPageCommand,
showAllCommand: log!==undefined&&log.truncated
?newCommandQuickPickItem({
label:`$(sync) Show All Commits`,
description:`${Strings.pad(GlyphChars.Dash,2,3)} this may take a while`
@ -61,46 +64,74 @@ export class OpenFileRevisionCommand extends ActiveEditorCommand {
constgitUri=awaitGitUri.fromUri(uri);
constplaceHolder=`Open ${gitUri.getFormattedPath()}${gitUri.sha?`${Strings.pad(GlyphChars.Dot,1,1)}${gitUri.shortSha}`:''} in revision ${GlyphChars.Ellipsis}`;
description:`${Strings.pad(GlyphChars.Dash,2,3)} to history of ${GlyphChars.Space}$(file-text) ${gitUri.getFormattedPath()}${gitUri.sha?` from ${GlyphChars.Space}$(git-commit) ${gitUri.shortSha}`:''}`
},Commands.OpenFileRevision,[uri,{...args}]),
currentCommand: newCommandQuickPickItem(
{
label:`go back ${GlyphChars.ArrowBack}`,
description:`${Strings.pad(GlyphChars.Dash,2,3)} to history of ${
GlyphChars.Space
}$(file-text)${gitUri.getFormattedPath()}${
gitUri.sha?` from ${GlyphChars.Space}$(git-commit) ${gitUri.shortSha}`:''
}`
},
Commands.OpenFileRevision,
[uri,{...args}]
),
nextPageCommand: args.nextPageCommand,
previousPageCommand: previousPageCommand,
showAllCommand: log!==undefined&&log.truncated
?newCommandQuickPickItem({
label:`$(sync) Show All Commits`,
description:`${Strings.pad(GlyphChars.Dash,2,3)} this may take a while`
returnMessages.showCommitNotFoundWarningMessage(`Unable to show commit file details`);
}
}
}
if(args.commit===undefined)returnMessages.showCommitNotFoundWarningMessage(`Unable to show commit file details`);
if(args.commit===undefined){
returnMessages.showCommitNotFoundWarningMessage(`Unable to show commit file details`);
}
// Attempt to the most recent commit -- so that we can find the real working filename if there was a rename
args.commit.workingFileName=workingFileName;
@ -109,28 +132,45 @@ export class ShowQuickCommitFileDetailsCommand extends ActiveEditorCachedCommand
if(args.goBackCommand===undefined){
// Create a command to get back to the commit details
args.goBackCommand=newCommandQuickPickItem({
label:`go back ${GlyphChars.ArrowBack}`,
description:`${Strings.pad(GlyphChars.Dash,2,3)} to details of ${GlyphChars.Space}$(git-commit) ${shortSha}`
},Commands.ShowQuickCommitDetails,[
args.goBackCommand=newCommandQuickPickItem(
{
label:`go back ${GlyphChars.ArrowBack}`,
description:`${Strings.pad(GlyphChars.Dash,2,3)} to details of ${
GlyphChars.Space
}$(git-commit)${shortSha}`
},
Commands.ShowQuickCommitDetails,
[
args.commit.toGitUri(),
{
commit: args.commit,
sha: args.sha
}asShowQuickCommitDetailsCommandArgs
]);
]
);
}
// Create a command to get back to where we are right now
constcurrentCommand=newCommandQuickPickItem({
label:`go back ${GlyphChars.ArrowBack}`,
description:`${Strings.pad(GlyphChars.Dash,2,3)} to details of ${GlyphChars.Space}$(file-text) ${path.basename(args.commit.fileName)} in ${GlyphChars.Space}$(git-commit) ${shortSha}`
// Create a command to get back to where we are right now
constcurrentCommand=newCommandQuickPickItem({
label:`go back ${GlyphChars.ArrowBack}`,
description:`${Strings.pad(GlyphChars.Dash,2,3)} to history of ${GlyphChars.Space}$(file-text) ${path.basename(pick.commit.fileName)}${gitUri.sha?` from ${GlyphChars.Space}$(git-commit) ${gitUri.shortSha}`:''}`
constresult=awaitwindow.showWarningMessage(`Apply stashed changes '${message}' to your working tree?`,{title:'Yes, delete after applying'}asMessageItem,{title:'Yes'}asMessageItem,{title:'No',isCloseAffordance: true}asMessageItem);
// Can't delete the old setting currently because it errors with `Unable to write to User Settings because <setting name> is not a registered configuration`
// Can't delete the old setting currently because it errors with `Unable to write to User Settings because <setting name> is not a registered configuration`
// Can't delete the old setting currently because it errors with `Unable to write to User Settings because <setting name> is not a registered configuration`
// Can't delete the old setting currently because it errors with `Unable to write to User Settings because <setting name> is not a registered configuration`
// Can't delete the old setting currently because it errors with `Unable to write to User Settings because <setting name> is not a registered configuration`
// Can't delete the old setting currently because it errors with `Unable to write to User Settings because <setting name> is not a registered configuration`
awaitwindow.showErrorMessage(`GitLens was unable to find Git. Please make sure Git is installed. Also ensure that Git is either in the PATH, or that '${extensionId}.${configuration.name('advanced')('git').value}' is pointed to its installed location.`);
awaitwindow.showErrorMessage(
`GitLens was unable to find Git. Please make sure Git is installed. Also ensure that Git is either in the PATH, or that '${extensionId}.${
configuration.name('advanced')('git').value
}'ispointedtoitsinstalledlocation.`
);
}
setCommandContext(CommandContext.Enabled,false);
return;
@ -87,10 +101,10 @@ export async function activate(context: ExtensionContext) {