Skip to content

Commit

Permalink
2016-08-28 [ci skip] Version: 1.201608280005.1+598ca48c94535156c842dd…
Browse files Browse the repository at this point in the history
…c13fddd24aac1130fe
  • Loading branch information
basarat committed Aug 28, 2016
1 parent 42ded84 commit d3600e3
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 20 deletions.
5 changes: 4 additions & 1 deletion bin/ntypescript.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8526,8 +8526,11 @@ declare namespace ts {
containerKind: string;
containerName: string;
}
interface ReferencedSymbolDefinitionInfo extends DefinitionInfo {
displayParts: SymbolDisplayPart[];
}
interface ReferencedSymbol {
definition: DefinitionInfo;
definition: ReferencedSymbolDefinitionInfo;
references: ReferenceEntry[];
}
enum SymbolDisplayPartKind {
Expand Down
14 changes: 10 additions & 4 deletions bin/ntypescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -58460,7 +58460,8 @@ var ts;
name: name,
kind: info.symbolKind,
fileName: declarations[0].getSourceFile().fileName,
textSpan: ts.createTextSpan(declarations[0].getStart(), 0)
textSpan: ts.createTextSpan(declarations[0].getStart(), 0),
displayParts: info.displayParts
};
}
function getAliasSymbolForPropertyNameSymbol(symbol, location) {
Expand Down Expand Up @@ -58629,7 +58630,8 @@ var ts;
fileName: targetLabel.getSourceFile().fileName,
kind: ScriptElementKind.label,
name: labelName,
textSpan: ts.createTextSpanFromBounds(targetLabel.getStart(), targetLabel.getEnd())
textSpan: ts.createTextSpanFromBounds(targetLabel.getStart(), targetLabel.getEnd()),
displayParts: [ts.displayPart(labelName, SymbolDisplayPartKind.text)]
};
return [{ definition: definition, references: references }];
}
Expand Down Expand Up @@ -58819,14 +58821,17 @@ var ts;
possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd());
getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references);
}
var thisOrSuperSymbol = typeChecker.getSymbolAtLocation(thisOrSuperKeyword);
var displayParts = thisOrSuperSymbol && getSymbolDisplayPartsDocumentationAndSymbolKind(thisOrSuperSymbol, thisOrSuperKeyword.getSourceFile(), getContainerNode(thisOrSuperKeyword), thisOrSuperKeyword).displayParts;
return [{
definition: {
containerKind: "",
containerName: "",
fileName: node.getSourceFile().fileName,
kind: ScriptElementKind.variableElement,
name: "this",
textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd())
textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()),
displayParts: displayParts
},
references: references
}];
Expand Down Expand Up @@ -58888,7 +58893,8 @@ var ts;
fileName: node.getSourceFile().fileName,
kind: ScriptElementKind.variableElement,
name: type.text,
textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd())
textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()),
displayParts: [ts.displayPart(ts.getTextOfNode(node), SymbolDisplayPartKind.stringLiteral)]
},
references: references
}];
Expand Down
5 changes: 4 additions & 1 deletion bin/typescript.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8526,8 +8526,11 @@ declare namespace ts {
containerKind: string;
containerName: string;
}
interface ReferencedSymbolDefinitionInfo extends DefinitionInfo {
displayParts: SymbolDisplayPart[];
}
interface ReferencedSymbol {
definition: DefinitionInfo;
definition: ReferencedSymbolDefinitionInfo;
references: ReferenceEntry[];
}
enum SymbolDisplayPartKind {
Expand Down
14 changes: 10 additions & 4 deletions bin/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -58460,7 +58460,8 @@ var ts;
name: name,
kind: info.symbolKind,
fileName: declarations[0].getSourceFile().fileName,
textSpan: ts.createTextSpan(declarations[0].getStart(), 0)
textSpan: ts.createTextSpan(declarations[0].getStart(), 0),
displayParts: info.displayParts
};
}
function getAliasSymbolForPropertyNameSymbol(symbol, location) {
Expand Down Expand Up @@ -58629,7 +58630,8 @@ var ts;
fileName: targetLabel.getSourceFile().fileName,
kind: ScriptElementKind.label,
name: labelName,
textSpan: ts.createTextSpanFromBounds(targetLabel.getStart(), targetLabel.getEnd())
textSpan: ts.createTextSpanFromBounds(targetLabel.getStart(), targetLabel.getEnd()),
displayParts: [ts.displayPart(labelName, SymbolDisplayPartKind.text)]
};
return [{ definition: definition, references: references }];
}
Expand Down Expand Up @@ -58819,14 +58821,17 @@ var ts;
possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd());
getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references);
}
var thisOrSuperSymbol = typeChecker.getSymbolAtLocation(thisOrSuperKeyword);
var displayParts = thisOrSuperSymbol && getSymbolDisplayPartsDocumentationAndSymbolKind(thisOrSuperSymbol, thisOrSuperKeyword.getSourceFile(), getContainerNode(thisOrSuperKeyword), thisOrSuperKeyword).displayParts;
return [{
definition: {
containerKind: "",
containerName: "",
fileName: node.getSourceFile().fileName,
kind: ScriptElementKind.variableElement,
name: "this",
textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd())
textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()),
displayParts: displayParts
},
references: references
}];
Expand Down Expand Up @@ -58888,7 +58893,8 @@ var ts;
fileName: node.getSourceFile().fileName,
kind: ScriptElementKind.variableElement,
name: type.text,
textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd())
textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()),
displayParts: [ts.displayPart(ts.getTextOfNode(node), SymbolDisplayPartKind.stringLiteral)]
},
references: references
}];
Expand Down
2 changes: 1 addition & 1 deletion kicktravis
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2016-08-27 [ci skip] Version: 1.201608270006.1+e62f1181b6a94161f8bfa88a84c2cf4c0f66bc3a
2016-08-28 [ci skip] Version: 1.201608280005.1+598ca48c94535156c842ddc13fddd24aac1130fe
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.201608270006.1+e62f1181b6a94161f8bfa88a84c2cf4c0f66bc3a",
"version": "1.201608280005.1+598ca48c94535156c842ddc13fddd24aac1130fe",
"description": "A nicer version of microsoft/typescript packaged and released for API developers",
"main": "./bin/ntypescript.js",
"bin": {
Expand Down
27 changes: 20 additions & 7 deletions src/services/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1373,8 +1373,12 @@ namespace ts {
containerName: string;
}

export interface ReferencedSymbolDefinitionInfo extends DefinitionInfo {
displayParts: SymbolDisplayPart[];
}

export interface ReferencedSymbol {
definition: DefinitionInfo;
definition: ReferencedSymbolDefinitionInfo;
references: ReferenceEntry[];
}

Expand Down Expand Up @@ -6107,7 +6111,7 @@ namespace ts {

return result;

function getDefinition(symbol: Symbol): DefinitionInfo {
function getDefinition(symbol: Symbol): ReferencedSymbolDefinitionInfo {
const info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), node);
const name = map(info.displayParts, p => p.text).join("");
const declarations = symbol.declarations;
Expand All @@ -6121,7 +6125,8 @@ namespace ts {
name,
kind: info.symbolKind,
fileName: declarations[0].getSourceFile().fileName,
textSpan: createTextSpan(declarations[0].getStart(), 0)
textSpan: createTextSpan(declarations[0].getStart(), 0),
displayParts: info.displayParts
};
}

Expand Down Expand Up @@ -6316,13 +6321,14 @@ namespace ts {
}
});

const definition: DefinitionInfo = {
const definition: ReferencedSymbolDefinitionInfo = {
containerKind: "",
containerName: "",
fileName: targetLabel.getSourceFile().fileName,
kind: ScriptElementKind.label,
name: labelName,
textSpan: createTextSpanFromBounds(targetLabel.getStart(), targetLabel.getEnd())
textSpan: createTextSpanFromBounds(targetLabel.getStart(), targetLabel.getEnd()),
displayParts: [displayPart(labelName, SymbolDisplayPartKind.text)]
};

return [{ definition, references }];
Expand Down Expand Up @@ -6562,14 +6568,20 @@ namespace ts {
getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references);
}

const thisOrSuperSymbol = typeChecker.getSymbolAtLocation(thisOrSuperKeyword);

const displayParts = thisOrSuperSymbol && getSymbolDisplayPartsDocumentationAndSymbolKind(
thisOrSuperSymbol, thisOrSuperKeyword.getSourceFile(), getContainerNode(thisOrSuperKeyword), thisOrSuperKeyword).displayParts;

return [{
definition: {
containerKind: "",
containerName: "",
fileName: node.getSourceFile().fileName,
kind: ScriptElementKind.variableElement,
name: "this",
textSpan: createTextSpanFromBounds(node.getStart(), node.getEnd())
textSpan: createTextSpanFromBounds(node.getStart(), node.getEnd()),
displayParts
},
references: references
}];
Expand Down Expand Up @@ -6640,7 +6652,8 @@ namespace ts {
fileName: node.getSourceFile().fileName,
kind: ScriptElementKind.variableElement,
name: type.text,
textSpan: createTextSpanFromBounds(node.getStart(), node.getEnd())
textSpan: createTextSpanFromBounds(node.getStart(), node.getEnd()),
displayParts: [displayPart(getTextOfNode(node), SymbolDisplayPartKind.stringLiteral)]
},
references: references
}];
Expand Down

0 comments on commit d3600e3

Please sign in to comment.