Build extensions and custom tools
Este conteúdo não está disponível em sua língua ainda.
Extensions load TypeScript behavior with --extension or --hook; project discovery can also load extensions, tools, hooks, commands, and rules under .xcsh/.
How do I test an extension boundary?
Section titled “How do I test an extension boundary?”Load one explicit file with -e <PATH> and disable discovery with --no-extensions. Confirm its registered command or tool, then test shutdown and error handling.
Where do hooks and rules belong?
Section titled “Where do hooks and rules belong?”Hooks observe or alter lifecycle events; rules add durable instructions. Keep each rule narrow and each hook deterministic. Use --no-rules to prove whether a rule changes the result.
Start from a temporary extension that registers one uniquely named capability. Launch xcsh --no-extensions -e ./path/to/extension.ts, invoke that capability, and then exit the session to
exercise teardown. The extension runs with the xcsh process account and can create the same local or
remote side effects as its code; review it before loading. Delete the temporary file and repeat
without -e to confirm discovery no longer exposes it.