Files
owl/tools/owl-vision/package.json
Bastien Fafchamps (bafa) 55c48b2b12 [IMP] owl-vision: Autocomplete and added missing owl directives
This commit adds basic autocomplete in  xml files. This includes autocompletion
for elements, components, props, attributes, and javascript expressions.

It also:
- Adds "Go To Definition" support for props and javascript expressions in xml
- Support for the following directives: t-att, t-model, t-tag, t-debug, t-log
- Fixes t-else syntax highlight to be non-dynamic as the attribute value
should be empty
2024-06-11 10:18:03 +02:00

151 lines
5.2 KiB
JSON

{
"name": "owl-vision",
"displayName": "Owl Vision",
"description": "Owl framework extension that highlights templates and ease navigation between components and templates.",
"publisher": "Odoo",
"license": "LGPL-3.0-only",
"version": "0.1.0",
"repository": {
"type": "git",
"url": "https://github.com/odoo/owl/tree/master/tools/owl-vision"
},
"icon": "assets/icon128.png",
"engines": {
"vscode": "^1.73.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onLanguage:xml",
"onLanguage:js"
],
"main": "./out/main.js",
"contributes": {
"commands": [
{
"command": "owl-vision.switch",
"title": "Switch",
"category": "Owl Vision"
},
{
"command": "owl-vision.switch-besides",
"title": "Switch (Besides)",
"category": "Owl Vision"
},
{
"command": "owl-vision.switch-below",
"title": "Switch (Below)",
"category": "Owl Vision"
},
{
"command": "owl-vision.find-component",
"title": "Find Component",
"category": "Owl Vision"
},
{
"command": "owl-vision.find-template",
"title": "Find Template",
"category": "Owl Vision"
}
],
"configuration": {
"title": "Owl Vision",
"properties": {
"owl-vision.include": {
"order": 0,
"type": "string",
"default": "**/*.js,**/*.ts,**/*.mjs,**/static/**/*.xml",
"description": "Files to include in search"
},
"owl-vision.exclude": {
"order": 1,
"type": "string",
"default": "**/node_modules/**,**/lib/**,**/tests/**",
"description": "Files to exclude in search"
},
"owl-vision.autocomplete-mocks": {
"order": 2,
"type": "string",
"editPresentation": "multilineText",
"default": "/**\n* @template T\n* @param {T} obj\n* @returns {T}\n*/\nfunction useState(obj) {}\n\n/**\n* @typedef {Object} Ref\n* @property {HTMLElement} el\n*/\n/**\n* @returns {Ref}\n*/\nfunction useRef(name) {}",
"description": "Mocks for functions or object that are imported but not resolved by the autcomplete. Add docstring comments for them to work properly."
}
}
},
"snippets": [
{
"language": "javascript",
"path": "./snippets/component.json"
}
],
"grammars": [
{
"scopeName": "owl.template",
"path": "./syntaxes/owl.template.json",
"embeddedLanguages": {
"meta.embedded.block.javascript": "source.js"
},
"injectTo": [
"text.xml"
]
},
{
"scopeName": "owl.template.inline",
"path": "./syntaxes/owl.template.inline.json",
"embeddedLanguages": {
"meta.embedded.block.xml": "xml"
},
"injectTo": [
"source.js",
"source.jsx",
"source.ts",
"source.tsx",
"text.html"
]
},
{
"scopeName": "owl.markup.inline",
"path": "./syntaxes/owl.markup.inline.json",
"embeddedLanguages": {
"meta.embedded.block.html": "html"
},
"injectTo": [
"source.js",
"source.jsx",
"source.ts",
"source.tsx",
"text.html"
]
}
]
},
"scripts": {
"compile": "tsc -p ./",
"package": "vsce package",
"watch": "tsc -watch -p ./",
"lint": "eslint src --ext ts",
"pretest": "npm run compile && npm run lint",
"vscode:prepublish": "npm run esbuild-base -- --minify",
"esbuild-base": "esbuild ./src/extension.ts --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node",
"esbuild": "npm run esbuild-base -- --sourcemap",
"esbuild-watch": "npm run esbuild-base -- --sourcemap --watch",
"build-syntax": "node ./scripts/owl_template_syntax.mjs"
},
"devDependencies": {
"@types/node": "20.2.5",
"@types/vscode": "^1.73.0",
"@types/xmldoc": "^1.1.9",
"@typescript-eslint/eslint-plugin": "^5.59.8",
"@typescript-eslint/parser": "^5.59.8",
"@vscode/test-electron": "^2.3.2",
"@vscode/vsce": "^2.20.1",
"esbuild": "^0.19.5",
"eslint": "^8.41.0",
"typescript": "^5.1.3"
},
"dependencies": {
"xmldoc": "^1.3.0"
}
}