@@ -148,13 +148,13 @@ type ProgressInfo struct {
148148}
149149
150150const (
151- defaultConcurrency = 1
152- defaultBatchSize = 50
153- defaultMapBatchSize = 5
154- defaultMaxFiles = 10000
155- defaultMaxProjects = 3
156- defaultCacheCapacity = 10_0000 // 假定单个文件平均10个元素,1万个文件
157- defaultTopN = 10
151+ defaultConcurrency = 1
152+ defaultBatchSize = 50
153+ defaultMapBatchSize = 5
154+ defaultMaxFiles = 10000
155+ defaultMaxProjects = 3
156+ defaultCacheCapacity = 10_0000 // 假定单个文件平均10个元素,1万个文件
157+ defaultTopN = 10
158158)
159159
160160// NewCodeIndexer 创建新的代码索引器
@@ -1156,6 +1156,11 @@ func (i *indexer) QueryDefinitions(ctx context.Context, opts *types.QueryDefinit
11561156 }
11571157 symbolNames := make ([]string , 0 )
11581158 for s := range strings .SplitSeq (opts .SymbolNames , "," ) {
1159+ idx := strings .LastIndex (s , "." )
1160+ if idx != - 1 {
1161+ // types.QueryCallGraphOptions → QueryCallGraphOptions
1162+ s = s [idx + 1 :] // 有点,取最后一个点后面
1163+ }
11591164 if t := strings .TrimSpace (s ); t != "" {
11601165 symbolNames = append (symbolNames , t )
11611166 }
@@ -1387,6 +1392,7 @@ func safeFilePath(workspace, relativeFilePath string) (string, error) {
13871392 defer root .Close ()
13881393 return filepath .Join (workspace , relativeFilePath ), nil
13891394}
1395+
13901396// 获取符号定义代码块里面的调用图
13911397func (i * indexer ) QueryCallGraph (ctx context.Context , opts * types.QueryCallGraphOptions ) ([]* types.RelationNode , error ) {
13921398 startTime := time .Now ()
0 commit comments