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

[IMP] owl-vision: Better snippets #1595

Merged
merged 1 commit into from
Mar 14, 2024
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
33 changes: 29 additions & 4 deletions tools/owl-vision/snippets/component.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,43 @@
{
"Basic owl component": {
"Basic OWL Component": {
"prefix": "owlcomponent",
"scope": "javascript,typescript",
"body": [
"export class ${1:component-name} extends Component {",
" static template = \"${2:template-name}\";",
"import { Component } from \"@odoo/owl\";",
"",
"class ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}} extends ${2:Component} {",
"",
" static template = \"${3:${RELATIVE_FILEPATH/(.*[\\|\\/])??([a-zA-Z_]+)([\\|\\/]static[\\|\\/].*)/${2}/g}}.${4:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}}\";",
" static components = {};",
" static props = {};",
"",
" setup() {",
"",
" ${5:super.setup();}",
" }",
"",
" ${6:// Do Something}",
"}",
""

],
"description": "The starting base for an owl component"
},

"Basic OWL Template": {
"prefix": "owltemplate",
"scope": "xml",
"body": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>",
"",
"<templates xml:space=\"preserve\">",
"",
" <t t-name=\"${2:${RELATIVE_FILEPATH/(.*[\\|\\/])??([a-zA-Z_]+)([\\|\\/]static[\\|\\/].*)/${2}/g}}.${3:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}}\">",
" ${3:<h1>Hello World</h1>}",
" </t>",
"",
"</templates>",
""
],
"description": "Generate a basic OWL template XML file"
}
}
Loading