Provides intellisense for data, events, slots etc. in components. Utilizes sveltedoc-parser for getting information about components.
This extension provides a features for svelte
language files. For basic support of svelte
files you should install this extension: VSCode Svelte that provides svelte syntax highlighting and syntax checks.
This extension supports a go to definition VSCode feature for quick navigation between components and references.
Just click to component usage in markup or symbol in import section and view its source code.
Also that works for component attributes, events, bind, slots:
Awesome navigation for methods calling:
Component documentation is provided on hover in template markup, import statement and components section.
Documentation of component events, props and slots provided as well.
import
statement in script pathAllows to quick search for the required files to import, like a script file or a svelte component. Also includes node_modules
folder in search results if it exists. Suggestions from node_modules
are marked with a special label.
components:
import statement (Svelte 2 only)use:
, transition:
, in:
, out:
, bind:
, class:
, ref:
.This extension supports all svelte blocks - if
, each
, await
- with inner branching.
The same is supported for writing a computed property.
Also provides auto-completion for this.refs.
(Svelte 2 only)
You can make a perfect documentation for your components with JSDoc syntax in comments (see example below). This documentation will be shown in completion items and on hover. You can read about all JSDoc features in sveltedoc-parser package documentation.
Basically, this extensions supports following JSDoc features:
@private
, @protected
, @public
attributes to filter completion items<button role="button" on:click="handleButtonClick()" disabled={disabled}>
{#if text}
{text}
{:else}
<!-- Slot to render a custom content when @see text is not specified -->
<slot></slot>
{/if}
</button>
<script>
/**
* Simple button UI element.
*/
export default {
data() {
return {
/**
* The plain text for button.
*/
text: '',
/**
* Indicates that this button can't be clicked
*/
disabled: false
};
},
methods: {
/**
* Custom button click handler.
* @private
*/
handleButtonClick() {
const { disabled } = this.get();
if (disabled) {
return;
}
/**
* Fires when user clicks on the button.
* @event click
*/
this.fire('click');
}
}
}
</script>