microsoft / microsoft/tsdoc

RFC: IntelliSense completion for custom TSDoc tags

Open
#57 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs design request for comments
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.