Skip to content

Commit

Permalink
Increase version number
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-McKanna committed Dec 22, 2024
1 parent f07d93c commit 85be07f
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 51 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Files2Prompt",
"icon": "./files2prompt-icon.webp",
"description": "Copy file contents for LLM prompts",
"version": "1.7.3",
"version": "1.8.0",
"publisher": "thomas-mckanna",
"keywords": [
"files",
Expand Down Expand Up @@ -201,4 +201,4 @@
"fast-xml-parser": "^4.5.0",
"ignore": "^6.0.2"
}
}
}
102 changes: 53 additions & 49 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,65 +266,69 @@ async function processXmlContent(xmlContent: string) {
if (changedFiles.length > 0 || newFiles.length > 0) {
// Create quick pick items for all changed/new files
const quickPickItems: vscode.QuickPickItem[] = [
...changedFiles.map(f => ({
...changedFiles.map((f) => ({
label: `📝 ${f.path}`,
description: 'Modified',
uri: f.uri
description: "Modified",
uri: f.uri,
})),
...newFiles.map(f => ({
...newFiles.map((f) => ({
label: `✨ ${f.path}`,
description: 'New',
uri: f.uri
}))
description: "New",
uri: f.uri,
})),
];

// Show information message with multiple actions
vscode.window.showInformationMessage(
`Files have been updated successfully. ${changedFiles.length} modified, ${newFiles.length} new.`,
'Show Details',
'Open Changed Files'
).then(async selection => {
if (selection === 'Show Details') {
// Create and show output channel with details and clickable links
const channel = vscode.window.createOutputChannel('Files2Prompt Changes');
channel.clear();

if (changedFiles.length > 0) {
channel.appendLine('Modified files:');
changedFiles.forEach(file => {
channel.appendLine(`${file.path}`);
});
channel.appendLine('');
}

if (newFiles.length > 0) {
channel.appendLine('New files:');
newFiles.forEach(file => {
channel.appendLine(`${file.path}`);
vscode.window
.showInformationMessage(
`Files have been updated successfully. ${changedFiles.length} modified, ${newFiles.length} new.`,
"Show Details",
"Open Changed Files"
)
.then(async (selection) => {
if (selection === "Show Details") {
// Create and show output channel with details and clickable links
const channel = vscode.window.createOutputChannel(
"Files2Prompt Changes"
);
channel.clear();

if (changedFiles.length > 0) {
channel.appendLine("Modified files:");
changedFiles.forEach((file) => {
channel.appendLine(`${file.path}`);
});
channel.appendLine("");
}

if (newFiles.length > 0) {
channel.appendLine("New files:");
newFiles.forEach((file) => {
channel.appendLine(`${file.path}`);
});
}

channel.show();
} else if (selection === "Open Changed Files") {
// Show quick pick with all changed files
const selected = await vscode.window.showQuickPick(quickPickItems, {
placeHolder: "Select files to open",
canPickMany: true,
});
}

channel.show();
} else if (selection === 'Open Changed Files') {
// Show quick pick with all changed files
const selected = await vscode.window.showQuickPick(quickPickItems, {
placeHolder: 'Select files to open',
canPickMany: true
});

if (selected) {
// Open each selected file
for (const item of selected) {
const uri = (item as any).uri;
if (uri) {
const doc = await vscode.workspace.openTextDocument(uri);
await vscode.window.showTextDocument(doc, { preview: false });

if (selected) {
// Open each selected file
for (const item of selected) {
const uri = (item as any).uri;
if (uri) {
const doc = await vscode.workspace.openTextDocument(uri);
await vscode.window.showTextDocument(doc, { preview: false });
}
}
}
}
}
});
});
} else {
vscode.window.showInformationMessage('No files were changed.');
vscode.window.showInformationMessage("No files were changed.");
}
}

0 comments on commit 85be07f

Please sign in to comment.