mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
34489a2494
This commit adds the following: - Syntax builder scripts to make syntaxes easier to read and edit - Syntax highlight in single quote attributes - Syntax highlight for slot props - Basic syntax highlight for xpaths - Added `Switch Below` command This commit fixes the following: - Using `Switch Besides` or `Switch Below` does not open a new panel if one was already open - Fixed missing space in component's snippet indentation
49 lines
1.2 KiB
JavaScript
49 lines
1.2 KiB
JavaScript
import { createTagPattern, exportPatterns } from "./syntax_builder_utils.mjs";
|
|
import {
|
|
htmlAttributes,
|
|
owlAttributesDynamic,
|
|
owlAttributesFormattedString,
|
|
owlAttributesStatic,
|
|
propsAttributes
|
|
} from "./syntax_parts/owl_attributes.mjs";
|
|
import { xpathAttributes } from "./syntax_parts/xpath.mjs";
|
|
|
|
const componentsTags = createTagPattern("component-tags", {
|
|
match: "[A-Z][a-zA-Z0-9_]*",
|
|
name: "entity.name.type.class owl.component",
|
|
patterns: [
|
|
owlAttributesDynamic,
|
|
owlAttributesDynamic,
|
|
propsAttributes,
|
|
],
|
|
});
|
|
|
|
const htmlTags = createTagPattern("html-tags", {
|
|
match: "[a-z][a-zA-Z0-9_:.]+|[abiqsuw]",
|
|
name: "entity.name.tag.localname.xml owl.xml.tag",
|
|
patterns: [
|
|
owlAttributesFormattedString,
|
|
xpathAttributes,
|
|
owlAttributesDynamic,
|
|
owlAttributesStatic,
|
|
htmlAttributes,
|
|
],
|
|
});
|
|
|
|
const tTag = createTagPattern("t-tag", {
|
|
match: "t(?![a-zA-Z])",
|
|
name: "entity.name.tag.localname.xml owl.tag",
|
|
patterns: [
|
|
propsAttributes,
|
|
owlAttributesFormattedString,
|
|
owlAttributesDynamic,
|
|
owlAttributesStatic,
|
|
],
|
|
});
|
|
|
|
exportPatterns(
|
|
"L:text.xml -comment",
|
|
"owl.template",
|
|
[componentsTags, htmlTags, tTag]
|
|
);
|