Skip to content

update a bunch of templates to be more in line with stencil > 1.8 #6

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,6 @@ export const LIFECYCLE_METHODS: CompletionItem[] = [
});

export const METHODS: CompletionItem[] = [
{
label: 'hostData',
description: 'The `hostData()` method is used to dynamically set host element attributes.',
insertText: [
"hostData() {",
"\treturn {",
"\t\t$0",
"\t}",
"}"
],
preview: [
"hostData() {",
"\treturn {",
"\t\t",
"\t}",
"}"
]
},
{
label: 'render',
description: 'The `render()` method is required in order to render the component.',
Expand Down Expand Up @@ -154,24 +136,23 @@ export const DECORATORS: CompletionItem[] = [
{
label: 'Prop',
description: 'The `@Prop()` decorator exposes custom attribute/properties publicly on the element, so that developers can provide values to the component.',
insertText: "@Prop() ${1:propName}: ${2|any,string,boolean,number|};",
preview: "@Prop() propName: any;",
insertText: "@Prop(${3|{ mutable: true },{ reflect: true }|}) ${1:propName}: ${2|any,string,boolean,number|};",
preview: "@Prop({ mutable: true }) propName: any;",
autoImport: 'Prop'
},
{
label: 'Watch',
description: "When a user updates a property, `@Watch()` will fire what ever method it's attached to and pass that methd the new value of the prop along with the old value.",
insertText: [
"@Watch('${1%computedProps%}')",
"${1}Changed() {",
"\t${2:console.log('$1 changed to ', this.$1);}$0",
"${1}Changed(newValue: ${2|any,string,boolean,number|}, oldValue: $2) {",
"\t${3:console.log('$1 changed to ', this.$1);}$0",
"}"
],
preview: [
"@Watch('propName')",
"propNameChanged() {",
"\tconst { propName } = this;",
"\tconsole.log('propName changed to ', propName);",
"propNameChanged(newValue, oldValue) {",
"\tconsole.log('propName changed to ', this.propName);",
"}"
],
autoImport: 'Watch'
Expand Down Expand Up @@ -226,7 +207,7 @@ export const DECORATORS: CompletionItem[] = [
description: "The `Listen()` decorator is for handling events dispatched from @Events.",
insertText: [
"@Listen('${1|body,child,document,keydown,parent,window|}')",
"protected ${2:listenHandler}(event) {",
"protected ${2:$1Handler}(event) {",
"\t${3:console.log('Received the \"$1\" event: ', event);}$0",
"}"
],
Expand Down