Skip to content

Commit

Permalink
Fix rendering of whitespace in markdown parameter hinds
Browse files Browse the repository at this point in the history
Fixes #48758
  • Loading branch information
mjbvz committed Apr 30, 2018
1 parent c94f12e commit 6dae5a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/vs/editor/contrib/parameterHints/parameterHints.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
white-space: pre-wrap;
}

.monaco-editor .parameter-hints-widget .docs.markdown-docs {
.monaco-editor .parameter-hints-widget .docs .markdown-docs {
white-space: initial;
}

Expand Down
5 changes: 3 additions & 2 deletions src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,15 +359,15 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable {
this.renderDisposeables = [];

const activeParameter = signature.parameters[this.hints.activeParameter];
dom.removeClass(this.docs, 'markdown-docs');

if (activeParameter && activeParameter.documentation) {
const documentation = $('span.documentation');
if (typeof activeParameter.documentation === 'string') {
dom.removeClass(this.docs, 'markdown-docs');
documentation.textContent = activeParameter.documentation;
} else {
dom.addClass(this.docs, 'markdown-docs');
const renderedContents = this.markdownRenderer.render(activeParameter.documentation);
dom.addClass(renderedContents.element, 'markdown-docs');
this.renderDisposeables.push(renderedContents);
documentation.appendChild(renderedContents.element);
}
Expand All @@ -380,6 +380,7 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable {
dom.append(this.docs, $('p', null, signature.documentation));
} else {
const renderedContents = this.markdownRenderer.render(signature.documentation);
dom.addClass(renderedContents.element, 'markdown-docs');
this.renderDisposeables.push(renderedContents);
dom.append(this.docs, renderedContents.element);
}
Expand Down

0 comments on commit 6dae5a3

Please sign in to comment.