Editor responsiveness
Concept and boundary
Investigate editor delays using a small reproducible project, explicit TypeScript version and the exact operation. Language-service work differs from a CLI build; CLI extended diagnostics can provide a baseline but cannot prove editor latency. This static fixture isolates a contextual callback workload.
Accepted project
Create a fresh folder with exactly these files. Use TypeScript 5.8.3 and Node.js 22.16.0. Package stubs under node_modules are local teaching fixtures, not installed dependencies.
const rows=[{id:1,label:"x"},{id:2,label:"y"}]; const labels=rows.map(r=>r.label); const s:string[]=labels;tsconfig.json
{ "compilerOptions": { "strict": true, "target": "ES2022", "module": "CommonJS", "moduleResolution": "Node10", "moduleDetection": "force", "skipLibCheck": true, "noEmitOnError": true, "types": [], "noEmit": true, "extendedDiagnostics": true }, "include": [ "**/*" ], "exclude": [ "node_modules", "dist", "build", "cache" ]}From the project root run: tsc -p tsconfig.json --pretty false.
Compilation succeeds (exit 0).
No runtime execution is required for this check.
Compiler output contains "Check time:".
Rejected project — diagnosis
Intentionally rejected variant. Do not execute it.
Use a fresh copy of the accepted project, changing only the files shown below.
const rows=[{id:1,label:"x"}]; const labels=rows.map(r=>r.missing);From the project root run: tsc -p tsconfig.json --pretty false.
Expected compiler diagnostic: TS2339
No runtime execution is required for this check.
The contextual callback parameter does not expose missing. Restore the accepted configuration/source to compare the result.
Independent comparison: language-service-probe
This local language-service request checks completion entries for a fixed source. Install TypeScript 5.8.3 locally before running the CommonJS script (npm install --save-dev typescript@5.8.3). It measures a reproducible operation without a latency guarantee.
Create a fresh folder with exactly these files. Use TypeScript 5.8.3 and Node.js 22.16.0. Package stubs under node_modules are local teaching fixtures, not installed dependencies.
const rows=[{id:1,label:"x"},{id:2,label:"y"}]; const labels=rows.map(r=>r.label); const s:string[]=labels;const ts=require(process.env.TYPESCRIPT_PATH || "typescript");const assert=require("node:assert/strict");const file=ts.sys.resolvePath("probe.ts");const source="const row={id:1,label:'x'}; row.";const host={getScriptFileNames:()=>[file],getScriptVersion:()=>"0",getScriptSnapshot:f=>{const s=f===file?source:ts.sys.readFile(f);return s===undefined?undefined:ts.ScriptSnapshot.fromString(s);},getCurrentDirectory:ts.sys.getCurrentDirectory,getCompilationSettings:()=>({strict:true,target:ts.ScriptTarget.ES2022,types:[]}),getDefaultLibFileName:o=>ts.getDefaultLibFilePath(o),fileExists:ts.sys.fileExists,readFile:ts.sys.readFile,readDirectory:ts.sys.readDirectory};const service=ts.createLanguageService(host);try{const result=service.getCompletionsAtPosition(file,source.length,{});assert(result);const names=result.entries.map(e=>e.name);assert(names.includes("id")&&names.includes("label"));console.log("id,label");}finally{service.dispose();}tsconfig.json
{ "compilerOptions": { "strict": true, "target": "ES2022", "module": "CommonJS", "moduleResolution": "Node10", "moduleDetection": "force", "skipLibCheck": true, "noEmitOnError": true, "types": [], "noEmit": true, "extendedDiagnostics": true }, "include": [ "**/*" ], "exclude": [ "node_modules", "dist", "build", "cache" ]}From the project root run: tsc -p tsconfig.json --pretty false.
Compilation succeeds (exit 0).
Run node probe.cjs. Expected stdout:
id,labelPractice and recap
Reproduce a completion request in a real editor and record version, file and operation separately.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Editor responsiveness — knowledge check
Check the concept, interpret the tested project result, and diagnose a rejected configuration or source.
Which statement correctly describes Editor responsiveness?
Using the complete accepted project and the exact command in the lesson, which result is expected?
const rows=[{id:1,label:"x"},{id:2,label:"y"}]; const labels=rows.map(r=>r.label); const s:string[]=labels;Why does the rejected project fail under its stated configuration?
const rows=[{id:1,label:"x"}]; const labels=rows.map(r=>r.missing);What is the result of the independent language-service-probe comparison?
const rows=[{id:1,label:"x"},{id:2,label:"y"}]; const labels=rows.map(r=>r.label); const s:string[]=labels;