@@ -64,10 +64,8 @@ func (a *Analyzer) Analyze(ctx context.Context, path string) (*pkgParser.Result,
6464 // Single file: check for Go template syntax
6565 symbols = append (symbols , a .analyzeGoTemplates (path )... )
6666 } else {
67- // Directory: single walk that collects HTML file paths.
68- // GoTemplate analysis runs per-file during the walk,
69- // so we avoid a second walk + double file reads.
70- var htmlPaths []string
67+ // Directory: walk once for GoTemplate detection.
68+ // DOM analysis is done separately by AnalyzePaths below (different parser, different purpose).
7169 if walkErr := filepath .WalkDir (path , func (fp string , d fs.DirEntry , err error ) error {
7270 if err != nil {
7371 logger .Instance .Debug ("[HTML] walk entry error %s: %v" , fp , err )
@@ -77,17 +75,13 @@ func (a *Analyzer) Analyze(ctx context.Context, path string) (*pkgParser.Result,
7775 return nil
7876 }
7977 if a .ca .isHTMLFile (d .Name ()) {
80- htmlPaths = append (htmlPaths , fp )
8178 symbols = append (symbols , a .analyzeGoTemplates (fp )... )
8279 }
8380 return nil
8481 }); walkErr != nil {
8582 // Log but don't fail — HTML DOM analysis may still succeed
8683 logger .Instance .Debug ("[HTML] walk error for Go template detection: %v" , walkErr )
8784 }
88- // Use collected paths to avoid a second directory walk in AnalyzePaths
89- _ = htmlPaths // paths used by walk above; AnalyzePaths will walk again for DOM but
90- // GoTemplate detection is already done above per-file
9185 }
9286
9387 // Always run HTML DOM analysis too (Go templates contain HTML)
0 commit comments