Skip to content

Typescript/HTML Autocomplete doesn't work for Attributes/Properties with an underscore #56077

Closed

Description

@olivermuc
  • VSCode Version: Version 1.25.1 (1.25.1)
  • OS Version: Mac 10.13.5

Steps to Reproduce:

Typescript:

  1. Add a key with an "_", eg. data._custom_field to any data structure
  2. Then reference that data structure in the html template: {{ data._cus... }}

It will show all other data.* fields, but none of the ones with an underscore, no matter where the underscore is placed.

Even if the underscore might be seen as a declarator for a 'private field', this should at least be configurable.

Thanks,
Oliver

Activity

  1. vscodebot commented on Aug 9, 2018

    @vscodebot

    (Experimental duplicate detection)
    Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

  2. ramya-rao-a commented on Aug 9, 2018

    @ramya-rao-a
    Contributor
    • In what file type are you seeing this issue?
    • Can you share some sample code where we can try this?
  3. added
    info-needed
    on Aug 9, 2018
  4. olivermuc commented on Aug 10, 2018

    @olivermuc
    Author

    I gave an example above, the context is Typescript.

    Let‘s say you have a data structure defined:
    let data = { a:1, b:2, _c:3 }; with the corresponding interface def.

    In (or within) the TS file you can easily reference data._c and the autocompletion works fine.
    It doesn‘t work with intellisense when working in the html template file refereced by the TS file (or component therein):
    <span>this is a test {{ data.?? }}</span>

    It just doesn‘t show any attributes with an underscore.
    Removing the underscore from the interface declaration will immediately show the attribute.

    EDIT:

    Here a more visual example, this works in the TS file:
    image

    In its corresponding html template file, it doesn't show "_KpiN...":
    image

  5. olivermuc commented on Aug 10, 2018

    @olivermuc
    Author

    It looks like this could belong here: angular/vscode-ng-language-service#258

    Unless the completion handling is done in core...somewhere...

  6. olivermuc commented on Aug 14, 2018

    @olivermuc
    Author

    hi Matt Bierner (@mjbvz), let me know if you need any more input on this.
    'glad this is being looked at - as it's really taking away a key feature and reason our team switched to vs code.

  7. mjbvz commented on Aug 20, 2018

    @mjbvz
    Contributor

    Yes, we don't provide built-in support for angular templates. That all comes from the angular extension. Please open the issue against them

  8. locked and limited conversation to collaborators on Oct 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

info-needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions