mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-13 06:55:54 +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
|
// to not distract the user too much as they are typing
|
||||||
return wait(350).then(() => {
|
return wait(350).then(() => {
|
||||||
const node = document.createElement("div");
|
const node = document.createElement("div");
|
||||||
|
|
||||||
|
if (item.detail) {
|
||||||
const detail = document.createElement("div");
|
const detail = document.createElement("div");
|
||||||
detail.classList.add("cm-completionInfoDetail");
|
detail.classList.add("cm-completionInfoDetail");
|
||||||
detail.innerHTML = highlight(item.detail, this.language);
|
detail.innerHTML = highlight(item.detail, this.language);
|
||||||
node.appendChild(detail);
|
node.appendChild(detail);
|
||||||
|
}
|
||||||
|
|
||||||
if (item.documentation) {
|
if (item.documentation) {
|
||||||
const docs = document.createElement("div");
|
const docs = document.createElement("div");
|
||||||
|
|
|
@ -238,8 +238,11 @@ function buildEditorTheme(colors, { dark }) {
|
||||||
},
|
},
|
||||||
|
|
||||||
"& .cm-completionInfoDocs": {
|
"& .cm-completionInfoDocs": {
|
||||||
borderTop: `1px solid ${colors.separator}`,
|
|
||||||
padding: "6px",
|
padding: "6px",
|
||||||
|
|
||||||
|
"&:not(:first-child)": {
|
||||||
|
borderTop: `1px solid ${colors.separator}`,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue