Merge pull request #12856 from minestarks/includejsdoctags

Expose JSDoc tags through the language service
This commit is contained in:
Mine Starks
2016-12-12 15:29:29 -08:00
committed by Mine Starks
parent a62869c81e
commit af0b2d9768
48 changed files with 1899 additions and 529 deletions

View File

@@ -178,7 +178,8 @@ namespace ts.server {
kindModifiers: response.body.kindModifiers,
textSpan: ts.createTextSpanFromBounds(start, end),
displayParts: [{ kind: "text", text: response.body.displayString }],
documentation: [{ kind: "text", text: response.body.documentation }]
documentation: [{ kind: "text", text: response.body.documentation }],
tags: response.body.tags
};
}

View File

@@ -1319,6 +1319,11 @@ namespace ts.server.protocol {
* Documentation associated with symbol.
*/
documentation: string;
/**
* JSDoc tags associated with symbol.
*/
tags: JSDocTagInfo[];
}
/**
@@ -1549,6 +1554,11 @@ namespace ts.server.protocol {
* Documentation strings for the symbol.
*/
documentation: SymbolDisplayPart[];
/**
* JSDoc tags for the symbol.
*/
tags: JSDocTagInfo[];
}
export interface CompletionsResponse extends Response {
@@ -1619,6 +1629,11 @@ namespace ts.server.protocol {
* The signature's documentation
*/
documentation: SymbolDisplayPart[];
/**
* The signature's JSDoc tags
*/
tags: JSDocTagInfo[];
}
/**

View File

@@ -1020,6 +1020,7 @@ namespace ts.server {
if (simplifiedResult) {
const displayString = ts.displayPartsToString(quickInfo.displayParts);
const docString = ts.displayPartsToString(quickInfo.documentation);
return {
kind: quickInfo.kind,
kindModifiers: quickInfo.kindModifiers,
@@ -1027,6 +1028,7 @@ namespace ts.server {
end: scriptInfo.positionToLineOffset(ts.textSpanEnd(quickInfo.textSpan)),
displayString: displayString,
documentation: docString,
tags: quickInfo.tags || []
};
}
else {