Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Commit

Permalink
Merge pull request #14 from kitsonk/feature-documentation
Browse files Browse the repository at this point in the history
Add documentation support on hover
  • Loading branch information
jrieken authored Jun 27, 2017
2 parents 8ce9803 + a3101cd commit c8118cb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/languageFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,19 @@ export class QuickInfoAdapter extends Adapter implements monaco.languages.HoverP
if (!info) {
return;
}
let documentation = ts.displayPartsToString(info.documentation);
let tags = info.tags ? info.tags.map(tag => {
const label = `*@${tag.name}*`;
if (!tag.text) {
return label;
}
return label + (tag.text.match(/\r\n|\n/g) ? ' \n' + tag.text : ` - ${tag.text}`);
})
.join(' \n\n') : '';
let contents = ts.displayPartsToString(info.displayParts);
return {
range: this._textSpanToRange(resource, info.textSpan),
contents: [contents]
contents: [ contents, documentation + (tags ? '\n\n' + tags : '') ]
};
}));
}
Expand Down

0 comments on commit c8118cb

Please sign in to comment.