MCPcopy Index your code
hub / github.com/conwnet/github1s / getChangedFileDiffCommand

Function getChangedFileDiffCommand

extensions/github1s/src/changes/files.ts:127–152  ·  view source on GitHub ↗
(changedFile: VSCodeChangedFile)

Source from the content-addressed store, hash-verified

125};
126
127export const getChangedFileDiffCommand = (changedFile: VSCodeChangedFile): vscode.Command => {
128 let baseFileUri = changedFile.baseFileUri;
129 let headFileUri = changedFile.headFileUri;
130 const status = changedFile.status;
131
132 if (status === adapterTypes.FileChangeStatus.Added) {
133 baseFileUri = emptyFileUri;
134 }
135
136 if (status === adapterTypes.FileChangeStatus.Removed) {
137 headFileUri = emptyFileUri;
138 }
139
140 const title = getChangedFileDiffTitle(baseFileUri, headFileUri, status);
141 const query = queryString.stringify({
142 status,
143 base: baseFileUri.with({ query: '' }).toString(),
144 head: headFileUri.with({ query: '' }).toString(),
145 });
146
147 return {
148 title: 'Diff',
149 command: 'vscode.diff',
150 arguments: [baseFileUri.with({ query }), headFileUri.with({ query }), title],
151 };
152};

Callers 4

commandDiffChangedFileFunction · 0.90
index.tsFile · 0.90
getCommitFileItemsMethod · 0.90

Calls 1

getChangedFileDiffTitleFunction · 0.85

Tested by

no test coverage detected