Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/language-server/src/plugins/PluginHost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ export class PluginHost implements LSProvider, OnWatchFileChanges {
return false;
}
if (label[0] === '"' && label[label.length - 1] === '"') {
if (htmlCompletions.has(label.slice(1, -1))) {
// this will result in a wrong completion regardless, remove the quotes
item.label = item.label.slice(1, -1);
if (htmlCompletions.has(item.label)) {
// "aria-label" -> aria-label -> exists in html completions
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class SemanticTokensProviderImpl implements SemanticTokensProvider {
continue;
}

const [line, character, length, start] = originalPosition;
const [line, character, length] = originalPosition;

// remove identifiers whose start and end mapped to the same location,
// like the svelte2tsx inserted render function,
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte2tsx/src/htmlxtojsx_v2/nodes/Attribute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export function handleAttribute(
return;
} else {
let name =
element instanceof Element && attr.value === true
element instanceof Element && parent.type === 'Element'
? transformAttributeCase(attr.name)
: attr.name;
// surround with quotes because dashes or other invalid property characters could be part of the name
Expand Down
8 changes: 4 additions & 4 deletions packages/svelte2tsx/svelte-jsx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ declare namespace svelteHTML {
interface AriaAttributes extends svelte.JSX.AriaAttributes {}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface HTMLAttributes<T extends EventTarget> extends svelte.JSX.HTMLAttributes<T> {
interface HTMLAttributes<T extends EventTarget> extends svelte.JSX.HTMLAttributes<T> {}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface SVGAttributes<T extends EventTarget> extends svelte.JSX.SVGAttributes<T> {
'xlink:actuate'?: string | undefined;
'xlink:arcrole'?: string | undefined;
'xlink:href'?: string | undefined;
Expand All @@ -83,9 +86,6 @@ declare namespace svelteHTML {
'xmlns:xlink'?: string | undefined;
}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface SVGAttributes<T extends EventTarget> extends svelte.JSX.SVGAttributes<T> {}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface HTMLProps<T extends EventTarget> extends HTMLAttributes<T> {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{ svelteHTML.createElement("div", {"contenteditable":true,}); }
{ svelteHTML.createElement("div", { contentEditable,}); }
{ svelteHTML.createElement("div", { "contentEditable":contenteditable,}); }
{ svelteHTML.createElement("div", { "contenteditable":contenteditable,}); }