Skip to content

Add Intellisense to JsDoc#4283

Merged
zhengbli merged 9 commits into
microsoft:masterfrom
zhengbli:JsDocIntellisense2
Aug 21, 2015
Merged

Add Intellisense to JsDoc#4283
zhengbli merged 9 commits into
microsoft:masterfrom
zhengbli:JsDocIntellisense2

Conversation

@zhengbli

Copy link
Copy Markdown

This PR provides completion list for the following cases:

  • List all the JsDoc tag names right after the @ sign or in the tagname, e.g.:
/** @^ */
var foo = ...

and

/** @pa^ */
var foo = ...
  • Full intellisense in certain JsDoc tag braces, e.g.:
/** @type { numbe^ } */
var foo = ...
/** @param { numbe^ } bar */
var foo = ...

The initial implementation only applies to js files, as currently the parser stores the JSDocComment nodes in the tree for js files but not ts files. Support for ts files may need some discussion.

@zhengbli

Copy link
Copy Markdown
Author

@billti @CyrusNajmabadi could you take a look

@zhengbli zhengbli changed the title Add Intellisense for JsDoc Add Intellisense to JsDoc Aug 12, 2015
Comment thread src/services/services.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These branches are identical, just let each fall through and use a variable typeTagOrParamTag of type JSDocTypeTag | JSDocParamTag.

Comment thread src/services/services.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider caching the result. these are not going to change between invocations. saves you the allocations.

see keywordCompletions for an example.

Comment thread src/services/services.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the type annotation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants