30 Commits

Author SHA1 Message Date
Rankin Zheng
367f0728db Exclude certain directories in file modification check
- Updated the is_file_modified function in askcode_index_query.py to exclude 'node_modules' and '__pycache__' directories along with directories starting with '.'.
2023-09-01 14:29:35 +08:00
bobo.yang
4d465a3613 Refactor ask-code-summary feature and remove redundant commands
- Removed redundant commands related to ask-code-summary from package.json.
- Created a new file contextSummary.ts to handle the ask-code-summary context.
- Registered the ask-code-summary context in loadContexts.ts.
- Refactored the ask-code-summary related functions in commands.ts for better code organization and readability.
- Updated the askcode_summary_index.py script to handle target directory for indexing.
2023-08-31 17:52:06 +08:00
bobo.yang
6a0b220c1c replace conda with mamba, to handle chinies path. 2023-08-29 15:29:28 +08:00
bobo.yang
5d2a1a806c Removed unnecessary print statement
- Removed a print statement that was outputting the file path of non-source code files.
- This change makes the output cleaner and less cluttered.
2023-08-22 10:21:58 +08:00
bobo.yang
c2bb0a9cc6 Optimized the code for counting true values in dictionary
- Replaced the manual loop for counting true values in the dictionary 'g_file_need_index' with Python's built-in function 'sum()'.
- This change makes the code more concise and more Pythonic.
2023-08-22 09:54:07 +08:00
bobo.yang
6b37da5bcb Updated askcode_summary_index.py for better file indexing
- Added a global dictionary 'g_file_need_index' to keep track of files that need indexing.
- Modified 'is_file_modified' function to print file paths of non-source code and hidden files.
- Refactored 'custom_file_filter' function to use 'g_file_need_index' for determining if a file needs indexing.
- Removed unnecessary print statements for cleaner output.
2023-08-22 09:11:38 +08:00
bobo.yang
6a2a7b67e8 Updated file filtering in askcode_summary_index.py
- Removed print statement for every file path in custom_file_filter function.
- Added condition to check if file needs indexing before printing file path.
- Modified return logic for directory and file modification checks.
2023-08-21 11:52:00 +08:00
bobo.yang
6713a98df9 Add commands for DevChat
- Added commands for adding context and summary to DevChat.
- Updated the package.json file to include the new commands.
- Added command handlers for indexing and describing codebase summaries.
- Created a new file, askcode_summary_index.py, for indexing and describing codebase summaries.
- Added a new setting file, _setting_.json, for the summary action in the auto_command workflow.
- Added a new handler file, handler.py, for the summary action in the auto_command workflow.
2023-08-21 11:52:00 +08:00
bobo.yang
769666aaac Add function to get application data directory
- Added a new function `get_app_data_dir` in `install.py` to get the application data directory based on the operating system.
- This function checks if the directory exists, if not, it creates the directory.
- Updated the `venvdir` in the `main` function to use this new function, which will now point to the application data directory.
2023-08-21 11:52:00 +08:00
bobo.yang
1e4acd192a Update Python version in virtual environment creation
- Modified the 'virtualenv_create_venv' function in 'install_askcode.py' to specify Python version 3.11.4 when creating a virtual environment.
- This change ensures that the created virtual environment uses the correct Python version.
2023-08-21 11:52:00 +08:00
bobo.yang
215621ddbf Refactor sys.exit codes in askcode_index_query.py
- Removed unnecessary sys.exit(0) calls after index and query functions.
- Changed sys.exit code from 3 to 0 in the main function to indicate successful execution.
2023-08-21 11:52:00 +08:00
bobo.yang
5ebeec5f82 Added AskCode Indexing and Installation Scripts
- Created askcode_index_query.py to handle indexing and querying of AskCode.
- Implemented functions to check if a file is modified and if it's a source code file.
- Added functionality to index a given repository path and query a given question.
- Created install_askcode.py to handle the installation of AskCode.
- Implemented functions to install pip, virtualenv, create a virtual environment, and install devchat.
2023-08-21 11:52:00 +08:00
bobo.yang
ffeb632ec6 Fix regex match and decoding in install.py
- Changed the regex match to search for bytes instead of string.
- Added a condition to decode the pythonCmd only if no error occurred.
2023-08-10 08:31:11 +08:00
bobo.yang
fb29ea356c Added pathlib to handle file paths in install.py
- Imported pathlib module for handling file paths.
- Replaced the string replace method with pathlib's parent attribute to get the parent path of pythoncmd.
- Used os.path.join to construct the new pip_command_env path.
2023-08-09 19:49:02 +08:00
bobo.yang
7c3a0a4e7a Improved error handling in install.py
- Added import for 're' module for regular expressions.
- Changed return value from False to '' in get_pythoncmd_in_env function.
- Added a new function 'extract_actual_location' to extract the actual location from the text.
- Updated 'virtualenv_create_venv' function to handle errors more effectively and provide more detailed output.
2023-08-09 19:13:05 +08:00
bobo.yang
03f4e8344e fix python install error 2023-08-09 15:43:15 +08:00
bobo.yang
0a4826c66e Add function to get application data directory
- Added a new function `get_app_data_dir` in `install.py` to get the application data directory based on the operating system.
- This function checks if the directory exists, if not, it creates the directory.
- Updated the `venvdir` in the `main` function to use this new function, which will now point to the application data directory.
2023-08-09 08:15:49 +08:00
bobo.yang
e13e5685da Specify Python version in virtual environment creation
- Modified the virtual environment creation command to specify Python version as 3.11.4.
- This change affects the print statement and the subprocess.run command in the virtualenv_create_venv function.
2023-08-07 19:42:29 +08:00
bobo.yang
999edb5129 Change location of temporary file in pip_cmd_run function
- Imported tempfile module to create a temporary file.
- Replaced the creation of 'test.txt' in the current directory with a temporary file.
- The temporary file is automatically deleted when it is closed, eliminating the need for manual deletion.
2023-07-26 15:03:20 +08:00
bobo.yang
a3ccb0d45d Update pip command functions in install.py
- Changed the type hinting for the 'pipcmd' parameter in 'pip_cmd_run' and 'pip_cmd_with_retries' functions.
- The 'pipcmd' parameter now accepts any type, not just list of strings.
2023-07-26 11:25:40 +08:00
bobo.yang
3136283970 Update DevChat dependency check and configuration update
- Added version check for DevChat in checkDevChatDependency function.
- Updated configuration in both Global and Workspace scopes.
- Commented out the initial DevChat check in install.py and added --force flag to pip install command.
2023-07-19 16:06:45 +08:00
bobo.yang
116defdec7 Refactor install.py and statusBarViewBase.ts
- Added pip_cmd_run and pip_cmd_with_retries functions in install.py to handle pip command execution and retries.
- Simplified the installation of devchat and virtualenv in install.py using the new functions.
- Removed unnecessary checks in statusBarViewBase.ts.
2023-07-12 14:04:08 +08:00
bobo.yang
b4d21be26c update install 2023-07-12 09:02:00 +08:00
bobo.yang
7149ca0190 Modify DevChat installation command in install.py
- Changed the DevChat installation command to include the '--force' flag to ensure the installation proceeds even if DevChat is already installed.
2023-07-06 07:42:44 +08:00
bobo.yang
5de9d0f7ee update install for devchat 2023-07-06 07:42:44 +08:00
bobo.yang
8bc7f63c09 Add API key validation and pip installation check
- Added a check in commands.ts to validate the API key when setting it.
- If the API key is invalid, an error message is displayed to the user.
- Added a function in install.py to ensure pip is installed.
- This function attempts to install and upgrade pip using the ensurepip module.
- The function is called at the beginning of the main function in install.py.
2023-07-06 07:42:44 +08:00
bobo.yang
a947651d85 Update install.py to use sys.executable for pipx commands
- Replaced direct 'pipx' calls with 'sys.executable -m pipx' to ensure the same Python environment is used.
- Added a print statement to display the Python command being used.
2023-07-06 07:42:44 +08:00
bobo.yang
abba2c7df3 Add getValidPythonCommand function and improve dependency check
- Implement getValidPythonCommand in commandsBase.ts to detect Python 3.
- Update dependencyCheck in statusBarViewBase.ts to use getValidPythonCommand.
- Modify install.py to use sys.executable instead of hardcoded 'python3'.
2023-06-13 08:32:22 +08:00
bobo.yang
a9fa1c7abb Improve secretStorage usage and pipx installation
- Add await keyword to secretStorage.store call in extension.ts.
- Set statusBarItem.command to undefined instead of an empty string.
- Force pipx installation in install.py by adding --force flag.
2023-05-28 09:58:53 +08:00
bobo.yang
94413e6f1f install by pipx 2023-05-19 13:09:58 +08:00