Skip to content
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

chore: update Svelte documentation links for template syntax #2579

Merged
Merged
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
22 changes: 15 additions & 7 deletions packages/language-server/src/plugins/svelte/features/SvelteTags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Await blocks allow you to branch on the three possible states of a Promise — p
\`{#await expression}...{:then name}...{/await}\`\\
\`{#await expression then name}...{/await}\`\\
\\
https://svelte.dev/docs#template-syntax-await
https://svelte.dev/docs/svelte/await
`,
each: `\`{#each ...}\`\\
Iterating over lists of values can be done with an each block.
Expand All @@ -33,7 +33,7 @@ Iterating over lists of values can be done with an each block.
\`{#each expression as name, index (key)}...{/each}\`\\
\`{#each expression as name}...{:else}...{/each}\`\\
\\
https://svelte.dev/docs#template-syntax-each
https://svelte.dev/docs/svelte/each
`,
if: `\`{#if ...}\`\\
Content that is conditionally rendered can be wrapped in an if block.
Expand All @@ -42,7 +42,7 @@ Content that is conditionally rendered can be wrapped in an if block.
\`{#if expression}...{:else if expression}...{/if}\`\\
\`{#if expression}...{:else}...{/if}\`\\
\\
https://svelte.dev/docs#template-syntax-if
https://svelte.dev/docs/svelte/if
`,
key: `\`{#key expression}...{/key}\`\\
Key blocks destroy and recreate their contents when the value of an expression changes.\\
Expand All @@ -51,14 +51,22 @@ When used around components, this will cause them to be reinstantiated and reini
#### Usage:
\`{#key expression}...{/key}\`\\
\\
https://svelte.dev/docs#template-syntax-key
https://svelte.dev/docs/svelte/key
`,
snippet: `\`{#snippet identifier(parameter)}...{/snippet}\`\\
Snippets allow you to create reusable UI blocks you can render with the {@render ...} tag.
They also function as slot props for components.
#### Usage:
\`{#snippet identifier(parameter)}...{/snippet}\`\\
\\
https://svelte.dev/docs/svelte/snippet
`,
render: `\`{@render ...}\`\\
Renders a snippet with the given parameters.
#### Usage:
\`{@render identifier(parameter)}\`\\
\\
https://svelte.dev/docs/svelte/@render
`,
html:
`\`{@html ...}\`\\
Expand All @@ -72,7 +80,7 @@ If the data comes from an untrusted source, you must sanitize it, ` +
#### Usage:
\`{@html expression}\`\\
\\
https://svelte.dev/docs#template-syntax-html
https://svelte.dev/docs/svelte/@html
`,
debug:
`\`{@debug ...}\`\\
Expand All @@ -84,14 +92,14 @@ It accepts a comma-separated list of variable names (not arbitrary expressions).
\`{@debug}\`
\`{@debug var1, var2, ..., varN}\`\\
\\
https://svelte.dev/docs#template-syntax-debug
https://svelte.dev/docs/svelte/@debug
`,
const: `\`{@const ...}\`\\
Defines a local constant}\\
#### Usage:
\`{@const a = b + c}\`\\
\\
https://svelte.dev/docs/special-tags#const
https://svelte.dev/docs/svelte/@const
`
};

Expand Down