mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-01-01 12:41:43 +08:00
Handle completion items without detail
This commit is contained in:
parent
2b5171fe92
commit
55dfb12827
2 changed files with 11 additions and 5 deletions
|
@ -430,10 +430,13 @@ export default class LiveEditor {
|
|||
// to not distract the user too much as they are typing
|
||||
return wait(350).then(() => {
|
||||
const node = document.createElement("div");
|
||||
const detail = document.createElement("div");
|
||||
detail.classList.add("cm-completionInfoDetail");
|
||||
detail.innerHTML = highlight(item.detail, this.language);
|
||||
node.appendChild(detail);
|
||||
|
||||
if (item.detail) {
|
||||
const detail = document.createElement("div");
|
||||
detail.classList.add("cm-completionInfoDetail");
|
||||
detail.innerHTML = highlight(item.detail, this.language);
|
||||
node.appendChild(detail);
|
||||
}
|
||||
|
||||
if (item.documentation) {
|
||||
const docs = document.createElement("div");
|
||||
|
|
|
@ -238,8 +238,11 @@ function buildEditorTheme(colors, { dark }) {
|
|||
},
|
||||
|
||||
"& .cm-completionInfoDocs": {
|
||||
borderTop: `1px solid ${colors.separator}`,
|
||||
padding: "6px",
|
||||
|
||||
"&:not(:first-child)": {
|
||||
borderTop: `1px solid ${colors.separator}`,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue