120 Commits

Author SHA1 Message Date
Tom MacWright
df8efa4d3d Update dependencies (#560)
* also deprecated --private option in favor of --access
2016-10-10 17:16:31 -04:00
Christoph Kettelhoit
473a7a2dce Membership inference improvements (#558)
* Add test for memberof normalization: @memberof Foo#, @memberof Foo.prototype

* Add memberof normalization for @memberof Foo#, @memberof Foo.prototype

* Add test to infer membership of properties defined inside constructor

* Added inference of membership for properties defined inside constructor

* Fix Membership spelling, switch let for var to keep node compat broad

* Change memberof normalization to use RegExp
2016-10-05 15:22:13 -04:00
Erik Arvidsson
2eff668edf Infer type for variable declarations and class properties (#540)
This infers the type from Flow type annotations for variable
declarations and class properties.

This also moves the logic for setting the `type` for typedefs
to the same type inferrer.

Also infer the type for statements like:

```js
const x = 42;
```

same as:

```js
const x: number = 42;
```
2016-09-13 12:40:24 -07:00
Erik Arvidsson
895775df7b Cleanup literal types (#522)
This updates Doctrine to 1.3 to pick up its support for literal types
(doctrine still does not support boolean literals types).

Towards #373
2016-09-04 16:43:28 -04:00
Tom MacWright
0a97e0eccc Continue to close the gap with flow (#520)
* Adds test support for flow difference
* New support for FunctionTypeAnnotation
* New support for ObjectTypeAnnotation
* New support for MixedTypeAnnotation
2016-09-01 16:32:47 -04:00
Erik Arvidsson
d2b93aee94 Add support for null and void types (#519)
This adds support for `void` and `null` in type annotations:

```js
function f(): void {}
function g(): null {
  return null;
}
```

Towards #512
2016-09-01 15:18:42 -04:00
Erik Arvidsson
6b981e0780 Add the type property to typedef comments (#517)
* Add the type property to typedef comments

When using Flow type aliases we didn't add the `type` property
to the JSDoc comment for the inferred `typedef`.

Fixes #516

* Rename files and update test expectations
2016-09-01 10:12:30 -04:00
Erik Arvidsson
b469bb7079 Fix the name of infer membership for non named export default (#508)
When inferring the membership of a class that is an unnamed default
export we hit a null pointer exception.

```js
export default class {
  /** */
  member() {}
}
```

Inferring the name for the class above fails

Fixes #506
2016-08-25 11:09:49 -04:00
Erik Arvidsson
dc846b4219 Handle flow tuple syntax (#511)
This fixes issues with Flow tuples `[T, V]` and
Flow array types `T[]`.

Fixes #510
2016-08-25 11:08:32 -04:00
Erik Arvidsson
2e9376cf46 Fix issue where exported declarations did not set the kind (#503)
* Fix issue where exported declarations did not set the kind

For cases like:

```js
/** */ export class C {}
/** */ export function f {}
/** */ export const k = 42;
```

the kind did not get set properly.

Towards #484

* Infer kind for export default too

Towards #484
2016-08-24 11:03:06 -04:00
Erik Arvidsson
f53e1e72b7 Use provided name for export default (#505)
If a binding name is provided we should use that in the documentation.

For example:

```js
// test.js
/** */
export default function find() {}
```

Should use the name `find` and not `test`.

Fixes #504
2016-08-24 11:01:31 -04:00
Tom MacWright
49347c82e7 Arv document exported (#502)
* Add a flag to document all exported bindings

This adds a boolean flag called `document-exported` (defaults to false)
that effectively adds an empty comment to all exported bindings that do
not already have a JSDoc comment. It also does the same for the
members of exported classes and objects.

```js
export class C {
  method() {}
}
```

Both `C` and `C#method` are now part of the generated documentation.

Related to #424

* Fix lint error

* Rebase and use options pragma in test file

* Create extractor type as a generalized comment/export getter

* Document exported extractor
2016-08-24 10:58:15 -04:00
Tom MacWright
06412eaad8 Turbo v1 (#497) 2016-08-19 12:22:54 -04:00
Tom MacWright
bec5d7b4b8 Refs #451. Any -> any (#491) 2016-08-18 08:01:12 -04:00
Tom MacWright
211a26027c Allow the user to specify port. (#474)
Fixes #464
2016-07-14 13:51:43 -04:00
Anand Thakker
b4fe8edf92 Fixes TOC entries missing description in serve (#470)
* Fixes TOC entries missing description in `serve`

* Remove console statements
2016-07-11 15:03:41 -04:00
Anand Thakker
5b78f57e1f Fix short signatures for inferred params (#471) 2016-07-11 15:02:36 -04:00
Tom MacWright
7696e965ca Reorganize server code into lib/serve 2016-06-17 16:07:49 -04:00
Erik Arvidsson
8c14481260 Treat flow nullable types as nullable
Previously they were treated as optional params which is not the
same thing.
2016-06-07 15:10:39 -07:00
Erik Arvidsson
629ea6f3a8 Add support for inferring private based on the name
This adds a command line flag called `--infer-private` which is a
string (defaults to `^_`) which is used as a regexp for inferring
if a name is private or not.

For example:

```js
/** C */
class C {
  /** I'm public */
  m() {}
  /** I'm private */
  _p() {}
}
```

Fixes #436
2016-06-01 14:40:08 -07:00
Tom MacWright
f0917eadfa Remove dead code, test packed refs directly 2016-05-26 13:48:04 -04:00
Tom MacWright
9b9c777c72 Thoroughly test sort.js 2016-05-26 13:36:12 -04:00
Erik Arvidsson
af5862a29c Change to string literls 2016-05-25 19:25:47 -07:00
Erik Arvidsson
6ab7ef5b43 Pick up name and parameters from exported functions
This makes sure that we get the name and params from exported
functions/classes/vars.

For export default the name is inferred from the file name.

Towards #424
2016-05-25 17:24:48 -07:00
Tom MacWright
d858eca51b Expand directories. Fixes #429 2016-05-20 20:32:39 -04:00
Tom MacWright
bb41619c73 Restore default values. Fix sort test 2016-05-05 10:00:57 -04:00
Tom MacWright
3da1ff6dd0 Source-sorting by default (#410)
* Source-sorting by default

Many changes

* Uses a new version of module-deps that exposes a sort key
  we use to sort documentation.
* Adds inference for methods in objects
* Groups events into a separate comment property

* Add jsdoc property. Refs https://github.com/documentationjs/documentation/pull/388#issuecomment-215791547

* Namespaces and paths

* More powerful paths: paths now include name, kind, and scope
* comments now include a 'namespace' property with a formatted namespace

* Fix tests

* Re-ignore fonts

* Nix sourceKey from output

* Pin dependency versions

* Fix module-deps-sortable ref

* Update tests for right deps
2016-04-29 18:09:52 -04:00
Tom MacWright
7519a5afef Sort documentation in code order. 2016-04-26 13:11:04 -04:00
John Firebaugh
ade4f3499b More correct parsing for kind shorthand (@class, @constant, etc)
* Set the `kind` property of the comment, not a property named by the kind.
* Set the `type` property as appropriate for these shorthands.
* Parse @callback as shorthand for @typedef {Function}
2016-03-29 13:21:47 -07:00
Denis Bardadym
6f0b886a75 Add test for Object.prototype member's name 2016-03-29 12:52:41 +03:00
John Firebaugh
65035d39d8 @linkcode and @linkplain are inline tags 2016-03-28 13:19:30 -07:00
John Firebaugh
08d6dc21bd Replace markdown strings with parsed ASTs
This eliminates the need for formatInlineTags and jsdoc-inline-lex, and simplifies the implementation of HTML themes.
2016-03-28 13:19:30 -07:00
John Firebaugh
45b7b50cff Lint unknown tags 2016-03-14 18:45:29 -07:00
John Firebaugh
11a7758e56 Add placeholders for remaining tags 2016-03-14 18:43:09 -07:00
John Firebaugh
bad9c47216 Add @variation support 2016-03-14 18:29:05 -07:00
John Firebaugh
a597741550 Add @ignore support 2016-03-14 18:26:07 -07:00
John Firebaugh
40af71635f Add @interface support 2016-03-14 18:25:57 -07:00
John Firebaugh
e9d17e8795 Add @override and @readonly support 2016-03-14 18:17:18 -07:00
John Firebaugh
0011523f88 Add @abstract support 2016-03-14 17:52:04 -07:00
John Firebaugh
49a1cd9ff6 Clean up @example parsing and expand tests - back to 100% coverage 2016-03-14 17:33:24 -07:00
John Firebaugh
e0591cad4c Organize parse tests by individual tag 2016-03-14 17:31:17 -07:00
John Firebaugh
47eb1eaf26 Massage parse.js and tests to make upcoming changes easier 2016-03-14 14:57:24 -07:00
John Firebaugh
610f7d6959 Flatten @see and @todo description 2016-03-13 22:33:33 -07:00
John Firebaugh
e7800ed895 Add support for @deprecated, @see, and @todo 2016-03-13 22:18:39 -07:00
John Firebaugh
3e4a7cb48b Add @description and @summary support 2016-03-13 19:45:57 -07:00
John Firebaugh
5cb8825cf8 Fix membership inference (fixes #378) 2016-03-13 18:40:09 -07:00
John Firebaugh
5458d0e57d Fix lint line numbers (fixes #377) 2016-03-13 12:43:28 -07:00
John Firebaugh
cee5b4f517 Clean up name inference unit tests 2016-03-13 11:06:39 -07:00
John Firebaugh
085dd9ac1d Add unit test for name inference from @alias 2016-03-13 11:02:43 -07:00
ikokostya
e8491b817d support github enterprise url 2016-03-09 19:50:00 +03:00