Skip to content

Commit

Permalink
Merge pull request #68 from RussellCanfield/feature/Composer-V2
Browse files Browse the repository at this point in the history
Fix accepted/rejected
  • Loading branch information
RussellCanfield authored Jan 23, 2025
2 parents 27af7f7 + c377d63 commit 77d8e9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "wing-man",
"displayName": "Wingman-AI",
"description": "Wingman - AI powered assistant to help you write your best code, we won't leave you hanging.",
"version": "0.9.3",
"version": "0.9.4",
"publisher": "WingMan",
"license": "MIT",
"workspaces": [
Expand Down
9 changes: 5 additions & 4 deletions src/composer/v2/tools/code-writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const FILE_SEPARATOR = "<FILE_SEPARATOR>";
class StreamParser {
private buffer = '';
private currentSection: 'file' | null = null;
private gitCommands: GitCommandEngine | undefined;
private result: CodeResponse = {
file: {
path: '',
Expand All @@ -57,7 +56,6 @@ class StreamParser {
};

constructor(private readonly workspace: string) {
this.gitCommands = new GitCommandEngine(process.cwd());
}

private isInSection(delimiter: string) {
Expand Down Expand Up @@ -155,7 +153,7 @@ class StreamParser {
markdownLanguage: langMatch?.[1].trim() || '',
description: descMatch?.[1].trim() || '',
code: codeMatch?.[1].trim() || '',
dependencies: depsMatch?.[1]?.split(',').map(d => d.trim()) || []
dependencies: depsMatch?.[1]?.split(',').map(d => d.trim()) || [],
};

if (depsMatch?.[1]) {
Expand Down Expand Up @@ -434,7 +432,10 @@ export class CodeWriter {

const stateFile = state?.files?.find(f => f.path === updates.file?.path);
if (stateFile && !files.some(f => f.path === updates.file?.path)) {
Object.assign(stateFile, updates.file);
Object.assign(stateFile, updates.file, {
accepted: false,
rejected: false
});

// Collect dependencies
updates.file.dependencies?.forEach(dep => allDependencies.add(dep));
Expand Down

0 comments on commit 77d8e9a

Please sign in to comment.