Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vscode): adding NL outlines generation experimental feature #3055

Open
wants to merge 36 commits into
base: main
Choose a base branch
from

Conversation

Sma1lboy
Copy link
Collaborator

@Sma1lboy Sma1lboy commented Sep 3, 2024

Task List

  • Moved NL outlines generation to the VSCode extension
  • Added functionality to generate NL outlines for the visible range without selection
  • Next step: Remove NL outlines generation code from the LSP server
  • After completing the Edit functionality, regenerate the code for the section below
    • Now it could generate new code base on old content. but the view style needs to change;

Example:

Example for visible range with offset
https://jam.dev/c/d299e35d-7442-4924-9f1c-dee7b430a6c5

…geOutlines and adding auto choice visible range
- Updated imports to include `Uri`, `workspace`, and `WorkspaceEdit` from `vscode`.
- Modified the `Outline` interface to include `startLine` and `endLine` instead of just `line`.
- Added a new `CodeChangeRequest` interface.
- Refactored the `provideNLOutlinesGenerate` method to improve readability and structure.
- Enhanced logging for better debugging and tracking of document processing.
- Added `@types/diff` and `diff` to devDependencies.
- Moved `openai` from dependencies to devDependencies.
- Updated `diff` version in pnpm-lock.yaml.
- Removed code lens generation for outlines and confirmation commands.
- Removed related prompt templates from AgentConfig
…ider

- Added import for Diff module to handle code differences.
- Enhanced logging for updateNLOutline method to track document and line number.
- Improved error handling and logging for document opening and outline retrieval.
- Updated the format of oldCode to include line numbers for better context.
- Enhanced the handling of updated code received from the AI model, including removal of XML tags and proper line splitting.
- Introduced a progress notification during the NL Outline update process.
- Added new commands for accepting and discarding NL Outline changes.
- Introduced `PendingChange` and `ChangesPreview` interfaces to manage pending changes and their previews.
- Added `OpenAIResponse` type to handle asynchronous OpenAI responses.
- Extended `NLOutlinesProvider` class to include new properties: `addedDecorationType`, `removedDecorationType`, `pendingChanges`, and `pendingCodeLenses`.
- Implemented methods to create text editor decoration types for added and removed lines.
- Added event listener for active text editor changes to clear all pending changes.
- Updated `provideNLOutlinesGenerate` method to log additional information and notify listeners of CodeLenses change.
- Removed unused `Command` import and `generateNLOutlinesRequest` method.
- Removed unnecessary parameters from `addAcceptDiscardCodeLens` method.
- Updated command names for accept and discard actions.
- Enhanced logging in `acceptChanges` method for better debugging.
- Simplified the logic for applying edits and deleting extra lines.
- Introduced a new configuration option `chat.outline` to enable/disable the 'Generate Outline' command.
- Added getter and setter methods for `chat.outline` in the `Config` class.
- Updated the command ID and title for generating outlines.
- Modified the command palette configuration to conditionally show the 'Generate Outline' command based on the `chat.outline` setting.
@wsxiaoys wsxiaoys marked this pull request as ready for review September 11, 2024 23:54
clients/vscode/package.json Outdated Show resolved Hide resolved
Copy link
Member

@wsxiaoys wsxiaoys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just change everything nlOutline -> outline

…tline generation and edit.

Also change all `nlOutline` to `outline`
@Sma1lboy Sma1lboy changed the title feat(VSCode): Feature generate nl outlines feat(vscode): Adding NL outlines generation experimental feature Oct 25, 2024
@Sma1lboy Sma1lboy changed the title feat(vscode): Adding NL outlines generation experimental feature feat(vscode): adding NL outlines generation experimental feature Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants