Skip to content

Commit

Permalink
Merge commit 'refs/pull/62584/head' of github.com:Microsoft/vscode in…
Browse files Browse the repository at this point in the history
…to pr/62584
  • Loading branch information
joaomoreno committed Aug 5, 2019
2 parents a3984f7 + 7e3ad32 commit f43b8f2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/vs/editor/contrib/parameterHints/parameterHints.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
white-space: pre-wrap;
}

.monaco-editor .parameter-hints-widget .docs.empty {
display: none;
}

.monaco-editor .parameter-hints-widget .docs .markdown-docs {
white-space: initial;
}
Expand Down
19 changes: 17 additions & 2 deletions src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ export class ParameterHintsWidget extends Disposable implements IContentWidget,
dom.append(this.docs, $('p', {}, documentation));
}

dom.toggleClass(this.signature, 'has-docs', !!signature.documentation);

if (signature.documentation === undefined) { /** no op */ }
else if (typeof signature.documentation === 'string') {
dom.append(this.docs, $('p', {}, signature.documentation));
Expand All @@ -218,6 +216,23 @@ export class ParameterHintsWidget extends Disposable implements IContentWidget,
dom.append(this.docs, renderedContents.element);
}

let hasDocs = false;
if (activeParameter && typeof (activeParameter.documentation) === 'string' && activeParameter.documentation.length > 0) {
hasDocs = true;
}
if (activeParameter && typeof (activeParameter.documentation) === 'object' && activeParameter.documentation.value.length > 0) {
hasDocs = true;
}
if (typeof (signature.documentation) === 'string' && signature.documentation.length > 0) {
hasDocs = true;
}
if (typeof (signature.documentation) === 'object' && signature.documentation.value.length > 0) {
hasDocs = true;
}

dom.toggleClass(this.signature, 'has-docs', hasDocs);
dom.toggleClass(this.docs, 'empty', !hasDocs);

let currentOverload = String(hints.activeSignature + 1);

if (hints.signatures.length < 10) {
Expand Down

0 comments on commit f43b8f2

Please sign in to comment.