Skip to content

Commit

Permalink
fixed the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rpgeeganage committed May 6, 2019
1 parent ca749b1 commit 8f209be
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 418 deletions.
16 changes: 4 additions & 12 deletions src/services/services.ts
Expand Up @@ -1467,7 +1467,7 @@ namespace ts {
}

const typeChecker = program.getTypeChecker();
const nodeForQuickInfo = getNodeForQuickInfo(node, typeChecker);
const nodeForQuickInfo = getNodeForQuickInfo(node);
const symbol = getSymbolAtLocationForQuickInfo(nodeForQuickInfo, typeChecker);

if (!symbol || typeChecker.isUnknownSymbol(symbol)) {
Expand Down Expand Up @@ -1495,17 +1495,9 @@ namespace ts {
};
}

function getNodeForQuickInfo(node: Node, typeChecker: TypeChecker): Node {
const firstParentNode = node.parent.getFirstToken();
const firstNodeSyntaxKind = firstParentNode ? firstParentNode.kind : undefined;

if (node.kind === SyntaxKind.NewKeyword || firstNodeSyntaxKind === SyntaxKind.NewKeyword) {
for (const singleNode of node.parent.getChildren()) {
const symbol = getSymbolAtLocationForQuickInfo(singleNode, typeChecker);
if (symbol) {
return singleNode;
}
}
function getNodeForQuickInfo(node: Node): Node {
if (isNewExpression(node.parent) && node.pos === node.parent.pos) {
return node.parent.expression;
}
return node;
}
Expand Down
70 changes: 0 additions & 70 deletions tests/baselines/reference/jsDocTags.baseline
Expand Up @@ -79,76 +79,6 @@
"marker": {
"fileName": "/tests/cases/fourslash/jsDocTags.ts",
"position": 981
},
"quickInfo": {
"kind": "constructor",
"kindModifiers": "",
"textSpan": {
"start": 977,
"length": 3
},
"displayParts": [
{
"text": "constructor",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "Foo",
"kind": "className"
},
{
"text": "(",
"kind": "punctuation"
},
{
"text": "value",
"kind": "parameterName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "number",
"kind": "keyword"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "Foo",
"kind": "className"
}
],
"documentation": [
{
"text": "This is the constructor.",
"kind": "text"
}
],
"tags": [
{
"name": "myjsdoctag",
"text": "this is a comment"
}
]
}
},
{
Expand Down
Expand Up @@ -2991,84 +2991,24 @@
"position": 337
},
"quickInfo": {
"kind": "constructor",
"kind": "var",
"kindModifiers": "",
"textSpan": {
"start": 334,
"length": 2
"start": 337,
"length": 9
},
"displayParts": [
{
"text": "constructor",
"text": "var",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "c2",
"kind": "className"
},
{
"text": "<",
"kind": "punctuation"
},
{
"text": "c",
"kind": "className"
},
{
"text": "<",
"kind": "punctuation"
},
{
"text": "string",
"kind": "keyword"
},
{
"text": ">",
"kind": "punctuation"
},
{
"text": ">",
"kind": "punctuation"
},
{
"text": "(",
"kind": "punctuation"
},
{
"text": "a",
"kind": "parameterName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "c",
"kind": "className"
},
{
"text": "<",
"kind": "punctuation"
},
{
"text": "string",
"kind": "keyword"
},
{
"text": ">",
"kind": "punctuation"
},
{
"text": ")",
"kind": "punctuation"
"text": "cInstance",
"kind": "localName"
},
{
"text": ":",
Expand All @@ -3078,14 +3018,6 @@
"text": " ",
"kind": "space"
},
{
"text": "c2",
"kind": "className"
},
{
"text": "<",
"kind": "punctuation"
},
{
"text": "c",
"kind": "className"
Expand All @@ -3098,10 +3030,6 @@
"text": "string",
"kind": "keyword"
},
{
"text": ">",
"kind": "punctuation"
},
{
"text": ">",
"kind": "punctuation"
Expand Down

0 comments on commit 8f209be

Please sign in to comment.