Implements experimental inline suggestion hints. (#171846)

* Implements experimental inline suggestion hints.

* Fixes lint issue.

* Removes content widget on dispose
This commit is contained in:
Henning Dieterichs
2023-01-20 18:46:58 +01:00
committed by GitHub
parent 1f6c0b8780
commit afa19380da
12 changed files with 398 additions and 72 deletions

View File

@@ -1818,8 +1818,23 @@ export function h(tag: string, ...args: [] | [attributes: { $: string } & Partia
el.id = match.groups['id'];
}
const classNames = [];
if (match.groups['class']) {
el.className = match.groups['class'].replace(/\./g, ' ').trim();
for (const className of match.groups['class'].split('.')) {
if (className !== '') {
classNames.push(className);
}
}
}
if (attributes.className !== undefined) {
for (const className of attributes.className.split('.')) {
if (className !== '') {
classNames.push(className);
}
}
}
if (classNames.length > 0) {
el.className = classNames.join(' ');
}
const result: Record<string, HTMLElement> = {};
@@ -1842,7 +1857,9 @@ export function h(tag: string, ...args: [] | [attributes: { $: string } & Partia
}
for (const [key, value] of Object.entries(attributes)) {
if (key === 'style') {
if (key === 'className') {
continue;
} else if (key === 'style') {
for (const [cssKey, cssValue] of Object.entries(value)) {
el.style.setProperty(
camelCaseToHyphenCase(cssKey),