Skip to content

Commit

Permalink
Format go doc comments as intended rather than treat them as Markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
segevfiner committed Jan 13, 2019
1 parent 43a7d68 commit 270547e
Show file tree
Hide file tree
Showing 5 changed files with 400 additions and 5 deletions.
35 changes: 34 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"dependencies": {
"diff": "^3.5.0",
"json-rpc2": "^1.0.2",
"xregexp": "^4.2.4",
"vscode-debugadapter": "^1.32.1",
"vscode-debugprotocol": "^1.32.0",
"vscode-extension-telemetry": "^0.1.0",
Expand All @@ -46,6 +47,7 @@
"@types/fs-extra": "^5.0.4",
"@types/mocha": "^5.2.5",
"@types/node": "^6.14.0",
"@types/xregexp": "^3.0.29",
"fs-extra": "^7.0.0",
"tslint": "^5.11.0",
"typescript": "^3.1.3",
Expand Down
6 changes: 3 additions & 3 deletions src/goExtraInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ export class GoHoverProvider implements HoverProvider {
.map(line => line.replace(/\t/g, ' '));
let text;
text = lines.join('\n').replace(/\n+$/, '');
let hoverTexts: MarkedString[] = [];
hoverTexts.push({ language: 'go', value: text });
let hoverTexts = new vscode.MarkdownString();
hoverTexts.appendCodeblock(text, 'go');
if (definitionInfo.doc != null) {
hoverTexts.push(definitionInfo.doc);
hoverTexts.appendMarkdown(definitionInfo.doc);
}
let hover = new Hover(hoverTexts);
return hover;
Expand Down
Loading

0 comments on commit 270547e

Please sign in to comment.