Merge pull request #438 from mrhblfx/patch-1

增加了解析Go项目匹配的文件: `go.mod`, `go.sum`, `go.work`
This commit is contained in:
binary-husky 2023-04-13 11:44:03 +08:00 committed by GitHub
commit 3e1cecd9f5

View File

@ -225,7 +225,10 @@ def 解析一个Golang项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, s
report_execption(chatbot, history, a=f"解析项目: {txt}", b=f"找不到本地项目或无权访问: {txt}")
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
return
file_manifest = [f for f in glob.glob(f'{project_folder}/**/*.go', recursive=True)]
file_manifest = [f for f in glob.glob(f'{project_folder}/**/*.go', recursive=True)] + \
[f for f in glob.glob(f'{project_folder}/**/go.mod', recursive=True)] + \
[f for f in glob.glob(f'{project_folder}/**/go.sum', recursive=True)] + \
[f for f in glob.glob(f'{project_folder}/**/go.work', recursive=True)]
if len(file_manifest) == 0:
report_execption(chatbot, history, a=f"解析项目: {txt}", b=f"找不到任何golang文件: {txt}")
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面