957 Commits

Author SHA1 Message Date
bobo.yang
741aa60efe feat: Add bilingual support for Quick Fix prompts
- Refactored delay in Quick Fix activation to a dedicated function
- Implemented language-specific prompt generation in Quick Fixes
- Added Chinese language support alongside English for Quick Fix guidance
2024-04-18 11:57:46 +08:00
bobo.yang
1814e75b69 fix: Ensure config file creation and parsing for devchat
- Add check for config file existence and create if not present
- Ensure config file is parsed to an object even if empty
- Refactor config and value setting logic for clarity and stability

Closes #347
2024-04-18 11:01:56 +08:00
bobo.yang
d50aa4b1b4 feat: AI-Powered Quick Fix Integration
- Implemented a new Quick Fix command in commands.ts and package.json
- Added the collapseFileExcludeSelectRange function for code analysis
- Registered the Quick Fix provider to suggest fixes via AI analysis
2024-04-17 19:42:56 +08:00
bobo.yang
eb329a2928 feat: Enable specific model use in unit tests
- Added environment variable to utilize selected model for unit tests
- Ensures consistency in testing with production models
- Improves reliability of tests by using configured model data
2024-04-17 09:10:58 +08:00
bobo.yang
2b505b5536 Refactor DevChatConfig instantiation to use getInstance() method 2024-04-17 00:07:09 +08:00
bobo.yang
e3eff72c43 fix: Improve line filtering in code completion
- Adjusted the condition to yield chunks only if not starting with certain characters
- Ensured that empty lines or lines starting with ), ], or } are excluded
- Optimized chunk filtering logic for better code completion accuracy
2024-04-16 09:40:54 +08:00
bobo.yang
ab2612a511 fix: Improve symbol selection code suggestions
- Commented out the check blocking suggestions for selected symbols
- Ensured code suggestions now appear during symbol selection
- Adjusted inline completion behavior to optimize user flow
2024-04-16 09:00:59 +08:00
bobo.yang
b1076f0400 feat: Prevent duplicate code completions
- Implemented logic to reuse the previous code completion result if the
new prefix matches it, reducing redundant computations.
- Added tracking for the previous code completion result and prefix to
improve user experience by preventing unnecessary triggers.
- Adjusted code completion logic to determine when to fetch new suggestions
or reuse existing ones, optimizing performance.
2024-04-16 08:43:46 +08:00
Rankin Zheng
8c188c6a03 refactor: Simplify message handling in MessageHandler
- Extract message response logic into a new method shouldSendResponse
- Remove redundant try/catch blocks for parsing message text
- Improve readability and maintainability of the handleMessage method
2024-04-15 22:50:51 +08:00
Rankin Zheng
48b180ab67 refactor: Enhance file creation stability in handler
- Wrap file creation logic in try-catch for error handling
- Ensure smooth file creation and opening in editor
- Display error message on file creation or opening failure
2024-04-15 22:50:51 +08:00
Rankin Zheng
e087bc9586 feat: Enhance file creation in codeBlockHandler
- Add detailed JSDoc comments for createAndOpenFile function
- Refactor createAndOpenFile to streamline document creation and opening
- Improve readability by adding in-line comments for clarity
2024-04-15 22:50:51 +08:00
Rankin Zheng
6679c355ae feat: Add function to open code in new file
- Implemented createAndOpenFile to open a document with the provided content
- Registered createAndOpenFile handler for 'code_new_file' messages
- Enhanced codeBlockHandler and handlerRegister with new functionality
2024-04-15 22:50:15 +08:00
bobo.yang
a13a81b0aa Fix git diff command in GitDiffWatcher 2024-04-15 22:36:58 +08:00
bobo.yang
560b399933 Fix code completion performance issues 2024-04-15 22:30:46 +08:00
bobo.yang
d2d68a535d feat: Remove COMPLETE_DEBUG env var usage
- Replace process.env.COMPLETE_DEBUG with config var
- Add completeDebug config var to simplify debug checks
- Log AST output without debug check
2024-04-15 17:24:02 +08:00
bobo.yang
fb8f806955 refactor: Improve code completion performance
- Remove performance logging in searchSimilarBlock function
- Remove unused timing variables to clean up code
- Ensure smoother operation by optimizing search logic
2024-04-14 23:05:16 +08:00
bobo.yang
bd1e2eaa68 feat: Integrate recent files into code completion
- Exported `BLACK_LIST_DIRS` for use in `GitDiffWatcher`
- Implemented `GitDiffWatcher` to monitor file changes and updates
- Enhanced prompt creation with recent edits and git diff context
2024-04-14 23:03:25 +08:00
bobo.yang
63e3e6f286 fix: Prevent duplicate file indexing
- Ensure FileBlockInfo is initialized early to prevent re-indexing
- Refactor createFileBlockInfo to return initialized object on failure
- Removal of redundant FileBlockInfo instance creation for clarity
2024-04-14 19:43:18 +08:00
bobo.yang
fecf077f38 feat: Add task description context to code completion
- Implemented createTaskDescriptionContext to fetch task desc.
- Integrated task description into the prompt generation process.
- Enhanced code completion accuracy by embedding task context.
2024-04-14 18:56:30 +08:00
Rankin Zheng
5cc1a551c2 feat: Enhance file creation from code blocks
- Add validation for message content in createAndOpenFile
- Ensure newly opened files are not in preview mode
- Display error message for invalid message formats
2024-04-13 16:42:54 +08:00
Rankin Zheng
c17865f1cf refactor: Simplify message handling in MessageHandler
- Extract message response logic into a new method shouldSendResponse
- Remove redundant try/catch blocks for parsing message text
- Improve readability and maintainability of the handleMessage method
2024-04-13 15:22:45 +08:00
Rankin Zheng
49f213d5ab refactor: Enhance file creation stability in handler
- Wrap file creation logic in try-catch for error handling
- Ensure smooth file creation and opening in editor
- Display error message on file creation or opening failure
2024-04-13 14:41:31 +08:00
Rankin Zheng
0a68e974e2 feat: Enhance file creation in codeBlockHandler
- Add detailed JSDoc comments for createAndOpenFile function
- Refactor createAndOpenFile to streamline document creation and opening
- Improve readability by adding in-line comments for clarity
2024-04-13 08:24:15 +08:00
Rankin Zheng
fae242d247 feat: Add function to open code in new file
- Implemented createAndOpenFile to open a document with the provided content
- Registered createAndOpenFile handler for 'code_new_file' messages
- Enhanced codeBlockHandler and handlerRegister with new functionality
2024-04-12 23:28:02 +08:00
bobo.yang
e5b6320ecd Find similar code blocks 2024-04-12 15:29:29 +08:00
bobo.yang
b7f7b0581a feat: Add missing IDE configuration file check
- Ensure that the IDE configuration file exists before initializing the config
2024-04-11 13:59:03 +08:00
bobo.yang
e4bedd9eff fix: Optimize completion hint range detection
- Added a function to check if a substring is a subsequence of another
- Improved logic to better determine the completion hint range
- Ensures completion suggestions display correctly in edge cases
2024-04-09 22:21:49 +08:00
bobo.yang
de92bf3c85 feat: Optimize AST caching and function lookups
- Improved AST caching mechanism by associating cache entries with filepaths and their content hash for validation.
- Enhanced function range querying by caching query results per file extension to reduce redundant computations.
- Implemented caching for symbol definitions to minimize repetitive AST parsing and query execution, improving overall performance in code completion prompts and context generation.
2024-04-09 22:13:09 +08:00
bobo.yang
37d256a0a1 don't collapse constructor function 2024-04-08 22:56:48 +08:00
bobo.yang
5f113d10a1 code completion for vscode 0.1 2024-04-08 22:10:56 +08:00
bobo.yang
6518abb20b Add devchatConfig variable and debug logs 2024-04-08 22:10:56 +08:00
bobo.yang
7eca45ed02 Add code complete event logging 2024-04-08 22:10:56 +08:00
bobo.yang
df0a092ff5 Add logEventToServer function for sending events to the server 2024-04-08 22:10:56 +08:00
bobo.yang
b37e32259d Remove commented out code in InlineCompletionProvider 2024-04-08 22:10:56 +08:00
bobo.yang
4907715d56 Add code complete functionality 2024-04-08 22:10:56 +08:00
bobo.yang
9924472c1a stage changes 2024-04-08 22:10:56 +08:00
bobo.yang
e007feabe5 Add recommend property to Command interface 2024-04-01 17:18:24 +08:00
bobo.yang
ca3bea9bd8 Remove unused code and commands registration 2024-04-01 17:15:44 +08:00
bobo.yang
caa386904c Refactor configHandler.ts to handle empty and wildcard keys 2024-04-01 17:15:44 +08:00
bobo.yang
40d0fa502b feat: Enhance config management in VSCode plugin
- Refactor to use a single instance of DevChatConfig for efficiency
- Update regInMessage and regOutMessage functions for better flexibility
- Implement new getters and setters in DevChatConfig to handle complex keys
2024-04-01 17:15:44 +08:00
bobo.yang
0a340a8409 Fix typo in DevChatConfig key 2024-04-01 17:15:44 +08:00
bobo.yang
2915634ec6 feat: Default API base for devchat config
- Ensure defaultModelConfig["api_base"] is set for devchat
- Set default API base to "https://api.devchat.ai/v1" if undefined
- This addresses configuration uniformity and maintenance
2024-04-01 17:15:44 +08:00
bobo.yang
c52c4339e0 save work 2024-04-01 17:15:44 +08:00
bobo.yang
bba9b723f1 Refactor recommendCommands assignment in DevChat class 2024-03-27 08:54:22 +08:00
bobo.yang
45872ed887 Add recommend property to CommandEntry interface 2024-03-26 16:33:34 +08:00
bobo.yang
3473b3ced9 Fix JSON parsing error in DevChat class 2024-03-26 16:33:25 +08:00
bobo.yang
3c7f7a2479 Refactor file reading to use fs.promises.readFile 2024-03-26 16:29:00 +08:00
bobo.yang
6d43aa75ab Update error logging in DevChat class 2024-03-26 16:26:35 +08:00
bobo.yang
63d55709a2 Fix typo in CommandEntry's recommend field 2024-03-26 16:24:54 +08:00
bobo.yang
7c03eb81da feat: Integrate recommended workflows display
- Added fs, os imports and promisify for async file reading
- Implemented async method to load and parse the configuration file
- Extended CommandEntry interface and adjusted command logic to include recommendations
2024-03-26 16:18:03 +08:00