diff --git a/packages/jupyterlab-lsp/src/components/free_tooltip.ts b/packages/jupyterlab-lsp/src/components/free_tooltip.ts index c3646e2e1..09a382f51 100644 --- a/packages/jupyterlab-lsp/src/components/free_tooltip.ts +++ b/packages/jupyterlab-lsp/src/components/free_tooltip.ts @@ -16,6 +16,8 @@ import { IEditorPosition } from '../positioning'; const MIN_HEIGHT = 20; const MAX_HEIGHT = 250; +const CLASS_NAME = 'lsp-tooltip'; + interface IFreeTooltipOptions extends Tooltip.IOptions { /** * Position at which the tooltip should be placed, or null (default) to use the current cursor position. @@ -171,6 +173,7 @@ export class EditorTooltipManager { rendermime: this.rendermime_registry, position: PositionConverter.cm_to_ce(position) }); + tooltip.addClass(CLASS_NAME); tooltip.addClass(options.className); Widget.attach(tooltip, document.body); this.currentTooltip = tooltip; diff --git a/packages/jupyterlab-lsp/style/index.css b/packages/jupyterlab-lsp/style/index.css index 4b28ab75a..f8c68eca8 100644 --- a/packages/jupyterlab-lsp/style/index.css +++ b/packages/jupyterlab-lsp/style/index.css @@ -1,5 +1,6 @@ @import url('./highlight.css'); -@import url('./hover.css'); +@import url('./tooltip.css'); +@import url('./signature.css'); .lsp-document-locator:hover { cursor: pointer; diff --git a/packages/jupyterlab-lsp/style/signature.css b/packages/jupyterlab-lsp/style/signature.css new file mode 100644 index 000000000..14b420a89 --- /dev/null +++ b/packages/jupyterlab-lsp/style/signature.css @@ -0,0 +1,3 @@ +.lsp-signature-help pre code { + font-size: var(--jp-code-font-size); +} diff --git a/packages/jupyterlab-lsp/style/hover.css b/packages/jupyterlab-lsp/style/tooltip.css similarity index 59% rename from packages/jupyterlab-lsp/style/hover.css rename to packages/jupyterlab-lsp/style/tooltip.css index 0c5e8171f..4dd05c3d8 100644 --- a/packages/jupyterlab-lsp/style/hover.css +++ b/packages/jupyterlab-lsp/style/tooltip.css @@ -1,9 +1,9 @@ -.lsp-hover .jp-RenderedHTMLCommon { +.lsp-tooltip .jp-RenderedHTMLCommon { /* Reduce the default padding from 20px to 0px */ padding-right: 0px; } -.lsp-hover .jp-RenderedHTMLCommon > *:last-child { +.lsp-tooltip .jp-RenderedHTMLCommon > *:last-child { /* Reduce the default margin */ margin-bottom: 0; }