RFC: IntelliSense completion for custom TSDoc tags
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5k
- Forks
- 162
- Avg merge
- 17h 24m
- Merged PRs (30d)
- 8
Description
@evanargelion has been asking about defining custom TSDoc tags for toolchain directives. A build task would use the compiler API to extract the comments, invoke the TSDoc parser, and then use this information to affect the build output. For example:
/**
* @clientCallable(excludedFromRest = true)
* @apiSet(version = PolyfillableDownTo1_1, IntroducedInVersion = 1.3)
*/
export class BindingSelectionChangedEventArgs {
. . .
}
He'd like for IntelliSense to help developers write these tags correctly, but without having to implement a custom VS Code extension.
One idea would be to rely on the compiler type system, e.g. define clientCallable and apiSet as a TypeScript interface (similar to how JavaScript decorators or .NET attributes work). However in TypeScript that would probably require the definitions to be imported into the TypeScript source file. It also means the IntelliSense requires a compiler analysis and source code that compilers (maybe as a separate NPM package that would be a dev dependency?).
Another idea would be to define a simpler data file where these definitions can be found, something like a JSON schema. This has the advantage that TSDoc itself could validate these schemas while remaining decoupled from the TypeScript compiler.
Is this an important developer scenario for anyone else? How would you design it?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the compiler API, TSDoc parser, and IntelliSense scenario described in the issue. Compare the proposed TypeScript interface approach with the JSON schema approach, then define a design that supports custom-tag validation without a custom VS Code extension and record how it would be evaluated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100