Skip to content

Bracketed property completion should escape string property name #21461

@mjbvz

Description

@mjbvz

TypeScript Version: 2.7.1-insiders.20180129

Search Terms:

  • Bracketed property completion
  • insertText

Code

const z = {
    '"': 1
}
z.

Accept suggestion for " on z.

Expected behavior:

const z = {
    '"': 1
}
z['"']

or

const z = {
    '"': 1
}
z["\""]

Actual behavior:

const z = {
    '"': 1
}
z["""]

Another example:

const z = {
    'a\nz': 1
}
z.

completes to:

const z = {
    'a\nz': 1
}
z["a
z"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions