analyzeFile
uses tcmts.core.analyze.analyzeProject, which uses tcmts.core.analyze.analyzeWith, which uses tcmts.core.program.createProgram, which uses tcmts.core.program.compilerOptions, which uses tcmts.core.program.tcmNodeTypes, which uses node:path
Analyze one scratch file: bare expressions are watch expressions.
import { analyzeProject, scratchNamespace } from "#codebase/tcmts/core/analyze"; import type { Analysis, AnalyzeHost } from "#codebase/tcmts/core/analyze"; export function analyzeFile(file: string, host: AnalyzeHost): Analysis { const a = analyzeProject([file], host, "scratch"); return { ...a, namespace: scratchNamespace(a.program.getSourceFile(file)!.text) }; }
uses
- tcmts.core.analyze.Analysis
- tcmts.core.analyze.AnalyzeHost
- tcmts.core.analyze.analyzeProject
- tcmts.core.analyze.scratchNamespace
used by
- tcmts.cli.codebase.Codebase
- tcmts.cli.placement.testTypesDontPlaceCode
- tcmts.cli.placement.testWrittenOutCodeIsNotRun
- tcmts.cli.test.shapes.testAnalyzedAndStoredDefinitionsReadAlike
- tcmts.core.test.hash.analyze
- tcmts.core.test.hash.analyzeTsx
- tcmts.core.test.hash.testUnsupportedConstructsAreRejected
- tcmts.core.test.shape.testShapesStaySmall