ts-function-decorator-ls
v0.0.1
Published
TypeScript language service plugin for handling decorators.
Maintainers
Readme
TypeScript Function Decorator Language Service Support
A TypeScript language service plugin that provides real-time transformation and IntelliSense support for function decorators in your IDE. This plugin works alongside the TypeScript compiler to provide a seamless development experience when working with function decorators.
Features
- 🔄 Real-time Transformation: See decorator transformations as you type
- 🎯 IntelliSense Support: Get accurate type information and autocompletion
- 🔍 Type Checking: Real-time type checking for decorated functions
- 🚀 Zero Configuration: Works out of the box with minimal setup
Installation
npm install -D ts-function-decorator-lsUsage
- Configure your IDE to use the workspace version of TypeScript:
{
"typescript.tsdk": "node_modules/typescript/lib"
}- Add the language service plugin to your
tsconfig.json:
{
"compilerOptions": {
"plugins": [
{
"name": "ts-function-decorator-ls"
}
]
}
}- The language service plugin will automatically provide support for function decorators:
// Create a decorator
const log = function (fn: Function) {
return function (...args: any[]) {
console.log('Function called with args:', args);
return fn.apply(this, args);
};
};
// Use the decorator
@log
function example(arg: string): string {
return arg;
}The plugin will provide:
- Editor support for function decorators
- Type checking for decorated functions
- IntelliSense support for decorator options
- Error reporting for invalid decorator usage
License
Apache-2.0
