Skip to content

Incorrect override code generated when choices contain commas #2813

Closed

Description

@DanTup

Originally raised at dart-lang/sdk#43460 by @jensjoha.

"Create missing overrides" when using DAS creates bad code here:

abstract class Foo<E, F> {
  E hello(Foo<E, F> x);
}

class Bar implements Foo<String, String> {
}

The cause is commas in the choices:

[12:44:34 PM] [General] [Info] Calling insertSnippet with:
${1|Foo<String, String>,Object|} ${2:x}

These should be escaped somewhere.

Activity

  1. added this to the v3.15.0 milestone on Sep 22, 2020
  2. DanTup commented on Sep 22, 2020

    @DanTup
    MemberAuthor

    It appears that VS Code doesn't escape the commas here (microsoft/vscode#107220), so I'll switch back to adding these manually for now.

  3. jensjoha commented on Sep 22, 2020

    @jensjoha

    From https://vscode.readthedocs.io/en/latest/editor/userdefinedsnippets/ (which, I suppose, talk about something slightly different)

    Within choice elements, the backslash also escapes comma and pipe characters.

    Update: Nevermind =)

  4. DanTup commented on Sep 22, 2020

    @DanTup
    MemberAuthor

    Yep, I've reverted to building these manually and escaping them (c6e01c4). If I just encode them and use appendChoice it'll become over-encoded if VS Code fixes the issue, so I'll leave it like this until it's fixed.

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresis bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions