Skip to content

Commit

Permalink
2016-08-21 [ci skip] Version: 1.201608210006.1+d8ab09819560991807c489…
Browse files Browse the repository at this point in the history
…f5ac1a391be86d3de6
  • Loading branch information
basarat committed Aug 21, 2016
1 parent cbb948c commit 6b92288
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 3 deletions.
2 changes: 1 addition & 1 deletion TypeScript
21 changes: 21 additions & 0 deletions bin/ntypescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -57346,6 +57346,27 @@ var ts;
}
if (!documentation) {
documentation = symbol.getDocumentationComment();
if (documentation.length === 0 && symbol.flags & 4 /* Property */) {
// For some special property access expressions like `experts.foo = foo` or `module.exports.foo = foo`
// there documentation comments might be attached to the right hand side symbol of their declarations.
// The pattern of such special property access is that the parent symbol is the symbol of the file.
if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 256 /* SourceFile */; })) {
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
if (!declaration.parent || declaration.parent.kind !== 187 /* BinaryExpression */) {
continue;
}
var rhsSymbol = program.getTypeChecker().getSymbolAtLocation(declaration.parent.right);
if (!rhsSymbol) {
continue;
}
documentation = rhsSymbol.getDocumentationComment();
if (documentation.length > 0) {
break;
}
}
}
}
}
return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind };
function addNewLineIfDisplayPartsExist() {
Expand Down
21 changes: 21 additions & 0 deletions bin/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -57346,6 +57346,27 @@ var ts;
}
if (!documentation) {
documentation = symbol.getDocumentationComment();
if (documentation.length === 0 && symbol.flags & 4 /* Property */) {
// For some special property access expressions like `experts.foo = foo` or `module.exports.foo = foo`
// there documentation comments might be attached to the right hand side symbol of their declarations.
// The pattern of such special property access is that the parent symbol is the symbol of the file.
if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 256 /* SourceFile */; })) {
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
if (!declaration.parent || declaration.parent.kind !== 187 /* BinaryExpression */) {
continue;
}
var rhsSymbol = program.getTypeChecker().getSymbolAtLocation(declaration.parent.right);
if (!rhsSymbol) {
continue;
}
documentation = rhsSymbol.getDocumentationComment();
if (documentation.length > 0) {
break;
}
}
}
}
}
return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind };
function addNewLineIfDisplayPartsExist() {
Expand Down
2 changes: 1 addition & 1 deletion kicktravis
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2016-08-20 [ci skip] Version: 1.201608200007.1+a531b87b3c668f56a4140699f89b7fcc4160dfbc
2016-08-21 [ci skip] Version: 1.201608210006.1+d8ab09819560991807c489f5ac1a391be86d3de6
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ntypescript",
"version": "1.201608200007.1+a531b87b3c668f56a4140699f89b7fcc4160dfbc",
"version": "1.201608210006.1+d8ab09819560991807c489f5ac1a391be86d3de6",
"description": "A nicer version of microsoft/typescript packaged and released for API developers",
"main": "./bin/ntypescript.js",
"bin": {
Expand Down
22 changes: 22 additions & 0 deletions src/services/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4917,6 +4917,28 @@ namespace ts {

if (!documentation) {
documentation = symbol.getDocumentationComment();
if (documentation.length === 0 && symbol.flags & SymbolFlags.Property) {
// For some special property access expressions like `experts.foo = foo` or `module.exports.foo = foo`
// there documentation comments might be attached to the right hand side symbol of their declarations.
// The pattern of such special property access is that the parent symbol is the symbol of the file.
if (symbol.parent && forEach(symbol.parent.declarations, declaration => declaration.kind === SyntaxKind.SourceFile)) {
for (const declaration of symbol.declarations) {
if (!declaration.parent || declaration.parent.kind !== SyntaxKind.BinaryExpression) {
continue;
}

const rhsSymbol = program.getTypeChecker().getSymbolAtLocation((<BinaryExpression>declaration.parent).right);
if (!rhsSymbol) {
continue;
}

documentation = rhsSymbol.getDocumentationComment();
if (documentation.length > 0) {
break;
}
}
}
}
}

return { displayParts, documentation, symbolKind };
Expand Down

0 comments on commit 6b92288

Please sign in to comment.