Skip to content

No autocomplete offered for nested properties when key starts with number #858

@zoran995

Description

@zoran995

Describe the bug

The language server in vscode doesn't offer autocomplete for nested object properties when the key starts with a number.
For example, when I type {{ address.2country. }} properties name and code are not offered, but if I replace 2country with country in the object definition, it will properly show the suggestions.

Source

custom object definition

[
  {
    name: 'address',
    access: {
      global: true,
      parents: [],
      template: []
    },
    properties: [
      {
        name: 'city',
        return_type: [
          {
            type: 'string',
            name: ''
          }
        ],
        access: {
          global: false,
          parents: [],
          template: []
        }
      },
      {
        name: '2country',
        return_type: [
          {
            type: 'country_data',
            name: ''
          }
        ],
        access: {
          global: false,
          parents: [],
          template: []
        }
      }
    ],
    return_type: []
  },
  {
    name: 'country_data',
    access: {
      global: false,
      parents: [],
      template: []
    },
    properties: [
      {
        name: 'name',
        return_type: [
          {
            type: 'string',
            name: ''
          }
        ],
        access: {
          global: false,
          parents: [],
          template: []
        }
      },
      {
        name: 'code',
        return_type: [
          {
            type: 'string',
            name: ''
          }
        ],
        access: {
          global: false,
          parents: [],
          template: []
        }
      }
    ]
  }
]

Expected behaviour
Autocomplete suggestions should be offered for elements that are starting with any alphanumeric characters.

Actual behaviour
Autocomplete suggestions aren't offered when the key starts with a number.

Debugging information

  • OS [e.g. Windows, Mac, Linux]
  • OS Version
  • Theme Check Version [e.g. 0.1.0]

Additional context
Any ideas on how to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions