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

Incorrect override code generated when choices contain commas #2813

Closed
DanTup opened this issue Sep 22, 2020 · 3 comments
Closed

Incorrect override code generated when choices contain commas #2813

DanTup opened this issue Sep 22, 2020 · 3 comments
Labels
in editor Relates to code editing or language features is bug
Milestone

Comments

@DanTup
Copy link
Member

DanTup commented Sep 22, 2020

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.

@DanTup DanTup added is bug in editor Relates to code editing or language features labels Sep 22, 2020
@DanTup DanTup added this to the v3.15.0 milestone Sep 22, 2020
@DanTup
Copy link
Member Author

DanTup commented Sep 22, 2020

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.

@DanTup DanTup closed this as completed in c6e01c4 Sep 22, 2020
@jensjoha
Copy link

jensjoha commented Sep 22, 2020

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 =)

@DanTup
Copy link
Member Author

DanTup commented Sep 22, 2020

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
Labels
in editor Relates to code editing or language features is bug
Projects
None yet
Development

No branches or pull requests

2 participants