Skip to content

Commit 81fef7f

Browse files
committed
fix: duplicate function definition
1 parent a0d6057 commit 81fef7f

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

internal/service/codebase.go

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -686,42 +686,6 @@ func convertStatus(status int) string {
686686
return indexStatus
687687
}
688688

689-
func (s *codebaseService) GetFileSkeleton(ctx context.Context, req *dto.GetFileSkeletonRequest) (*dto.FileSkeletonData, error) {
690-
// 1. 参数校验
691-
if req.WorkspacePath == "" || req.FilePath == "" {
692-
return nil, errs.NewMissingParamError("workspacePath or filePath")
693-
}
694-
695-
// 2. 路径处理(相对/绝对)
696-
filePath := req.FilePath
697-
if !filepath.IsAbs(filePath) {
698-
filePath = filepath.Join(req.WorkspacePath, filePath)
699-
}
700-
701-
// 验证路径是否在 workspace 内
702-
if err := s.checkPath(ctx, req.WorkspacePath, []string{filePath}); err != nil {
703-
return nil, err
704-
}
705-
706-
// 3. 获取原始 FileElementTable
707-
table, err := s.indexer.GetFileElementTable(ctx, req.WorkspacePath, filePath)
708-
if err != nil {
709-
return nil, fmt.Errorf("failed to get file element table: %w", err)
710-
}
711-
712-
// 4. 读取文件内容(用于提取签名和还原imports)
713-
fileContent, err := s.workspaceReader.ReadFile(ctx, filePath, types.ReadOptions{})
714-
if err != nil {
715-
s.logger.Warn("failed to read file content for %s: %v", filePath, err)
716-
fileContent = nil // 继续处理,但签名和imports还原会失败
717-
}
718-
719-
// 5. 转换数据结构
720-
result := convertToFileSkeletonData(table, fileContent, req.FilteredBy)
721-
722-
return result, nil
723-
}
724-
725689
// convertToFileSkeletonData 转换 FileElementTable 到 FileSkeletonData
726690
func convertToFileSkeletonData(
727691
table *codegraphpb.FileElementTable,

0 commit comments

Comments
 (0)