Use URIs instead of string paths in changelog
[?]
Jan 15, 2021, 9:04 PM
WPIUUBJIWL7MFUHHBHXXRDCWYE6RCJYUHZS524TD2MYX74AOAIEACDependencies
- [2]
J6DDODYYUpdate views to refresh with the rest of the repository state - [3]
7A3NMQ6QShow altered files instead of dependencies as children of changes in changelog - [4]
H3GAPFUCAdd pijul.recordAll command - [5]
GNQD74OZAdd pijul.openChange command and text document provider for pijul-change scheme - [6]
GVFKCLQHPrevent dependencies from appearing multiple times under the same change - [7]
L3VOQYAFAdd changelog view to the source control panel - [*]
ZGMIJNFVCreate pijul.ts for executing commands using the Pijul CLI - [*]
WCQM6IOKAdd parsing of Author strings
Change contents
- replacement in src/views/changelog.ts at line 1
import { Event, TreeDataProvider, TreeItem, TreeItemCollapsibleState, Uri } from 'vscode';import { PijulChange, Repository } from '../pijul';import * as path from 'path';import { Event, TreeDataProvider, TreeItem, TreeItemCollapsibleState, Uri, workspace } from 'vscode';import { PijulChange, PijulFileChange, Repository } from '../pijul'; - replacement in src/views/changelog.ts at line 9
export class ChangelogViewProvider implements TreeDataProvider<PijulChange | string> {export class ChangelogViewProvider implements TreeDataProvider<PijulChange | PijulFileChange> { - replacement in src/views/changelog.ts at line 23
getTreeItem (element: PijulChange | string): TreeItem | Thenable<TreeItem> {getTreeItem (element: PijulChange | PijulFileChange): TreeItem | Thenable<TreeItem> { - replacement in src/views/changelog.ts at line 40
// It's a string, representing a file path// TODO: Use URIs instead of strings// It's a PijulFileChange - replacement in src/views/changelog.ts at line 42
const sections = element.split(/\\|\//);const relativePath = path.relative(workspace.workspaceFolders?.[0]?.uri.path ?? '/', element.path.fsPath); - replacement in src/views/changelog.ts at line 44
label: sections[sections.length - 1],description: sections.slice(0, -1).join('/'),label: path.basename(relativePath),description: path.dirname(relativePath), - replacement in src/views/changelog.ts at line 47
contextValue: 'pijulChangedFile'// TODO: Command and TooltipcontextValue: 'pijulChangedFile',tooltip: `${element.operations.join(', ')} in ${relativePath}`,command: {command: 'vscode.open',title: 'Open Change TOML',arguments: [element.path]} - replacement in src/views/changelog.ts at line 62
async getChildren (element?: PijulChange | string): Promise<Array<PijulChange | string> | null | undefined> {async getChildren (element?: PijulChange | PijulFileChange): Promise<Array<PijulChange | PijulFileChange> | null | undefined> { - replacement in src/pijul.ts at line 309
async getChangeFiles (change: PijulChange): Promise<string[]> {async getChangeFiles (change: PijulChange): Promise<PijulFileChange[]> { - replacement in src/pijul.ts at line 312
const files: Set<string> = new Set();const fileOperations: Record<string, Set<string>> = {}; - replacement in src/pijul.ts at line 316
files.add(match[2]);const [, operation, path] = match;if (fileOperations[path]) {fileOperations[path].add(operation);} else {fileOperations[path] = new Set([operation]);} - replacement in src/pijul.ts at line 325
return [...files];// TODO: cache resultsconst files: PijulFileChange[] = [];for (const path in fileOperations) {files.push(new PijulFileChange(createResourceUri(path), [...fileOperations[path]]));}return files; - edit in src/pijul.ts at line 619[10.262][4.2674]
) {}}/*** Class representing a change that was made to a file*/export class PijulFileChange {/*** Create a new instance of a pijul file change* @param path The path of the file that was changed* @param operations The operations that were performed on the file (Edit, Replacement, etc.)*/constructor (public readonly path: Uri,public readonly operations: string[]