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: Autocompletion in xml and added missing owl directives #1617

Merged

Conversation

BastienFafchamps
Copy link
Contributor

This commit adds basic autocomplete in xml files. This includes autocompletion for elements, components, props, attributes, and javascript expressions.

The current implementation, while relatively simple, has a couple of drawbacks:

  • Javascript imports are not resolved by the xml autocomplete, this means that it does not understand the types of imported functions or objects. That said, I've added custom support for frequently used Owl imports, namely useState and useRef. More can be added in the settings if needed.
  • The autocomplete is limited to templates directly linked to components, sub-templates used via t-call will not get autocompletion as no component/context can be bound to them.

This commit 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

@BastienFafchamps BastienFafchamps force-pushed the owl-vision-0.1.0-autocompletion branch from 8a277b2 to bf2eeaf Compare June 5, 2024 14:24
@BastienFafchamps BastienFafchamps changed the title [IMP] owl-vision: Autocomplete in xml and added missing owl directives [IMP] owl-vision: Autocompletion in xml and added missing owl directives Jun 5, 2024
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
@BastienFafchamps BastienFafchamps force-pushed the owl-vision-0.1.0-autocompletion branch from bf2eeaf to 0ddba65 Compare June 11, 2024 08:12
@ged-odoo ged-odoo merged commit 55c48b2 into odoo:master Jun 11, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants