Files
owl/tools/owl-vision/scripts/owl_template_syntax.mjs
T
Bastien Fafchamps (bafa) 34489a2494 [IMP] owl-vision: syntax scripts, single quotes attributes and slot props highlight and switch below command
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
2023-11-02 14:38:31 +01:00

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]
);