Skip to content

(feat) autocompletion of svelte:document #2010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 11, 2023
Merged
Changes from 1 commit
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
18 changes: 17 additions & 1 deletion packages/language-server/src/plugins/html/dataProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ const svelteEvents = [
{ name: 'on:mouseenter' },
{ name: 'on:mouseleave' },
// Other
{ name: 'on:hashchange' }
{ name: 'on:hashchange' },
{ name: 'on:visibilitychange' }
];
const svelteAttributes: IAttributeData[] = [
{
Expand Down Expand Up @@ -182,6 +183,21 @@ const svelteTags: ITagData[] = [
}
]
},
{
name: 'svelte:document',
description:
"As with <svelte:window>, this element allows you to add listeners to events on document, such as visibilitychange, which don't fire on window.",
attributes: [
{
name: 'bind:fullscreenElement',
description: 'Bind to the element that is being in full screen mode in this document. (read-only)'
},
{
name: 'bind:visibilityState',
description: 'Bind to visibility of the document. (read-only)'
}
]
},
{
name: 'svelte:body',
description:
Expand Down